Firebase Cloud Messaging: Invalid APNs certificates - firebase

I am not able to send push message to iOS device from FCM console. I receive error message "Check APNs certificates in settings". My configuration is the same as in FCM guide:
I generated Auth Key in Apple Developer Account.
I uploaded auth key in Firebase project, put Key Id and prefix (Team Id).
I added FCM SDK to my iOS project (added Google-service.plist as well).
I saved registration token in Firebase Database.
Finally, I can send a message to all devices with my App ID (but cannot receive this message, I do not know why), but I cannot send a message to selected device with token.
Any ideas?

If the bundle ID that was used to generate the FCM token does not match the bundle ID in your Firebase App you will receive the error code: 'messaging/invalid-apns-credentials' even if your Auth key is configured correctly.
This seems like the most likely cause of this error ever occurring. Double and triple check that the FCM token was created by an app with the exact same bundle ID as what is listed in your Firebase console.
The GoogleServices-Info.plist does not verify that it contains the same Bundle ID as the app it is attached to so it is easy to make this mistake.
On the Android side you will get a compilation error if the appId is not present in your google-services.json thus preventing this issue.

Please check the app name in GoogleServices-Info.plist and Bundle ID in your app.
And also check you put the plist file in proper directory.
Uploaded auth key in Firebase project to both Dev and Prod ones.
This are the only reason for not having the push notfications to your app.

Related

Configure phone auth for second firebase project in react native app

I'm struggling to configure two Firebase projects in one React Native app. I've successfully initialized the second app by following the instructions at Firebase Docs. But, when I use the secondary phone auth, it fails.
This is the error message on Android:
This app is not authorized to use Firebase Authentication. Please verify that the correct package name and SHA-1 are configured in the Firebase Console. [ A safety_net_token was passed, but no matching SHA-256 was registered in the Firebase console. Please make sure that this application’s packageName/SHA256 pair is registered in the Firebase Console. ]
And this is the error message on iOS:
[Error: [auth/invalid-app-credential] Invalid token.]
In the Firebase Console of the second app, I've set up all credentials to identify clients:
iOS: p8 file to the Cloud Messaging tab, add URL schemes, ...
Android: SHA-1, and SHA-256 fingerprints
Is this implementation possible? Am I missing any step?
P/s: I also have created a new discussion in the rnfirebase Github repository: Link

How to set up Firebase Cloud Messaging via APNs using an already registered bundle identifier?

The docs for setting up FCM via APNs state that you should copy the bundle identifier from your application (under the "Registering an App Identifier") section, but when I do that I get the following error when trying to register my new app id:
An attribute in the provided entity has invalid value
An App ID with Identifier '<my app id copied from xcode>' is not
available. Please enter a different string.
The error message does make sense because that app id is already taken (by my app).
Are the Firebase docs wrong or am I missing something?
I think you can check the followings.
make sure if you have already checked an option for push notification on app store. go to developer.apple.com/account/resources/identifiers/list, choose your identifier in the list.
open your project in Xcode. and check like the below screenshot

Get Topic Id from Device Token in Apple Push Notification for DeviceTokenNotForTopic exception

Currently I'm using Pushy to send Push Notification for iOS devices. Everything is working fine, except I'm getting exceptions for some devices with response (DeviceTokenNotForTopic)
Do we have any way to decode Device Token to get Topic associated?
The device token example as 195d2ab5bce448b692dbb6de91452e0fbac0e6c09a599525bce52accc8a6b34a
Thanks,
DeviceTokenNotForTopic can occur for the following reasons:
The iOS Bundle ID was changed since device was registered for notifications
The iOS Bundle ID configured in the Pushy Dashboard doesn't match the actual Bundle ID of the app installed on the device
The iOS device uninstalled your app, rendering the device token invalid.
The APNs Auth Key you uploaded to the Pushy Dashboard belongs to a different Apple Developer Account than the one your app is distributed under.
Please check the following:
Do the Pushy device tokens you're trying to send still have your app installed on those devices?
Does the iOS Bundle ID in Pushy Dashboard precisely equal the Bundle ID string in Xcode? Copy-paste to make sure there are no typos
Please uninstall your app completely on a test device. Install it and call pushy.register(). What device token is returned? Try sending a notification immediately to that device.
Please ensure you uploaded an APNs Auth Key to the Pushy Dashboard from the right Apple Developer Account that owns the app.

How to solve error "SENDER_ID_MISMATCH" error Using Firebase Cloud Messaging? [duplicate]

I have my client app with Android installed in several devices.
I also have my Server app that send messages to those apps.
The problem is that some devices receive the messages and other don't.
I get the error "MismatchSenderId" when sending the message to those devices.
I divided the problem, so I open the firebase console and send notifications to my apps (I have the Token for each of them). So, using the console app, I get errors on the same devices that using my server. But as I said, every device is using the same app.
Any help of the reason?
So to start of, I'd point out the description for MismatchSenderId error:
A registration token is tied to a certain group of senders. When a client app registers for FCM, it must specify which senders are allowed to send messages. You should use one of those sender IDs when sending messages to the client app. If you switch to a different sender, the existing registration tokens won't work.
As per our discussion, it was pointed out that you created a new Firebase Project instead of importing your Google Project that you were using for GCM. From the new project, the google-services.json was generated and used for the app, which resulted for new tokens to be associated with the new Project's Sender ID. To visualize it properly:
GCM Registration Tokens > only receive messages from > Google Project (1st)
New Tokens > only receive messages from > Firebase Project (2nd)
As a solution, I advised for you to import the Google Project to the Firebase Console, generate a google-services.json from that Project and replace the one in your app with that, which associates the app to that (correct) project. This in turn created tokens that are now associated with your 1st Project.
GCM Registration Tokens > only receive messages > Google Project (1st)
New Tokens > now receive messages > Firebase Project (2nd) Imported Google Project (1st)
Hope that makes sense.
Good to mention from the discussion:
After applying the changes, you mentioned that the error persisted, but it was a different issue that was fixed by simply using the Server Key.
Linked a post during discussion.
Supporting #AL's answer, basically you need to uninstall the app on all the devices and install the app again so that all devices receive new tokens that correspond with the newly connected firebase project database.
Need to enable the following api in the Google Console (https://console.cloud.google.com/)
Firebase Cloud Messaging API
Cloud Messaging
Then your senderId will be identified

Push notification in quickblox have broken

No I started use push notification in my project (it worked sometime ago), but can't make it work. I downloade sample-messages project and changed my account and application settings. But messaged don't delivered to receiver. Registration of device is ok. I see my subscribtion. No errors from response when sending notification. What I only got is the json description from logs, when i click my message from queue (but it's in status "sent") Can't get it work. Please, help.
{"notification":{"registration_ids":["APA91bEsqEY2OcaQpgU6Nmk6P7P0fSEdnGuXHSOnUwMJ3ZCAuZC0hGiE_7DX-TlvuAnivJ3Bt4nSM7eEN3AR2Qg2jjCGC8RRT7GbDJgpuy25plCohb23CpD5hLaHo7l-TZvgZhpXjCM0"],"delay_while_idle":false,"data":{"message":"fgjkkkkllkleddxccvvvcxfffffjhghvfg I was ","collapse_key":"event5711312"},"time_to_live":86400},"log":[{"device_token":null,"created_at":"2016-02-23T18:21:42Z","delivered_at":null,"failed_at":"2016-02-23T18:21:47Z","error_code":401,"error_description":"Unable to deliver notification 11778569, received error 401 (Unauthorized, check your App auth_key.)"}]}
I redid all the configuration steps in the link:http://quickblox.com/developers/SimpleSample-messages_users-android#Setup_GCM
Now it is back to work!
Attention to some details:
The API key you have to use in Google cloud console is of the SERVER type
Use the same package name on Android manifest and Google cloud console
Use your application ID from developer console to get GCM token on your Android application
don't forget to copy the google-services.json (generated when you enabled Google services for your app) to app/ directory on your project (the same directory of your src/)

Resources