ikromjon/nativephp-mobile-local-notifications

Local notifications plugin for NativePHP Mobile - schedule, cancel, and manage local notifications with channels, badges, sounds, and repeat intervals

Maintainers

Package info

github.com/Ikromjon1998/nativephp-mobile-local-notifications

Type:nativephp-plugin

pkg:composer/ikromjon/nativephp-mobile-local-notifications

Statistics

Installs: 167

Dependents: 0

Suggesters: 0

Stars: 5

Open Issues: 1


README

Local Notifications Logo

NativePHP Mobile Local Notifications

Latest Version on Packagist Tests Total Downloads License

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