ikromjon/nativephp-mobile-local-notifications
最新稳定版本:v1.10.0
Composer 安装命令:
composer require ikromjon/nativephp-mobile-local-notifications
包简介
Local notifications plugin for NativePHP Mobile - schedule, cancel, and manage local notifications with channels, badges, sounds, and repeat intervals
README 文档
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
统计信息
- 总下载量: 155
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-08
