FirebasePushNotificationPlugin
FirebasePushNotificationPlugin copied to clipboard
iOS Pushnotifications no longer working.
Scratch that... I simply forgot to register an APN certificate with Firebase.. Can be Closed
🐛 Bug Report
iOS Push Notifications no longer arrive in the app. RegisteredForRemoteNotifications and OnTokenRefresh get Triggered with (what appears to be) valid data. But when triggering a Notification in https://console.firebase.google.com/project/[projectname]/notification it does not trigger OnNotificationOpened or OnNotificationReceived, though Android works fine.
Expected behavior
OnNotificationOpened or OnNotificationReceived get Triggered and a Notification pops up
Reproduction steps
Install Firebase PushNotification and configure as directed in README Compile/Start App -> let it Register Trigger Pushnotification on Firebase
Configuration
Version: tried with
- 2.3.6
- 3.16
- 3.3.10
- 3.3.13 beta
Platform:
- [x ] :iphone: iOS
- [ ] :robot: Android
- [ ] :checkered_flag: WPF
- [ ] :earth_americas: UWP
- [ ] :apple: MacOS
- [ ] :tv: tvOS
- [ ] :monkey: Xamarin.Forms
same problem here. notification doesn't arrive after triggering it in firebase console.
same problem here. notification doesn't arrive after triggering it in firebase console.
Check your
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) { FirebasePushNotificationManager.RemoteNotificationRegistrationFailed(error); }
to see the error.
same problem here. notification doesn't arrive after triggering it in firebase console.
Check your
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) { FirebasePushNotificationManager.RemoteNotificationRegistrationFailed(error); }
to see the error.
no valid “aps-environment” entitlement string found for application
is it about certificate/provisioning profile?
same problem here. notification doesn't arrive after triggering it in firebase console.
Check your
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) { FirebasePushNotificationManager.RemoteNotificationRegistrationFailed(error); }
to see the error.no valid “aps-environment” entitlement string found for application
is it about certificate/provisioning profile?
Welcome to my world, I'm trying to solve this now too.
Make sure you have the following:
- Info.plist -> Capabilities -> Background modes -> Enable Background modes ON and Remote notifications ON
- Entitlements.plist -> Push Notifications -> Enabled
- Have the Push Notifications enabled in the Identifier @ developer.apple.com
- Have either setup the APN P12s or authentication key @ Firebase application settings
I think the provision profile then needs to be regenerated and set after the identifier is updated which is what I'm having troubles right now.
same problem here. notification doesn't arrive after triggering it in firebase console.
Check your
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) { FirebasePushNotificationManager.RemoteNotificationRegistrationFailed(error); }
to see the error.no valid “aps-environment” entitlement string found for application is it about certificate/provisioning profile?
Welcome to my world, I'm trying to solve this now too.
Make sure you have the following:
- Info.plist -> Capabilities -> Background modes -> Enable Background modes ON and Remote notifications ON
- Entitlements.plist -> Push Notifications -> Enabled
- Have the Push Notifications enabled in the Identifier @ developer.apple.com
- Have either setup the APN P12s or authentication key @ Firebase application settings
I think the provision profile then needs to be regenerated and set after the identifier is updated which is what I'm having troubles right now.
I was just about to tell you that it works after I have enabled APN in Entitlements.plist.
The only problem now is that the notifications do not arrive when the application is in foreground (arrive fine in the background or when the app is killed). Firebase console shows that the notification is "scheduled" but the notification data shows in the application console if I debug it in VS with all data correct...
same problem here. notification doesn't arrive after triggering it in firebase console.
Check your
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) { FirebasePushNotificationManager.RemoteNotificationRegistrationFailed(error); }
to see the error.no valid “aps-environment” entitlement string found for application is it about certificate/provisioning profile?
Welcome to my world, I'm trying to solve this now too. Make sure you have the following:
- Info.plist -> Capabilities -> Background modes -> Enable Background modes ON and Remote notifications ON
- Entitlements.plist -> Push Notifications -> Enabled
- Have the Push Notifications enabled in the Identifier @ developer.apple.com
- Have either setup the APN P12s or authentication key @ Firebase application settings
I think the provision profile then needs to be regenerated and set after the identifier is updated which is what I'm having troubles right now.
I was just about to tell you that it works after I have enabled APN in Entitlements.plist.
The only problem now is that the notifications do not arrive when the application is in foreground (arrive fine in the background or when the app is killed). Firebase console shows that the notification is "scheduled" but the notification data shows in the application console if I debug it in VS with all data correct...
I finally got it for myself running too. I receive notifications sent by the Console in any state of the application (foreground, background or killed).
About the "Scheduled" status - you see it scheduled, since the notification is in their queue and hasn't been sent yet. However if you refresh the page again you will see it in a Completed/Failed status. It's same for android.
I hope you will find the solution for your notifications not being received in the foreground ;)
Hi, I'm currently trying to make this work on iOS. I think I'm pretty close too.
-You guys managed to test this on simulator? cause I received an error: cannot use firebase on simulator. so I'm submiting it to test flight everytime I need to test.
-Have you changed this section of entitlements?
Hi, I'm currently trying to make this work on iOS. I think I'm pretty close too. -You guys managed to test this on simulator? cause I received an error: cannot use firebase on simulator. so I'm submiting it to test flight everytime I need to test. -Have you changed this section of entitlements? aps-environment production cause it's uncheck entitlements UI and i'm not sure if it's ok -The APN configuration needs any further steps like SSL configuration or something? -Is your certificate marked as "Not in keychain" in Tools->Options->Xamarin->Apple Accounts->View Details ? Sorry for the long question, but I really think I'm very close of doing it
- I wasn't able to get it working on simulator, I don't think apn works on iOS simulator (I might be wrong)
- I didn't change source of the entitlements.plist, just ticked the window that says "enable push notifications"
- no If you followed through the tutorial and uploaded p8 key successfully
- I don't have "options" under "tools"...?
same problem here. notification doesn't arrive after triggering it in firebase console.
Check your
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) { FirebasePushNotificationManager.RemoteNotificationRegistrationFailed(error); }
to see the error.no valid “aps-environment” entitlement string found for application is it about certificate/provisioning profile?
Welcome to my world, I'm trying to solve this now too. Make sure you have the following:
- Info.plist -> Capabilities -> Background modes -> Enable Background modes ON and Remote notifications ON
- Entitlements.plist -> Push Notifications -> Enabled
- Have the Push Notifications enabled in the Identifier @ developer.apple.com
- Have either setup the APN P12s or authentication key @ Firebase application settings
I think the provision profile then needs to be regenerated and set after the identifier is updated which is what I'm having troubles right now.
I was just about to tell you that it works after I have enabled APN in Entitlements.plist. The only problem now is that the notifications do not arrive when the application is in foreground (arrive fine in the background or when the app is killed). Firebase console shows that the notification is "scheduled" but the notification data shows in the application console if I debug it in VS with all data correct...
I finally got it for myself running too. I receive notifications sent by the Console in any state of the application (foreground, background or killed).
About the "Scheduled" status - you see it scheduled, since the notification is in their queue and hasn't been sent yet. However if you refresh the page again you will see it in a Completed/Failed status. It's same for android.
I hope you will find the solution for your notifications not being received in the foreground ;)
I think it might be the priority issue...Did you change your priority to "high" anywhere? I am trying to find where I can change this setting now.
I think it might be the priority issue...Did you change your priority to "high" anywhere? I am trying to find where I can change this setting now.
use a https://fcm.googleapis.com/fcm/send post and make sure your payload has "priority": "high" property.
just ticked the window that says "enable push notifications"
if I do this, I cannot archive my app for realease. Have you tested it? It works when I manually change it to production
I don't have "options" under "tools"
it's where you login in your apple account. I'm not sure how to explain beside that. Anyway i'm recreating like my 14th provisioning profile and trying to figure it out
I think it might be the priority issue...Did you change your priority to "high" anywhere? I am trying to find where I can change this setting now.
use a https://fcm.googleapis.com/fcm/send post and make sure your payload has "priority": "high" property.
I didn't quite get that part working with firebase notifications console...
just ticked the window that says "enable push notifications"
if I do this, I cannot archive my app for realease. Have you tested it? It works when I manually change it to production
I don't have "options" under "tools"
it's where you login in your apple account. I'm not sure how to explain beside that. Anyway i'm recreating like my 14th provisioning profile and trying to figure it out
Yes. I had the same problem. Make sure you downloaded the correct profile from your developer account and install it again. Relaunch visual studio after installation. I was stuck at that part for some time, but then the issue was resolved by itself (I just reinstalled the prov. profile).
Also I had to log in VS apple account and click "download all profiles". After that, the entitlements.plist didn't show any error.
Make sure you downloaded the correct profile from your developer account and install it again
I'm not using a developer account. I use VS for windows, use a rent Mac and the only way I can test is by sending a Distribuition version to Test Flight. That's when Entitlements give an error, when archiving
Make sure you downloaded the correct profile from your developer account and install it again I'm not using a developer account. I use VS for windows, use a rent Mac and the only way I can test is by sending a Distribuition version to Test Flight. That's when Entitlements give an error, when archiving
hmmm, how do you generate apple's prov. profiles then?
sorry, I misunderstood. I though you said developer profile. I'm using a developer account with a distribuition profile, not a developer profile
sorry, I misunderstood. I though you said developer profile. I'm using a developer account with a distribuition profile, not a developer profile
alright. so you have your provisioning profile by apple. in vs you need to login into that profile and download it so it matches the entitlements configuration. It worked for me after I logged in inside VS.
BTW. The foreground works when I add this line:
FirebasePushNotificationManager.CurrentNotificationPresentationOption = UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Sound;
adds alert type APN and a sound while in foreground. Perfect!
BTW. The foreground works when I add this line:
FirebasePushNotificationManager.CurrentNotificationPresentationOption = UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Sound;
adds alert type APN and a sound while in foreground. Perfect!
Oh yea, you are right. I got this too ':D Happy that you found it.
Ok, I added a log to RegisteredForRemoteNotifications FailedToRegisterForRemoteNotifications DidReceiveRemoteNotification I'm able to register to any topic without error, but ReceiveRemoteNotification never trigger by post nor firebase console. It's a known issue?
no If you followed through the tutorial and uploaded p8 key successfully
It worked, this line was the light. I was adding a APN key, not a certificate. It worked from the console. Now I need to figure how to set the POST payload to work too
no If you followed through the tutorial and uploaded p8 key successfully
It worked, this line was the light. I was adding a APN key, not a certificate. It worked from the console. Now I need to figure how to set the POST payload to work too
congrats :) if you figure it out let me know :)
no If you followed through the tutorial and uploaded p8 key successfully
It worked, this line was the light. I was adding a APN key, not a certificate. It worked from the console. Now I need to figure how to set the POST payload to work too
@HiagoQualitas so do APN key's not work?
@HiagoQualitas so do APN key's not work?
I'm not sure if it works, but for me it doesn't. My iOS device received the first notification as soon as I changed it to the certificate