pushinbr / pam-native-widgets
Android App Widgets and iOS WidgetKit timelines for PAM Native.
Package info
github.com/push-in/pam-native-widgets
Language:Swift
Type:pam-native-plugin
pkg:composer/pushinbr/pam-native-widgets
Requires
- php: ^8.5
- pushinbr/pam-native: ^0.8 || ^0.9 || ^0.10 || ^1.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Put useful application state on the home screen.
Publish typed widget state and deep links to Android App Widgets and iOS WidgetKit without running the full application UI.
Install · Quick example · Platforms · API · Docs · Issues
Install
Inside a PAM Native project, add only this capability:
pam composer require pushinbr/pam-native-widgets pam doctor --fix
Autolinking creates the WidgetKit extension, shared entitlements, Android receiver, resources and native bridge. Use pam packages to inspect installed capabilities and pam composer remove pushinbr/pam-native-widgets to uninstall.
New to PAM? Create a project with pam init my-app --template native (see the PAM Native overview).
Quick example
use Pam\Native\Widgets\WidgetContent; use Pam\Native\Widgets\Widgets; (new Widgets())->update( 'account-summary', new WidgetContent( title: 'Available balance', subtitle: 'Updated just now', value: '$1,284.00', deepLink: 'myapp://account', ), static fn (bool $updated, ?string $error) => null, );
Widgets are not a background PHP runtime: prepare their display model in the app, then call Widgets::update(). State goes through process-safe shared storage; on iOS that is the app group group.<application-id>.pam-native, shared by the generated app and widget targets. Keep values small and non-sensitive because they can appear while the device is locked. The identifier is stable application metadata, not a per-device widget instance ID.
Platform support
| Platform | Support | Notes |
|---|---|---|
| Android | API 26+ | App Widget receiver PamWidgetProvider; no permissions declared |
| iOS | 16.0+ | WidgetKit, SwiftUI; generated PamWidgets extension and app group entitlement |
| PAM Native | 0.8.0 to < 2.0.0 | From pam-native.plugin.json; PHP 8.5+ |
What you can build
- Glanceable dashboards and status cards
- Shortcuts into high-value app actions
- Schedules, habits, finance and media widgets
| Native path | Android App Widgets · WidgetKit |
| Application model | Composer package + generated native integration |
| Design rule | Independent module; no feed, vertical or application template bundled |
API
| API | Responsibility |
|---|---|
Widgets::update(string $identifier, WidgetContent $content, Closure $complete) |
Publish bounded, process-safe widget state; $complete(bool $updated, ?string $error) |
WidgetContent(title, subtitle, value, deepLink) |
Title (at most 128 bytes), subtitle (256), value (128) and an optional scheme:// deep link (2048) |
Widget content is intentionally bounded; use deep links to open rich application screens.
Production checklist
- Treat widgets as snapshots, not background PHP processes.
- Keep lock-screen-visible content small and non-sensitive.
- Use stable widget identifiers and valid deep links into named routes.
- Run
pam doctor,pam test, and a signed release build on every supported platform. - Exercise denial, cancellation, backgrounding, process restart and offline behavior before release.
Troubleshooting
- iOS widget is empty: verify the shared app group and extension signing.
- Android widget is stale: publish new state before requesting refresh.
- A deep link opens the wrong screen: validate it through the main app router.
- Native integration is stale: run
pam doctor --fix, rebuild the native host, and inspect the first reported diagnostic.
Platform SDKs, credentials, entitlements, physical hardware and store configuration remain application responsibilities. Report security vulnerabilities through the repository security policy or GitHub private vulnerability reporting, not a public issue.
Docs
Part of the PAM ecosystem
PAM runs PHP natively on servers, desktops and phones. This repository is one piece of it.
| PAM | PAM Desktop | PAM Native | Ecosystem |
|---|---|---|---|
| the runtime and CLI | native desktop apps in PHP | native Android and iOS apps in PHP | every official package and plugin |
Docs: push-in.github.io/pam-docs · Issues
Apache License 2.0 · Made in Brazil by Pushin