Download the PHP package phnuestro/local-notifications without Composer
On this page you can find all versions of the php package phnuestro/local-notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phnuestro/local-notifications
More information about phnuestro/local-notifications
Files in phnuestro/local-notifications
Package local-notifications
Short Description Local notification plugin for NativePHP Mobile — schedule, cancel and react to native notifications from Laravel.
License MIT
Informations about the package local-notifications
Local Notifications for NativePHP Mobile
Schedule, cancel, and react to local (on-device) notifications from Laravel — no Firebase or server round-trip required.
Installation
In your NativePHP Mobile app:
If you haven't tagged a stable release on GitHub yet, pin to the branch instead:
Working on the plugin itself alongside an app? Use a local path repo so edits are picked up without a Packagist round-trip:
Native code only takes effect after a full native build:
Usage (PHP / Livewire / Blade)
Usage (Vue / React / Inertia)
The plugin's JS bridge lives at vendor/phnuestro/local-notifications/resources/js/localNotification.js. Point your bundler at it with an alias — add this to vite.config.js:
Then import as normal:
schedule() options
| Option | Type | Description |
|---|---|---|
id |
string |
Unique id. Auto-generated if omitted. |
delay |
int |
Seconds from now to fire. |
at |
int\|DateTime |
Absolute time to fire. Takes precedence over delay. |
data |
array |
Custom payload, returned via NotificationTapped. |
sound |
bool |
Play the default notification sound. Default true. |
badge |
int |
App icon badge count (iOS). |
channelId |
string |
Android notification channel id. Default default. |
channelName |
string |
Android notification channel display name. |
Notes / next steps
- Android 13+ requires
POST_NOTIFICATIONSruntime permission — callrequestPermission()before your firstschedule(). - Exact alarms: on Android 12+, scheduling precise-time alarms needs
SCHEDULE_EXACT_ALARM(already declared innativephp.json); the bridge falls back to an inexact alarm if the user hasn't granted it. - iOS delegate:
LocalNotificationDelegateneeds to be set asUNUserNotificationCenter.current().delegateduring app init. If you also installnativephp/mobile-firebasefor push notifications, chain the delegates so both receive their callbacks (see that plugin's docs for the pattern). - Repeating notifications, action buttons, and custom sounds aren't implemented yet — the bridge functions and manifest are structured so you can add them without breaking the PHP API.
- Run
php artisan native:plugin:validateafter any manifest or bridge-function change.