Mastering Push Notifications in Flutter: Firebase Integration Guide

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 61

  • @Snehasis4321
    @Snehasis4321  Год назад +1

    ⚠ Update :
    The payload was not working in terminated state i have fixed it , you need to use this function i have missed that in the video .
    add this after the handling foreground messages.
    // for handling in terminated state
    final RemoteMessage? message =
    await FirebaseMessaging.instance.getInitialMessage();
    if (message != null) {
    print("Launched from terminated state");
    //can change the waiting time depending on you app
    Future.delayed(Duration(seconds: 1), () {
    navigatorKey.currentState!.pushNamed("/message", arguments: message);
    });
    }
    also updated the github repository.

    • @vrindtime
      @vrindtime 8 месяцев назад

      i think you should pin this

  • @karlkiyotaka
    @karlkiyotaka Год назад +2

    Thank you so much bro, You saved my job and my life as well 🔥🔥🔥🔥🔥🔥

  • @jsenthil1508
    @jsenthil1508 Год назад +1

    Such a wonderful tutorial with clear and detailed explanation. Thanks. Keep posting such videos.

  • @jaysinhchauhan5688
    @jaysinhchauhan5688 8 месяцев назад

    Thanks buddy... must Recommeded video for push notification

  • @acornerofherheart-jr9pl
    @acornerofherheart-jr9pl 8 месяцев назад

    thanks a lot sir it's very nicely explained and also working.... helpful for me

  • @mmathems395
    @mmathems395 10 месяцев назад

    Many thanks for this tutorial. This was very helpful 😊

  • @ResultsFinale
    @ResultsFinale 7 месяцев назад

    Thank u for this tutorial. my question : while navigatorKey.currentContext is Always Null

  • @本名出さない設定
    @本名出さない設定 11 месяцев назад

    Thanks from Japan.
    Your Video is very useful to me.
    Thank You Very Much!
    sorry, my english is poor

  • @rudramistry3679
    @rudramistry3679 11 месяцев назад

    THIS VIDEO IS REALLY VERY HELPFUL.....

  • @arnabkarmakar9292
    @arnabkarmakar9292 10 месяцев назад

    I got two consecutive push notifications while my app is in background. kindly guide why this is happening.

  • @sncodext
    @sncodext 7 месяцев назад

    i want to send schedule notification on specific device token using code , what will be the implemenation ???

  • @increasedw
    @increasedw 7 месяцев назад

    Thanks. Worked for me.

  • @rafaymushtaq2316
    @rafaymushtaq2316 Год назад

    Sir, can you make the tutorial on How to save fcm token in database and most important thing how we trigger automatic notification for example admin add some products it automatically push notification to user about adding product ❤

    • @Snehasis4321
      @Snehasis4321  Год назад

      Ok I will do it

    • @rafaymushtaq2316
      @rafaymushtaq2316 Год назад

      @@Snehasis4321 I will wait for it. Plz try to make tutorial soon. It's my humble request😥.

  • @1MinuteShortVideos
    @1MinuteShortVideos 5 месяцев назад

    Please make video on How to play .MP3 file sound

  • @MTSightseeing
    @MTSightseeing 7 месяцев назад

    Hey, when I run the project I am getting an unsupported error: reconfigure your firebase cli and I am choosing option 2: chrome . Please help me please

    • @Snehasis4321
      @Snehasis4321  7 месяцев назад

      Use
      `dart pub global activate flutterfire_cli`
      `flutterfire configure --project={your project id}` command to configure using firebase cli again and make sure web platform is selected.

    • @MTSightseeing
      @MTSightseeing 7 месяцев назад

      @@Snehasis4321 how to check web platform Is selected

    • @Snehasis4321
      @Snehasis4321  7 месяцев назад

      if (kIsWeb){} use kIsWeb it is an inbuilt variable import from 'package:flutter/foundation.dart' , can be used to check if the platform is web or not.
      I am making a dedicated video regarding pushing notification on flutter web will be published soon.

  • @pramodvishwakarma09
    @pramodvishwakarma09 11 месяцев назад

    Thanks from INDORE .
    Your Video is very useful to me.
    Thank You Very Much! 💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌💌

  • @GajendranMegajolla
    @GajendranMegajolla 10 месяцев назад

    thanks for video
    how to send title,body to local notifications

  • @sncodext
    @sncodext 6 месяцев назад

    in terminated state , the navigation is not working for schedule notification

  • @soumyadippanja5384
    @soumyadippanja5384 11 месяцев назад

    sir when my app is on active tapping on notification redirecting to the particular page. But when my app is on background and kill i'm receiving notifications but tapping on notifications won't opening my app. and i cant getting any logs.

    • @Snehasis4321
      @Snehasis4321  11 месяцев назад

      I have fixed this issue please check the latest source code.

  • @mahbubpasha6176
    @mahbubpasha6176 10 месяцев назад

    Hi, routing in specific page while tap on notification isn't working while app is terminated. I've done my code following all the steps that you showed here. Would please tell me reason. I think navogatorkey getting null while app is terminated that's why routing isn't working while app is terminated. BTW, nice tutorial.

    • @Snehasis4321
      @Snehasis4321  10 месяцев назад

      While making this video I only did it for background and foreground. I will ask to have a look at the source code in GitHub I have added the logic to handle the notification in terminated state.

    • @mahbubpasha6176
      @mahbubpasha6176 10 месяцев назад

      @@Snehasis4321 I've follow these code for terminate state but routing not working while app is opened by tapping on notification in terminate state

    • @deepaksp3615
      @deepaksp3615 8 месяцев назад

      @@mahbubpasha6176 did the problem got solved. i am also stuck there

  • @haiderjaafer8164
    @haiderjaafer8164 Год назад

    Great work... How to show notifications count numbers of incoming notifications in app icon like what'sup, Facebook, Instagram...

    • @Snehasis4321
      @Snehasis4321  Год назад

      Count can be stored in a counter variable and can be access using provider or something else as you want. To make it like what app, Facebook we need to also customize the notification as per our need .

    • @haiderjaafer8164
      @haiderjaafer8164 Год назад

      @@Snehasis4321
      So can you make in a tutorial

    • @Snehasis4321
      @Snehasis4321  Год назад

      @@haiderjaafer8164 ok bro i will make a tutorial.

    • @haiderjaafer8164
      @haiderjaafer8164 Год назад

      @@Snehasis4321
      Thank a lot

  • @farzane_gharib
    @farzane_gharib Год назад

    Hi.Im using firebase messaging in my flutter app.
    Why do I get this error: "Error: AbortError: Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker " when I run my Flutter app for the first time on Chrome browser, but if I restart the app or refresh the browser page, the error disappears?
    and how should i solve that?

    • @Snehasis4321
      @Snehasis4321  Год назад

      i think you might have not initialize the the firebase properly , initialize in the main function. try this void main() {
      WidgetsFlutterBinding.ensureInitialized();
      // Initialize the PushManager
      FirebaseMessaging.instance.initialize();
      // Run your app
      runApp(MyApp());
      } if this does not solve the issue you can ask me.

    • @farzane_gharib
      @farzane_gharib Год назад

      ​@@Snehasis4321 In fact, I have already done that.
      void main()async{
      WidgetsFlutterBinding.ensureInitialized();
      await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
      FirebaseMessaging firebaseMessaging =FirebaseMessaging.instance;
      NotificationSettings settings = await firebaseMessaging.requestPermission(
      alert: true,
      announcement: false,
      badge: true,
      carPlay: false,
      criticalAlert: false,
      provisional: false,
      sound: true);
      final fcmToken = await firebaseMessaging.getToken(vapidKey:"***");
      }

  • @adeeshaperera5320
    @adeeshaperera5320 Год назад

    Is this working for terminated state of app.? I need to send notifications to all the app users in weekdays only even the app is closed. Can we do that ?

  • @templetonmeshack2816
    @templetonmeshack2816 10 месяцев назад

    Hello, do you know how to implement the FCM v1 instead of the legacy?
    Some information on the google documentation is not clear for me, may you please assist me on that?

    • @deepaksp3615
      @deepaksp3615 7 месяцев назад

      did u implement FCM v1.

  • @AbdulGani-eg2pu
    @AbdulGani-eg2pu Год назад

    how to automate the push notification based on changes of documents/collection in firebase firestore? post a cideo if you knwo about this?thanks in advance

  • @aysarhijazi1229
    @aysarhijazi1229 10 месяцев назад

    thank you perfect work

  • @padmalochanamohanta3596
    @padmalochanamohanta3596 11 месяцев назад

    Sir how to add action button in push notification

  • @purushottampk4530
    @purushottampk4530 Год назад

    It work when required authentication before message screen?

    • @Snehasis4321
      @Snehasis4321  Год назад

      I have not used any authentication, but if you want you can add authentication to you app.

  • @INNOVATIONSTUDIO
    @INNOVATIONSTUDIO 9 месяцев назад

    best

  • @oussamasbisiane4544
    @oussamasbisiane4544 Год назад

    when i tried the test i don't received the notification
    ?

    • @Snehasis4321
      @Snehasis4321  Год назад +1

      It takes some time for notification to arrive, as shown in the video you can test with firebase token first then it come instantly , then create a new campaign and test.

    • @oussamasbisiane4544
      @oussamasbisiane4544 Год назад

      it works now thank u for tuto and thank u for replaying@@Snehasis4321

  • @pramodvishwakarma09
    @pramodvishwakarma09 11 месяцев назад

    terminated state notificaton not recived

    • @Snehasis4321
      @Snehasis4321  11 месяцев назад

      when i made this video i didn't add the code for terminated state state , but you can check the source code i have add the terminated state code ,please cooperate with that.

  • @shubhammankar6047
    @shubhammankar6047 Год назад

    Why you use vs code instead of android studio, and whats your machine’s configuration

    • @Snehasis4321
      @Snehasis4321  Год назад +1

      Vscode is more lightweight and I know all the shortcuts of it , it helps me code faster.

    • @shubhammankar6047
      @shubhammankar6047 Год назад

      @@Snehasis4321 okayyy .. how much ram does your machine have, and also you have earned a subscriber ;)

    • @Snehasis4321
      @Snehasis4321  Год назад +1

      @@shubhammankar6047 8gb ram bro

  • @charlieduke1627
    @charlieduke1627 Год назад

    [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Unsupported operation: DefaultFirebaseOptions have not been configured for windows - you can reconfigure this by running the FlutterFire CLI again. I got this error anfter running the app. I use windows by the way.

    • @Snehasis4321
      @Snehasis4321  Год назад

      As the error says that you have not configure your firebase project for windows.
      Just configure it for windows also by running this command -
      flutterfire configure --project=
      and make sure to select windows as the platform.