I have an application that uses Google FCM for sending push notifications.
When i send a push notification to a group of users, i get a response of MismatchSenderId
for some of them. Even though, all users have the exact same application. How can some of the users get a success response and others get a MismatchSenderId?
I have researched a lot and made sure I have added all prerequisites that FCM needs.
Any suggestions?
EDIT:
Sample response:
{"multicast_id":5340432438815499122,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]}
EDIT 2:
Here is the server side sending code (PHP):
$fields = array ( 'to' => $token, 'data' => $data ); $headers = array ( 'Authorization: key=AIza**************************', 'Content-Type: application/json' ); $ch = curl_init(); curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' ); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, true ); curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode($fields) ); curl_exec( $ch ); curl_close( $ch );
UPDATE:
It seems that the issue has been resolved with the SDK updates. I am using now the latest com.google.firebase:firebase-messaging:9.6.1
, I don't get "MismatchSenderId" anymore.
1 Answer. Show activity on this post. FCM (Firebase Cloud Messaging) uses HTTP and XMPP Server Protocol serving JSON and Plain Text both.
Starting March 22, 2020, the versions 81 and 82 of chrome disallow the creation of any new subscriptions using FCM sender IDs. However, the versions 78,79 and 80 of chrome will still allow the FCM Sender IDs that were used before September 2019. All the other FCM Sender IDs will be rejected.
You can send up to 240 messages/minute and 5,000 messages/hour to a single device.
It's possible. Two approaches. First is you make use of the collapse_key parameter to set the message as a collapsible message.
Firebase has upgraded their server keys to new version. Use new keys instead of old one.
go to settings->project settings->cloud messaging tab
I found this solution:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With