ikromjon / nativephp-mobile-local-notifications
Local notifications plugin for NativePHP Mobile - schedule, cancel, and manage local notifications with channels, badges, sounds, and repeat intervals
Package info
github.com/Ikromjon1998/nativephp-mobile-local-notifications
Type:nativephp-plugin
pkg:composer/ikromjon/nativephp-mobile-local-notifications
Requires
- php: ^8.3
- illuminate/support: ^11.0||^12.0
- nativephp/mobile: ^3.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.28
- orchestra/testbench: ^9.0
- pestphp/pest: ^3.0
- phpstan/phpstan: ^2.0
- rector/rector: ^2.3
- dev-main
- v1.10.0
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
- dev-feature/epic-9-notification-priority
- dev-feature/type-improvements
- dev-feature/epic-8-custom-sounds
- dev-feature/epic-7-notification-update
- dev-feature/open-source-readiness
- dev-feature/cold-start-init-component
- dev-feature/publishable-config
- dev-copilot/sub-pr-12
- dev-fix/10-notification-tapped-event-not-reaching-livewire
- dev-feature/js-support-and-dependency-alignment-with-docs
- dev-fix/notification-tap-open-app
- dev-feature/epic-5
- dev-bugfix/android-repeat-notifications
This package is auto-updated.
Last update: 2026-04-17 20:01:18 UTC
README
NativePHP Mobile Local Notifications
Schedule, manage, and cancel local notifications in your NativePHP Mobile app — no server or Firebase required.
Quick Start
use Ikromjon\LocalNotifications\Facades\LocalNotifications; // Request permission (required on Android 13+ and iOS) LocalNotifications::requestPermission(); // Schedule a notification in 10 seconds LocalNotifications::schedule([ 'id' => 'welcome', 'title' => 'Hello!', 'body' => 'Your first local notification', 'delay' => 10, ]);
How is this different?
| Plugin | What it does | Requires |
|---|---|---|
| nativephp/mobile-dialog | Toast/snackbar messages (in-app only, disappear when app closes) | Nothing |
| nativephp/mobile-firebase | Push notifications from a server via FCM/APNs | Firebase project, server, internet |
| This plugin | Local notifications scheduled on-device | Nothing — works offline |
Features
- Schedule notifications with a delay or at a specific time
- Repeat intervals: minute, hourly, daily, weekly, monthly, yearly
- Custom repeat intervals (any duration >= 60 seconds)
- Day-of-week scheduling (e.g. every Mon/Wed/Fri at 9 AM)
- Repeat count limits (fire N times then stop)
- Rich content: images, subtitles, and expanded text
- Action buttons with text input support (configurable limit, default 3)
- Native snooze (reschedules without opening the app)
- Custom sounds, badges, and data payloads
- Cancel individual or all notifications
- List pending notifications
- Update existing notifications
- Permission management (Android 13+, iOS)
- Laravel Notification channel support
- Survives device reboot (Android)
- Events for notification lifecycle (scheduled, received, tapped, action pressed)
- Cold-start tap event auto-flush via Blade component
- Works completely offline — no server or Firebase needed
Documentation
| Guide | Description |
|---|---|
| Getting Started | Installation, configuration, cold-start setup, requirements |
| Scheduling | Schedule, cancel, update, list notifications, type-safe DTO |
| Events | Listen in Livewire, Laravel event listeners, or JavaScript |
| Repeat Intervals | Standard intervals, custom durations, day-of-week, count limits |
| Rich Content | Images, subtitles, expanded text |
| Custom Sounds | Custom sound files per notification |
| Action Buttons | Tap actions, text input, native snooze |
| Laravel Notification Channel | Standard $user->notify() pattern |
| JavaScript API | Full API for Vue, React, and Inertia apps |
| Permissions | Android and iOS permission requirements |
| Troubleshooting | Common issues and solutions |
| Upgrading | Migration guides between versions |
Example App
Daily Habits is a full, open-source mobile app built with this plugin. It demonstrates scheduling, action buttons, snooze, custom sounds, the Laravel Notification channel, and a notification debug panel with 9 test scenarios.
Testing
composer test # Run tests composer analyse # Run static analysis
Contributing
Contributions are welcome! See CONTRIBUTING.md for setup instructions, development workflow, and guidelines.
Changelog
See CHANGELOG.md for a list of changes in each release.
Roadmap
See ROADMAP.md for planned features and their status.
Support
For questions or issues, use GitHub Issues or contact: ikromjon98.98@icloud.com
License
MIT
