Hi,
My Andriod app can generate token and received notifications from firebase but for iOS app, the token is generated but when a message is sent to this token id nothing happened instead I am getting an error.
"error": "InvalidRegistration"
await NotificationsIOS.addEventListener('remoteNotificationsRegistered', onPushRegistered);
await NotificationsIOS.addEventListener('remoteNotificationsRegistrationFailed', onPushRegistrationFailed);
await NotificationsIOS.requestPermissions();
function onPushRegistered(deviceToken) {
// TODO: Send the token to my server so it could send back push notifications...
console.log("Device Token Received", deviceToken);
}
This code is generating a Device Token on iOS like 45f41b17e16b5970fe35.......8222b01289580bae87ba35d2b2bc72b
When I use this token to send FCM message it is giving the above error.
I think it is not a FCM token. I have also added the APN's certificates to the firebase.
I can generate the local notifications using this library on ios and the remote andriod notification is also working properly. Kindly help me to get it fixed as i don't want to use any other library thanks.
"react": "16.8.6",
"react-native": "0.60.5",
"react-native-notifications": "^2.1.5",
Hi,
My Andriod app can generate token and received notifications from firebase but for iOS app, the token is generated but when a message is sent to this token id nothing happened instead I am getting an error.
"error": "InvalidRegistration"
await NotificationsIOS.addEventListener('remoteNotificationsRegistered', onPushRegistered); await NotificationsIOS.addEventListener('remoteNotificationsRegistrationFailed', onPushRegistrationFailed); await NotificationsIOS.requestPermissions(); function onPushRegistered(deviceToken) { // TODO: Send the token to my server so it could send back push notifications... console.log("Device Token Received", deviceToken); }This code is generating a Device Token on iOS like 45f41b17e16b5970fe35.......8222b01289580bae87ba35d2b2bc72b
When I use this token to send FCM message it is giving the above error.
I think it is not a FCM token. I have also added the APN's certificates to the firebase.
I can generate the local notifications using this library on ios and the remote andriod notification is also working properly. Kindly help me to get it fixed as i don't want to use any other library thanks."react": "16.8.6",
"react-native": "0.60.5",
"react-native-notifications": "^2.1.5",
Hi, I faced this issue, I followed this https://firebase.google.com/docs/cloud-messaging/ios/client to config firebase on IOS...
@osamausmani I found a temporary solution:
curl -X POST -H "Authorization: key=your_authorisation_key" -H "Content-Type: application/json" -d '{
"application": "com.yourapplication.app",
"sandbox":true,
"apns_tokens":[
"45f41b17e16b5970fe35.......8222b01289580bae87ba35d2b2bc72b"
]
}' "https://iid.googleapis.com/iid/v1:batchImport"
This request return a good FCM Token
Any word on this?
I did manage to receieve notifications on dev with the solution @yannou788 posted.
However after I've published to the app store I'm still seeing 0 registered devices for the iOS app in firebase.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
The issue has been closed for inactivity.
I have facing some issue on ios. Notifications.registerRemoteNotifications(); not doing anything. Listeners registerRemoteNotificationsRegistered or registerRemoteNotificationsRegistrationFailed are not getting called.
Most helpful comment
@osamausmani I found a temporary solution:
This request return a good FCM Token