Flutter Firebase Cloud Messaging (iOS) | Push Notification | iOS Push Notification | FCM | iOS

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

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

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

    Even now in July 2024 it's the only legitimate video tutorial that works. Thank you!

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

      You're welcome :)

  • @valentineejk
    @valentineejk Год назад +3

    finally, the only fcm tutorial that works on ios

  • @FranciscoNoceda-k5t
    @FranciscoNoceda-k5t 5 месяцев назад

    Best iOS config ever, August 2024 is still working, thanks a lot! new subscription here

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

      You're welcome. 🙏

  • @joshuanwokoye
    @joshuanwokoye 2 года назад +6

    So detailed. I'd give you a million likes if I could!!

    • @sundysrun
      @sundysrun  2 года назад

      Thanks man. you're welcome

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

      make it only thousand instead of million but in dollars. hahaha.

  • @Frank-hf2cm
    @Frank-hf2cm 2 месяца назад

    Thanks Sunnd. it works. we must test it when app is running in background!

    • @sundysrun
      @sundysrun  2 месяца назад

      Yes, you can implement more on its function onMessage for listening to foreground push
      notification

  • @minnkhantthu933
    @minnkhantthu933 Год назад +3

    Quality detailed video that was very support and helpful for me . Thanks a lot

  • @chomanthapa
    @chomanthapa 2 года назад +1

    So, I got a developer account however at steps 4:03 I can't find my certificate. anything ?

    • @sundysrun
      @sundysrun  2 года назад +3

      double click on the aps.cer and find the certificate with your app bundle id

  • @hourky1508
    @hourky1508 2 года назад

    This is what I'm waiting for iOS push notification. thank you

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

    Quality Content , Fully Explained. Thanks a lot

  •  Год назад +2

    Thanks you so much, but i run in simulator ios app not receive message. in video, you test in real iphone not simulator ?

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

      Yes, You can't test push notification on IOS simulator as they don't produce token device

    •  Год назад

      @@sundysrun Thanks you so much

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

    awesome soundtrack,
    totally made my day a little bit less shitty!

  • @Shashank-b3o
    @Shashank-b3o 4 месяца назад

    This is the exact solution,
    Thanks

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

    thank you so much. Right now my app receive push notifications =) Best best best

  • @edward9876
    @edward9876 2 года назад

    2:31 from this is it same procedure to adapt LocalNotification not using firebase __ like get bundle ID ???

    • @sundysrun
      @sundysrun  2 года назад

      I'm not sure about your question. For that part, We generate a requesting certificate and upload it for a signed certificate on AppStore. And you may use this certificate for the purpose of remote push notification. For local notification you don't have to generate that , you may check this library pub.dev/packages/flutter_local_notifications

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

    Hey sundy, nice tutorial.. i was doing the same... do i need to enrolled for IOS app developer account. i tried by it is giving error during enrollment. is enrollment is paid one for notification

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

      Hi man , yes, you need a paid account to make push notifications

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

      @@sundysrun thanks

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

    03:51 Open the downloaded key file, I didn't noticed the opening and uploaded a wrong key file to firebase.

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

      you may re-upload them brother.

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

      @@sundysrun I meant, I missed watching you double clicked the file, it's my mistake not urs so Just typed for someone who may do the same mistake in upcoming days.

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

      Ahhh I see thank you 😊

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

      Thanks man

  • @Guidoo25
    @Guidoo25 3 месяца назад

    I am developing an application that already has service time created with the APNS Authentication Key but it does not work for me that way and the p12 file just because of the notifications I cannot deploy it do you think it will work if I change to this way with the APNS Certificate for development

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

    Wow this is great !

  • @rachobsakathava4061
    @rachobsakathava4061 2 года назад

    Another good one. thanks man

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

    apple developer issue ::: Access Unavailable
    This resource is only for developers enrolled in a developer program or members of an organization’s team in a developer program
    any solution ???

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

      you must register a paid account to enable push notification. Apple doesn't allow this capability for free.

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

      @@sundysrun thanks

  • @yachichuang2460
    @yachichuang2460 2 года назад +1

    Hi, I have a question. Would app redirect to specific screen on Notification click when app is in terminated in iOS ?

    • @sundysrun
      @sundysrun  2 года назад +1

      Yes, it does. To redirect into specific screen you may custom your function inside openapp handler. Like firebase_messaging plugin, we use something like this
      FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
      Navigator.pushNamed(
      context,
      '/message',
      arguments: MessageArguments(message, true),
      );
      });

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

    You made my day

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

      you're welcome, glad that it helps you

  • @shimul6680
    @shimul6680 2 года назад

    Thanks! Works like a charm !!!

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

    I followed your example, I send via fcm's rest api, there is an error "error": "NotRegistered", how do I fix this?

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

      Hi natta, "NotRegristed" error from fcm's api might cause from the phone have removed the app or the device token is not correct.

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

      so you may check your if the app is there on the phone or you have to make sure device token is a newly generated one because device token will be renew when you reinstall the app again.

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

      @@sundysrun Thanks for the advice and responses.
      I fixed the problem, in apple developer I fixed the identifiers , capabilities , I added the certificate , now I can receive notifications sent from the FCM api.
      I think your clip is easy to understand. Not complicated like other clips

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

      @@nattawutxp glad that you found the problem. I'm excited to share what I know and thanks for watching

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

      hey, i think I am stuck with the same issue like you, how did you manage to solve it

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

    Do you need to authorize something to work in the simulator? apart from the step I showed?

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

      It doesn't work on simulator as simulator doesn't produce any device token

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

    Thank you for the details explanation💯..!

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

    It's working well received message, but in my app not show badge number. i test on iphone 14 pro max, how to show number count notification badge. Thanks you so much again

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

      you have to add the badge count in your notification json data from your server side

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

      @@sundysrun Thanks you so much 😍

  • @taufikarsandi3080
    @taufikarsandi3080 2 года назад +1

    hi, i do with firebasecli, and upload APNS. after received FCM, i dot try to send test but my device wont get it. do you know how to fix it ?

    • @sundysrun
      @sundysrun  2 года назад

      Hi Taufik, Not sure what cause the problem. But not receiving the push notification might be from your APN isn't correct, your configuration on app is wrong nor probably you don't turn on push notification on your test device.

    • @taufikarsandi3080
      @taufikarsandi3080 2 года назад +1

      @@sundysrun every step i try using your method except apns, so i need to delete my APNS and reupload it again ? i allowed when prompt notification show up and i do get fcm token to test. but im still confused, do you have any clue ?

    • @sundysrun
      @sundysrun  2 года назад

      @@taufikarsandi3080 that's good to hear Taufik, so the problem might cause from your APN, you might use the wrong bundleId nor your APN is only for production or sandbox

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

      @@sundysrunI am having the same issue. While creating certificate you only service (production and sandbox) ,do we need to select apple development in service as well??

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

      @@sanaishaq7306 you don't have to select apple development for the certificate.

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

    Hello everyone, please subscribe our channel for more videos
    www.youtube.com/@sundysrun

  • @Guidoo25
    @Guidoo25 3 месяца назад

    This method is only used for development with devices that are registered in the developer account or is it also useful if I upload the app to tesflight?

    • @sundysrun
      @sundysrun  3 месяца назад +1

      hi, This method is used for both development and production. So on Testflight, it works just fine.

    • @Guidoo25
      @Guidoo25 3 месяца назад

      @@sundysrun Will you have any contact available so that you can help me with some compensation, I have already tried everything and nothing

    • @Guidoo25
      @Guidoo25 3 месяца назад

      @@sundysrun
      Any email to contact, I still haven't received the notifications, please help me, I haven't been able to solve the error for days.

    • @sundysrun
      @sundysrun  3 месяца назад

      @@Guidoo25 , does it produce any error in the console log? Your configuration might be incorrect.

  • @buddyapp5261
    @buddyapp5261 2 года назад

    ohhh , this saves my project :D

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

    Bohot achese samzaya

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

    On August 2024 i tried on ios simulator but it doesn't work
    Does push notifications work on simulators because i read that last xcode update notifications do work on simulators ?

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

      same here , didn't work on simulator !

  • @arafaatqureshi8177
    @arafaatqureshi8177 7 дней назад

    IOS py device token nahi aata, real device py b yeh issue aye ga?

  • @chomanthapa
    @chomanthapa 2 года назад +1

    Can we receive notification from firebase messaging or postman without a paid developer account ?

    • @antonin5688
      @antonin5688 2 года назад +1

      I don’t think its possible

    • @sundysrun
      @sundysrun  2 года назад

      Hi pannam, No you can't receive push notification without a paid developer account for iOS as you need to generate a certificate for that

  • @AppDevelopment-g7k
    @AppDevelopment-g7k 10 месяцев назад +1

    The certificate bundleId did not match that of your app ??

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

      the certificate bundle Id have to be the same as your app. otherwise it won't work.

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

    is the token amust, or you are just using to identify the device you will use in the testing?

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

      Yes, device token is used to identify the mobile that firebase is gonna push. In FCM, there are ways you can push to the devices by using Topics or device token.

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

      @@sundysrun I have used ,KEYS and didn't work , also I use Certificate just the way you used and didn't work.

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

      My firebase protal still says *send 0 opened 0*

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

      Now is sent but the Release app doesn't see the notification.

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

      Must the production be on app store for it to get the notifications ?

  • @SunilSingh-b2w8y
    @SunilSingh-b2w8y 7 месяцев назад +1

    what about playing custom sound in ios push notificaiton

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

      You may check my RUclips channel for more

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

      And here is a video of custom sound for push notifications ruclips.net/video/qJbrsYbU0tA/видео.htmlsi=Kji3R7YPv0QO2Yvw

  • @MuhammadFaisal-ey5fr
    @MuhammadFaisal-ey5fr Год назад

    LOVE IT SO SIMPLE, AND WORKS!

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

    Hi sundy, can you make a video of a custom sound of push notification ?

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

      sure man, I will create one soon.

  • @ennymunia2856
    @ennymunia2856 2 года назад

    The greatest shared ❤

    • @sundysrun
      @sundysrun  2 года назад

      Always glad to have you here

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

    will the notifications work when app is killed?

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

      Yes. Every time, the notification is triggered, it will push to the mobile.

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

    The tutorial is excellent.
    How do I add an image to the notification?
    Do you have a video explaining this procedure?

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

      Not yet for video of adding an image to notification.I'm Gonna make one soon. thanks for watching

  • @DavidElias-r1s
    @DavidElias-r1s Год назад

    Perfect!

  • @Вальдемар-п6г
    @Вальдемар-п6г 2 года назад

    Great and uptodate. Thank you! Subscribed.

    • @sundysrun
      @sundysrun  2 года назад

      Thank you. you're welcome

  • @m.mustafayildiz614
    @m.mustafayildiz614 Год назад +1

    Hello my frend. My keychain acces not found fcm but why? help me pls

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

      It should show up in the keychain if u request the keychain and download the file from appstore as I did in the video

    • @m.mustafayildiz614
      @m.mustafayildiz614 Год назад

      @@sundysrun okeSo, should the mail we use when entering mail in "certificate assistant" be our appstore mail, or is it the mail to which the computer is connected?
      y

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

      @@m.mustafayildiz614 you may use your appstore email. but either one is fine

    • @m.mustafayildiz614
      @m.mustafayildiz614 Год назад

      @@sundysrun The real problem is:
      when i send message via fcm,
      Although notifications are sent to Android devices, they do not go to iOS devices. and My App is an app that has been published.
      why am I getting the error success\":0,\"failure\":1,\"canonical_ids\":0,\"results\":[{\"error\":\"notregistered\". please help.

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

    Very nice tutorial.
    please how did you run your physical ios device from vscode in this tutorial, i'm sure alot of people have this question on their mind too

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

      Thanks man. If you're using MacBook, You just need to connect your phone with your MacBook and use QuickPlay to display mirror option from your phone

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

    why ios not woking in relase app but work for dev app :(

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

      There are some factors that it works only on development mode.
      1. it might be because you select only sandbox mode when you create a certificate , to make it works for both may select "Apple Push Notification service SSL (Sandbox & Production)".
      2. in your firebase console, you have to upload the certificate in production section.

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

    Thank for your sharing

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

    perfect video...thanks.. do you know custom sound on notifications..

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

      Thank you. for custom sound you see my other video .
      Custom Notification Sound ==> ruclips.net/video/qJbrsYbU0tA/видео.html

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

    hi, i want to ask where can i get demo code ?

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

      Hello karson ,you can find it in the description of this video

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

      @@sundysrunokay , thx for you reply.

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

    Flutter iOS - Is anyone facing issue when app is in background , app icon badge count is not displayed and increase further.
    FirebaseMessaging backgroundhandler is not getting called

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

    For production, Can I use the same file?

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

      Yes, you can. Following all my tutorial, you will be able to add both sandbox and production.

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

    Thank you!

  • @ugurdana3174
    @ugurdana3174 2 года назад

    Even though I did exactly what they did, my trial application's bundle ID does not appear in the certificates. How can I solve this problem?

    • @sundysrun
      @sundysrun  2 года назад

      Hi man, You have to add your bundle ID in identifier section in appstore account

  • @اسروكورة
    @اسروكورة Год назад

    thank you very much

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

    Great, Thanks a lot.

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

    Thank you!

  • @matheusfigueredo7543
    @matheusfigueredo7543 2 года назад

    Hey there. My IOS app is closing when gets a notification. Any idea why?
    BTW, i only uploaded APNs authentication key to Firebase
    flutter_local_notifications 12.0.4
    firebase_messaging 14.1.4

    • @sundysrun
      @sundysrun  2 года назад +1

      Not sure what is your problem. I need more detail of your error. Btw base on your description seem like your APN authentication setup is correct. The flutter_local_notificaiton is causing the issue I guess. So you need to debug it for the error

    • @matheusfigueredo7543
      @matheusfigueredo7543 2 года назад

      @@sundysrun The error just say Lost Connection. I was testing using only local notifications and the error continues.
      I noticed that when i remove the code from AppDelegate.swift:
      if (@available(iOS 10.0, *)) {
      [UNUserNotificationCenter currentNotificationCenter].delegate = (id) self;
      }
      the notification does not close the app.

    • @sundysrun
      @sundysrun  2 года назад

      @@matheusfigueredo7543awww, that is not a swift code brother. this is C objective. That's why it is getting error. you may follow this pub.dev/packages/flutter_local_notifications

    • @sundysrun
      @sundysrun  2 года назад

      @@matheusfigueredo7543 if #available(iOS 10.0, *) {
      UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
      }

    • @matheusfigueredo7543
      @matheusfigueredo7543 2 года назад

      @@sundysrun Oh sorry, i posted the wrong code xD
      I'm was using the right one: if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
      }
      I just cant understand why if i remove that code, the notification shows no problem and with it the application closes

  • @codemoor
    @codemoor 2 года назад

    Hey man that for sharing video, is this real device that you send notif to it ?

    • @sundysrun
      @sundysrun  2 года назад

      Hello man . Yes, it is a real device which I connected it into Mac

    • @codemoor
      @codemoor 2 года назад

      @@sundysrun thanks man So its not possible to do it with simulator

    • @sundysrun
      @sundysrun  2 года назад

      iOS simulator don't produce device token , so it is not possible

    • @codemoor
      @codemoor 2 года назад

      @@sundysrun Thanks you so much for answering

  • @Imransk-xn3bx
    @Imransk-xn3bx 2 года назад

    Great. Thank you

  • @sukavrajatumakvu8523
    @sukavrajatumakvu8523 2 года назад

    thanks for sharing man

  • @ArupNaskar-qdl
    @ArupNaskar-qdl 6 месяцев назад

    thanks bro ...

  • @abymdone4797
    @abymdone4797 2 года назад

    Detailed thanks

  • @ericferreira7347
    @ericferreira7347 2 года назад

    Hey Sundy! Thanks for the video, it was great! I have a question, I have a situation wich I have a Whitelabel application, and would like to send PushNotifications from the same Firebase Project for production (but with different bundleIDs), this can be done? Thanks :D

    • @sundysrun
      @sundysrun  2 года назад +1

      thanks Eric. You can't send push notification with different bundleIDs from generated certificate

  • @chomanthapa
    @chomanthapa 2 года назад +1

    so you have to pay $100 to get this ?

    • @ivanxu0024
      @ivanxu0024 2 года назад

      Yes, you need to be in apple developer program

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

      For iOS yes, for Android not.

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

    wheere we can get the apn key id ?

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

      You mean device token ? Device Token is generated from Firebase, which you need to use the method getToken() to receive that

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

    Is there any step to handle push notification for handlebackgroundmessage? cus mine is not showing up the notification in background, only show in foreground. Any solution?

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

      you may use :
      1. onBackgroundMessage function to handle on background notification
      2. you may save all your data from your notification into your app's storage and reload those data when the app is resumed

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

    REMEMBER: you will not get push notifications, if your app is active on your mobile screen!
    Spent couple of hours without getting notifications and trying to figure out why, while decision was just close/inactivate the app

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

      To get push notification when the app is active , you will need to set alert to true. or you may custom your own notification onMessage listener.
      FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
      sound: true,
      alert: true,
      badge: true
      );

  • @rovannak-l5m
    @rovannak-l5m 10 месяцев назад

    💯 💯

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

    ios simulator its not working

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

      It doesn't work on simulator as it doesn't produce any device token

  • @vaisakhperumthody4631
    @vaisakhperumthody4631 2 года назад

    👍

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

    smash the like button

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

    crack!

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

    Thank you,.. Still working 🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉😁😁😁😁😁😁😁😁😁😁😁😁😁😁😃😃😃😃😃😃😃😃😃😃😃😃😃😎😎😎😎😎

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

    So we won't need to do something like? In the App Delegate Swift file?
    if #available(iOS 10.0, *) {
    UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
    }
    application.registerForRemoteNotifications()
    FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
    GeneratedPluginRegistrant.register(with: registry)
    }
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
    override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    Messaging.messaging().apnsToken = deviceToken
    }
    }

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

      Yes, you don't need that for this version. just follow the instruction in the video, you will be able to receive notification.

  • @ivanxu0024
    @ivanxu0024 2 года назад

    When the certificate expires, Will notifications stop receiving on devices with the app installed?

    • @sundysrun
      @sundysrun  2 года назад +1

      No, it won't receive anymore notification when the certificate is expired

    • @firstlogo3418
      @firstlogo3418 2 года назад

      @@sundysrun how to know certificate is expired

    • @firstlogo3418
      @firstlogo3418 2 года назад

      Is it possible to send notifications without certificates ? I have just added APNs keys

    • @sundysrun
      @sundysrun  2 года назад

      @@firstlogo3418 you may check the expired date of ur certificate on iOS developer console

    • @sundysrun
      @sundysrun  2 года назад

      @@firstlogo3418 Yes . you may use APN authentication key instead of certificate