Posts

Showing posts with the label #pushNotification

Continuation: Enhancing Push Notifications in Flutter Using Firebase

Image
Enhancing Push Notifications in Flutter  In the previous blog post , we covered the fundamental steps to integrate push notifications into a Flutter app using Firebase Cloud Messaging (FCM). In this continuation, we'll explore how to open a specific page when the user clicks on a notification, thereby enhancing the user experience and providing contextual information. Let's dive into the code changes required to handle notifications effectively: Updating firebase_api.dart import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:pushnotification/Page/notification_screen.dart'; import 'package:pushnotification/main.dart'; class FirebaseApi { final _firebaseMessaging = FirebaseMessaging.instance; void handleMessage(RemoteMessage? message) { if (message == null) return; navigatorKey.currentState?.pushNamed(NotificationScreen.route, arguments: message); } Future<void> handleBackgroundMessage(RemoteMessage mes

Implementing Push Notifications in Flutter Using Firebase

Image
Please, support my blog by clicking on our sponsors ad! Unlocking the Power of Push Notifications in Flutter with Firebase Cloud Push notifications are an essential aspect of modern mobile applications, allowing developers to engage users even when they are not actively using the app. In Flutter, integrating push notifications can be efficiently done through Firebase Cloud Messaging (FCM). In this tutorial, we'll walk through the steps to set up push notifications in a Flutter app using Firebase and also open specific page when user tap on notification . Follow steps to create push notification in both project. Create Project in  https://console.firebase.google.com/ Create Project for push notification After Creating Project add app for both IOS and Android Project. Create app in project For Both IOS and Android project add Package name. Package name should be same as your package name in Android and Project. Click on Register App Download Google Service json. If you

How to send Firebase Push Notification through API

Image
  Please, support my blog by clicking on our sponsors ad! In this blog  we learn how to send push notification. Now we will see how to send Notification using API. Create Server Key in Console firebase Call following API to send push notification URL:  https://fcm.googleapis.com/fcm/send Method: POST Headers: Authorization: key=server key (you can get it from firebase console) Content-Type: application/json Body { "to" : "FCM Token goes here", "notification" : { "body" : "New Lesson Added 1", "title": "Lokesh" } } Hope you understand this, Please share your feedback and enjoy coding.