Flutter Tutorial - Local Push Notifications 1/2 | Android & iOS
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about Flutter local notifications, scheduling with zonedSchedule, and notifications not firing in the background.
Recommended by 3 people across 3 different months, 2021 to 2023.
What it is
A Flutter tutorial by Johannes Milke (HeyFlutter) on sending and scheduling local push notifications on Android and iOS. It covers showing notifications, scheduling them, and repeating them daily or weekly in the background, with source code on GitHub.
What people said
Recommends Phil D · 2021-08 · Stack Overflow · on “Suggestion regarding Notification in flutter”
Let's say you run the method zonedSchedule & set like certain seconds, it will then show it up. I think you can check out this video, it explains clearly about using the local notification package & also some scheduling in it. [this video]
Recommends Delwinn · 2023-01 · Stack Overflow · on “Flutter Notifications on Firestore new document with Cloud Functions and Cloud Messaging”
This is my code to send notifications using Cloud Functions // fcm notification exports.sendNotification = functions.firestore .document("hubs/{uid}/alerts/{new_alert}") .onWrite(async(change, context)=>{ const data = change.after.data(); const uid = context.params.uid; // I keep my client devices' tokens in a separate collection, which I'm fetching here const clients = await (await admin.firestore().doc(`hubs/${uid}`).get()).data().clients; const payload = { "notification":{ "title": "Firebase messaging", "body": `This might need your attention. ${data.alert}`, }, }; const options = {}; console.log("sending noti"); return admin.messaging().sendToDevice(clients, payload, options); }); you ca
Recommends Justus Lolwerikoi · 2023-03 · Stack Overflow · on “Flutter Local Notification not working in background?”
Yes. Mine works perfectly. Follow the instructions in this video. [this video] If you find the error in the code, I will appreciate your response.
Cites Carlos Peñaranda · 2022-02 · Stack Overflow · on “Error flutter NotificationDetails too many positional arguments”
I'm using NotificationDetails to show local notifications in my app: class NotificationApi { static final _notifications = FlutterLocalNotificationsPlugin(); static final onNotifications = BehaviorSubject<String?>(); static Future _notificationDetails() async { return NotificationDetails( android: AndroidNotificationDetails( 'channel id', 'channel name', 'channel description', //here shows the error importance: Importance.max, ), iOS: IOSNotificationDetails(), ); } static Future init({bool initScheduled = false}) async { final android = AndroidInitializationSettings('@mipmap/ic_launcher'); final iOS = IOSInitializationSettings(); final settings = InitializationSettings(android: android, iOS:
Cites johnson · 2022-08 · Stack Overflow · on “flutter: simple notification not working?”
is it mandatory to include icon because the tutorial i watched there is no mentioning to include icon [this video]