ios icon indicating copy to clipboard operation
ios copied to clipboard

iOS Push Notification is not working

Open igeeganage opened this issue 4 years ago • 3 comments

Question

Apple push notification have stopped working in our app using your plugin. We previously had this working using the same version of your plugin and same versions of our app components. In addition we can no longer send a Test Notification via the Firebase Cloud messaging. The Push Token is generating and I have already uploaded the .p8 certificate and .p12 into Firebase. Are you able to recommend a solution to this problem?

iOS version - 13.3.1 @react-native-community/push-notification-ios": "^1.1.1 xCode - 11.2.1

igeeganage avatar Jul 08 '20 14:07 igeeganage

Now iOS push notification is working from Firebase console. But when I try to send notification to the specific device I'm getting The registration token is not a valid FCM registration token

"error": { "code": 400, "message": "The registration token is not a valid FCM registration token", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError", "errorCode": "INVALID_ARGUMENT" }, { "@type": "type.googleapis.com/google.rpc.BadRequest", "fieldViolations": [ { "field": "message.token", "description": "The registration token is not a valid FCM registration token" } ] } ] }

igeeganage avatar Jul 14 '20 12:07 igeeganage

@igeeganage You most likely send the APNS Token instead of the FCM Token. You need to convert the APNS Token to a valid FCM Token using the following API:

https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens

Then you use that token received and use it for Firebase Push Notifications

Benzer1406 avatar Jul 31 '20 22:07 Benzer1406

Solve my issue please check below link

https://github.com/zo0r/react-native-push-notification/issues/1251#issuecomment-565373047

dhavalrshingala avatar Sep 10 '21 13:09 dhavalrshingala