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
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 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.
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
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 ???
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), ); });
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.
@@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
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
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.
@@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 ?
@@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
@@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??
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?
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 ?
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.
@@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 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.
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
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.
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
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
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
@@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.
@@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 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
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
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?
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
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
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 );
Even now in July 2024 it's the only legitimate video tutorial that works. Thank you!
You're welcome :)
finally, the only fcm tutorial that works on ios
Best iOS config ever, August 2024 is still working, thanks a lot! new subscription here
You're welcome. 🙏
So detailed. I'd give you a million likes if I could!!
Thanks man. you're welcome
make it only thousand instead of million but in dollars. hahaha.
Thanks Sunnd. it works. we must test it when app is running in background!
Yes, you can implement more on its function onMessage for listening to foreground push
notification
Quality detailed video that was very support and helpful for me . Thanks a lot
You're welcome.
So, I got a developer account however at steps 4:03 I can't find my certificate. anything ?
double click on the aps.cer and find the certificate with your app bundle id
This is what I'm waiting for iOS push notification. thank you
you're welcome
Quality Content , Fully Explained. Thanks a lot
you're welcome 🤩
Thanks you so much, but i run in simulator ios app not receive message. in video, you test in real iphone not simulator ?
Yes, You can't test push notification on IOS simulator as they don't produce token device
@@sundysrun Thanks you so much
awesome soundtrack,
totally made my day a little bit less shitty!
This is the exact solution,
Thanks
thank you so much. Right now my app receive push notifications =) Best best best
You're welcome 😁
2:31 from this is it same procedure to adapt LocalNotification not using firebase __ like get bundle ID ???
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
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
Hi man , yes, you need a paid account to make push notifications
@@sundysrun thanks
03:51 Open the downloaded key file, I didn't noticed the opening and uploaded a wrong key file to firebase.
you may re-upload them brother.
@@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.
Ahhh I see thank you 😊
Thanks man
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
Wow this is great !
Another good one. thanks man
Glad you enjoyed it
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 ???
you must register a paid account to enable push notification. Apple doesn't allow this capability for free.
@@sundysrun thanks
Hi, I have a question. Would app redirect to specific screen on Notification click when app is in terminated in iOS ?
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),
);
});
You made my day
you're welcome, glad that it helps you
Thanks! Works like a charm !!!
you're welcome.
I followed your example, I send via fcm's rest api, there is an error "error": "NotRegistered", how do I fix this?
Hi natta, "NotRegristed" error from fcm's api might cause from the phone have removed the app or the device token is not correct.
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.
@@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
@@nattawutxp glad that you found the problem. I'm excited to share what I know and thanks for watching
hey, i think I am stuck with the same issue like you, how did you manage to solve it
Do you need to authorize something to work in the simulator? apart from the step I showed?
It doesn't work on simulator as simulator doesn't produce any device token
Thank you for the details explanation💯..!
you're welcome 😁
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
you have to add the badge count in your notification json data from your server side
@@sundysrun Thanks you so much 😍
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 ?
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.
@@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 ?
@@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
@@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??
@@sanaishaq7306 you don't have to select apple development for the certificate.
Hello everyone, please subscribe our channel for more videos
www.youtube.com/@sundysrun
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?
hi, This method is used for both development and production. So on Testflight, it works just fine.
@@sundysrun Will you have any contact available so that you can help me with some compensation, I have already tried everything and nothing
@@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.
@@Guidoo25 , does it produce any error in the console log? Your configuration might be incorrect.
ohhh , this saves my project :D
Bohot achese samzaya
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 ?
same here , didn't work on simulator !
IOS py device token nahi aata, real device py b yeh issue aye ga?
Can we receive notification from firebase messaging or postman without a paid developer account ?
I don’t think its possible
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
The certificate bundleId did not match that of your app ??
the certificate bundle Id have to be the same as your app. otherwise it won't work.
is the token amust, or you are just using to identify the device you will use in the testing?
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.
@@sundysrun I have used ,KEYS and didn't work , also I use Certificate just the way you used and didn't work.
My firebase protal still says *send 0 opened 0*
Now is sent but the Release app doesn't see the notification.
Must the production be on app store for it to get the notifications ?
what about playing custom sound in ios push notificaiton
You may check my TH-cam channel for more
And here is a video of custom sound for push notifications th-cam.com/video/qJbrsYbU0tA/w-d-xo.htmlsi=Kji3R7YPv0QO2Yvw
LOVE IT SO SIMPLE, AND WORKS!
Hi sundy, can you make a video of a custom sound of push notification ?
sure man, I will create one soon.
The greatest shared ❤
Always glad to have you here
will the notifications work when app is killed?
Yes. Every time, the notification is triggered, it will push to the mobile.
The tutorial is excellent.
How do I add an image to the notification?
Do you have a video explaining this procedure?
Not yet for video of adding an image to notification.I'm Gonna make one soon. thanks for watching
Perfect!
Great and uptodate. Thank you! Subscribed.
Thank you. you're welcome
Hello my frend. My keychain acces not found fcm but why? help me pls
It should show up in the keychain if u request the keychain and download the file from appstore as I did in the video
@@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
@@m.mustafayildiz614 you may use your appstore email. but either one is fine
@@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.
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
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
why ios not woking in relase app but work for dev app :(
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.
Thank for your sharing
perfect video...thanks.. do you know custom sound on notifications..
Thank you. for custom sound you see my other video .
Custom Notification Sound ==> th-cam.com/video/qJbrsYbU0tA/w-d-xo.html
hi, i want to ask where can i get demo code ?
Hello karson ,you can find it in the description of this video
@@sundysrunokay , thx for you reply.
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
For production, Can I use the same file?
Yes, you can. Following all my tutorial, you will be able to add both sandbox and production.
Thank you!
You're welcome
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?
Hi man, You have to add your bundle ID in identifier section in appstore account
thank you very much
you're welcome
Great, Thanks a lot.
you're welcome!!
Thank you!
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
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
@@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.
@@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
@@matheusfigueredo7543 if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
@@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
Hey man that for sharing video, is this real device that you send notif to it ?
Hello man . Yes, it is a real device which I connected it into Mac
@@sundysrun thanks man So its not possible to do it with simulator
iOS simulator don't produce device token , so it is not possible
@@sundysrun Thanks you so much for answering
Great. Thank you
you're welcome
thanks for sharing man
you're welcome
thanks bro ...
Detailed thanks
you're welcome
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
thanks Eric. You can't send push notification with different bundleIDs from generated certificate
so you have to pay $100 to get this ?
Yes, you need to be in apple developer program
For iOS yes, for Android not.
wheere we can get the apn key id ?
You mean device token ? Device Token is generated from Firebase, which you need to use the method getToken() to receive that
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?
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
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
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
);
💯 💯
ios simulator its not working
It doesn't work on simulator as it doesn't produce any device token
👍
smash the like button
crack!
Thank you,.. Still working 🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉😁😁😁😁😁😁😁😁😁😁😁😁😁😁😃😃😃😃😃😃😃😃😃😃😃😃😃😎😎😎😎😎
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
}
}
Yes, you don't need that for this version. just follow the instruction in the video, you will be able to receive notification.
When the certificate expires, Will notifications stop receiving on devices with the app installed?
No, it won't receive anymore notification when the certificate is expired
@@sundysrun how to know certificate is expired
Is it possible to send notifications without certificates ? I have just added APNs keys
@@firstlogo3418 you may check the expired date of ur certificate on iOS developer console
@@firstlogo3418 Yes . you may use APN authentication key instead of certificate