Download the PHP package phnuestro/nativephp-local-notifications without Composer
On this page you can find all versions of the php package phnuestro/nativephp-local-notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phnuestro/nativephp-local-notifications
More information about phnuestro/nativephp-local-notifications
Files in phnuestro/nativephp-local-notifications
Package nativephp-local-notifications
Short Description Local notifications for NativePHP Mobile applications
License MIT
Informations about the package nativephp-local-notifications
NativePHP Local Notifications
A NativePHP Mobile v4 plugin for displaying and scheduling local notifications from Laravel. It uses UNUserNotificationCenter on iOS and NotificationManager plus AlarmManager on Android, with no third-party native dependencies.
Features
- Request and inspect notification permission
- Display immediately or schedule for later
- Attach application data and an optional deep-link URL
- List pending notifications
- Cancel one or all notifications
- Configure Android notification channels per notification
- Call the same bridge from PHP or JavaScript
Install in a local Laravel application
Add a path repository to the Laravel application's composer.json:
Then install and register it:
Native code is compiled into the app, so changes under resources/android or resources/ios require rebuilding the native app. If the manifest changes significantly, run php artisan native:install --force first.
PHP usage
Omit at to show the notification immediately. An integer at value is interpreted as a Unix timestamp in seconds.
Publish the optional configuration file to change the default Android channel:
JavaScript usage
Copy or expose resources/js/localNotifications.js through your app's asset build, then:
Platform notes
- Android 13+ asks for
POST_NOTIFICATIONS; older Android versions grant notification access at install time. - On Android 13+, the first
requestPermission()call returnsstatus: promptedwhile the system dialog is open. CallpermissionStatus()after the user responds when your UI needs the final result. - Android scheduled notifications use
setAndAllowWhileIdle, which is battery-friendly but not exact. This avoids the restricted exact-alarm permission. - Android alarms do not survive a device reboot. Reschedule important reminders when the app next starts.
- On Android,
urlis placed on the launch intent and notificationdatais included as thelocal_notification_dataJSON extra. - On iOS,
dataandurlare placed in the notification'suserInfo. Routing a notification tap into Laravel depends on the host application's notification delegate/deep-link setup. - iOS may cap the number of pending local notifications. Avoid scheduling an unbounded queue.
Validation and tests
Device-level behavior should be verified on both a physical Android device and iPhone because simulators do not reproduce every permission, battery, and delivery condition.
License
MIT
All versions of nativephp-local-notifications with dependencies
illuminate/contracts Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
nativephp/mobile Version ^4.0