How to show push notification in flutter without firebase? How to show push notification in flutter without firebase? dart dart

How to show push notification in flutter without firebase?


You can use Local notification plugin

https://pub.dev/packages/flutter_local_notifications

After your API response, just show that data in your local notification

FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin(); // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head projectvar initializationSettingsAndroid =    new AndroidInitializationSettings('app_icon');var initializationSettingsIOS = IOSInitializationSettings(    onDidReceiveLocalNotification: onDidReceiveLocalNotification);var initializationSettings = InitializationSettings(    initializationSettingsAndroid, initializationSettingsIOS);flutterLocalNotificationsPlugin.initialize(initializationSettings,    onSelectNotification: onSelectNotification);


you can use OneSignal.com . it's one of the best free and reliable services you can find.

you still have to setup a Firebase project for it, but all the rest is managed withing OneSignal Portal. they Provide also an API to send the notifications to Android and iOS devices.

they already have a plugin for Flutter and a documentation how you can integrate the system in you app.


it's not compatible with latest flutter version (null-safety) yet