@@ -18,7 +18,7 @@ The fastest way to set up notifications in your Flutter Magic project:
1818
1919``` bash
2020# Run interactive installation wizard
21- dart run fluttersdk_magic_notifications: install
21+ dart run magic_notifications install
2222```
2323
2424The CLI will:
@@ -32,17 +32,17 @@ The CLI will:
3232
3333``` bash
3434# Non-interactive mode (for CI/CD)
35- dart run fluttersdk_magic_notifications: install \
35+ dart run magic_notifications install \
3636 --non-interactive \
3737 --app-id YOUR_ONESIGNAL_APP_ID \
3838 --platforms android,ios,web
3939
4040# Disable soft prompt
41- dart run fluttersdk_magic_notifications: install \
41+ dart run magic_notifications install \
4242 --no-soft-prompt
4343
4444# Web options: Safari Web ID and Notify Button
45- dart run fluttersdk_magic_notifications: install \
45+ dart run magic_notifications install \
4646 --non-interactive \
4747 --app-id YOUR_APP_ID \
4848 --platforms web \
@@ -68,8 +68,8 @@ Add to your `pubspec.yaml`:
6868
6969``` yaml
7070dependencies :
71- fluttersdk_magic_notifications :
72- path : ./plugins/fluttersdk_magic_notifications
71+ magic_notifications :
72+ path : ./plugins/magic_notifications
7373` ` `
7474
7575Then run:
@@ -291,7 +291,7 @@ Get your Safari Web ID from: OneSignal Dashboard → Settings → Platforms →
291291Or use the CLI to generate this automatically:
292292
293293``` bash
294- dart run fluttersdk_magic_notifications: install \
294+ dart run magic_notifications install \
295295 --non-interactive \
296296 --app-id YOUR_APP_ID \
297297 --platforms web \
@@ -321,7 +321,7 @@ Add GCM sender ID:
321321In your app's ` lib/config/app.dart ` :
322322
323323``` dart
324- import 'package:fluttersdk_magic_notifications/fluttersdk_magic_notifications .dart';
324+ import 'package:magic_notifications/magic_notifications .dart';
325325
326326final appConfig = {
327327 'name': 'Your App',
@@ -363,7 +363,7 @@ The recommended approach is to start polling when the authenticated layout mount
363363
364364``` dart
365365// In your AppLayout or AuthenticatedLayout widget:
366- import 'package:fluttersdk_magic_notifications/fluttersdk_magic_notifications .dart';
366+ import 'package:magic_notifications/magic_notifications .dart';
367367
368368class _AppLayoutState extends State<AppLayout> {
369369 @override
@@ -385,7 +385,7 @@ class _AppLayoutState extends State<AppLayout> {
385385In your ` AuthController ` or login handler:
386386
387387``` dart
388- import 'package:fluttersdk_magic_notifications/fluttersdk_magic_notifications .dart';
388+ import 'package:magic_notifications/magic_notifications .dart';
389389
390390Future<void> onLoginSuccess(User user) async {
391391 // 1. Request push notification permission
@@ -493,16 +493,18 @@ For framework-specific setup instructions, see:
493493
494494## CLI Commands
495495
496+ All commands use the single entry point ` dart run magic_notifications [command] ` :
497+
496498### Install
497499
498500Interactive wizard to set up notifications:
499501
500502``` bash
501503# Interactive mode
502- dart run fluttersdk_magic_notifications: install
504+ dart run magic_notifications install
503505
504506# Non-interactive mode
505- dart run fluttersdk_magic_notifications: install \
507+ dart run magic_notifications install \
506508 --non-interactive \
507509 --app-id YOUR_APP_ID \
508510 --platforms android,ios,web \
@@ -515,72 +517,124 @@ Update notification configuration:
515517
516518``` bash
517519# Show current configuration
518- dart run fluttersdk_magic_notifications: configure --show
520+ dart run magic_notifications configure --show
519521
520522# Update OneSignal App ID
521- dart run fluttersdk_magic_notifications: configure --app-id NEW_APP_ID
523+ dart run magic_notifications configure --app-id NEW_APP_ID
522524
523525# Update polling interval (5-600 seconds)
524- dart run fluttersdk_magic_notifications: configure --polling-interval 60
526+ dart run magic_notifications configure --polling-interval 60
525527
526528# Enable/disable soft prompt
527- dart run fluttersdk_magic_notifications: configure --soft-prompt
528- dart run fluttersdk_magic_notifications: configure --no-soft-prompt
529+ dart run magic_notifications configure --soft-prompt
530+ dart run magic_notifications configure --no-soft-prompt
529531```
530532
531- ### Status
533+ ### Doctor
532534
533- Check installation and configuration status :
535+ Check installation and configuration health :
534536
535537``` bash
536- # Check status
537- dart run fluttersdk_magic_notifications:status
538+ # Run health check
539+ dart run magic_notifications doctor
538540
539541# Verbose output
540- dart run fluttersdk_magic_notifications:status --verbose
542+ dart run magic_notifications doctor --verbose
541543```
542544
543545Verifies:
544546- Plugin installed in ` pubspec.yaml `
545- - Configuration file exists
546- - Platform-specific setup (Android, iOS, Web)
547- - Lists any missing requirements
547+ - Configuration file exists at ` lib/config/notifications.dart `
548+ - Config validation: App ID format, polling interval range
549+ - Platform setup (Android, iOS, Web)
550+
551+ Exits with code ` 0 ` if all checks pass, ` 1 ` if any check fails.
548552
549553### Test
550554
551555Send test notifications to verify setup:
552556
553557``` bash
554558# Preview notification (dry run)
555- dart run fluttersdk_magic_notifications: test --dry-run
559+ dart run magic_notifications test --dry-run
556560
557561# Send test database notification
558- dart run fluttersdk_magic_notifications: test
562+ dart run magic_notifications test
559563
560564# Send custom notification
561- dart run fluttersdk_magic_notifications: test \
565+ dart run magic_notifications test \
562566 --title " Hello" \
563567 --body " World"
564568
565569# Send push notification
566- dart run fluttersdk_magic_notifications: test \
570+ dart run magic_notifications test \
567571 --channel push \
568572 --api-url http://localhost:8000
569573
570574# Test different channels
571- dart run fluttersdk_magic_notifications:test --channel database
572- dart run fluttersdk_magic_notifications:test --channel push
573- dart run fluttersdk_magic_notifications:test --channel mail
575+ dart run magic_notifications test --channel database
576+ dart run magic_notifications test --channel push
577+ dart run magic_notifications test --channel mail
578+ ```
579+
580+ ### Uninstall
581+
582+ Remove plugin integration from your project:
583+
584+ ``` bash
585+ # Interactive uninstall (asks for confirmation)
586+ dart run magic_notifications uninstall
587+
588+ # Skip confirmation prompt
589+ dart run magic_notifications uninstall --force
574590```
575591
592+ Removes:
593+ - ` lib/config/notifications.dart `
594+ - ` magic_notifications ` dependency from ` pubspec.yaml `
595+ - ` NotificationServiceProvider ` injection from ` lib/config/app.dart `
596+ - ` notificationConfig ` factory from ` lib/main.dart `
597+
598+ > [ !WARNING]
599+ > Platform files (` android/app/src/main/AndroidManifest.xml ` , ` web/index.html ` ,
600+ > ` web/OneSignalSDKWorker.js ` ) are NOT reverted automatically — manual cleanup required.
601+
602+ ### Publish
603+
604+ Laravel vendor: publish style — copies the notification config stub to your project:
605+
606+ ``` bash
607+ # Publish config stub (skips if already exists)
608+ dart run magic_notifications publish
609+
610+ # Overwrite existing config
611+ dart run magic_notifications publish --force
612+ ```
613+
614+ Copies the default ` notifications.dart ` config to ` lib/config/notifications.dart ` .
615+ After publishing, update ` YOUR_ONESIGNAL_APP_ID ` with your actual OneSignal App ID.
616+
617+ ### Channels
618+
619+ List all notification channels and their current status:
620+
621+ ``` bash
622+ dart run magic_notifications channels
623+ ```
624+
625+ Shows each channel (database, push, mail) with:
626+ - Enabled / disabled status
627+ - Polling interval (database channel)
628+ - App ID presence (masked, push channel)
629+
576630## Usage
577631
578632### Display Notifications in UI
579633
580634Use the ` NotificationDropdownWithStream ` widget:
581635
582636``` dart
583- import 'package:fluttersdk_magic_notifications/fluttersdk_magic_notifications .dart';
637+ import 'package:magic_notifications/magic_notifications .dart';
584638
585639AppBar(
586640 actions: [
@@ -634,7 +688,7 @@ public function routeNotificationForOneSignal(): array
634688### Create Custom Notifications
635689
636690``` dart
637- import 'package:fluttersdk_magic_notifications/fluttersdk_magic_notifications .dart';
691+ import 'package:magic_notifications/magic_notifications .dart';
638692
639693class CustomNotification extends Notification {
640694 final String title;
@@ -689,7 +743,7 @@ await Notify.updatePreferences(NotificationPreference(
689743### Run Plugin Tests
690744
691745``` bash
692- cd plugins/fluttersdk_magic_notifications
746+ cd plugins/magic_notifications
693747flutter test
694748```
695749
0 commit comments