Closed xj-m closed 3 years ago
@xj-m it seems a push device token is wrong
1) first of all, please share an example of iOS device token. 2) make sure you use native device token for IOS rather than FCM-like 3) make sure you are using proper 'environment' for push subscriptions and for push events. Make sure when you subscribe for development env, then you send an event for development env (to for production)
After set the correct development env, seems "BadDeviceToken" issues is solved,
[notification subscriptions] result Array [
Object {
"subscription": Object {
"device": Object {
"bundle_identifier": null,
"client_identification_sequence": "350843....d1a1af61bd2",
"platform": Object {
"name": "ios",
},
"udid": "E3E*****-****-****-****-********19A8",
},
"id": 1488867,
"notification_channel": Object {
"name": "apns",
},
},
},
]
This is the log message from ConnectyCube.pushnotifications.subscriptions
, my device token(client_identification_sequence) is of length 64, and it seems the udid is also in the right format, but I still get the error "DeviceTokenNotForTopic"
@xj-m another thing to check is make sure you crated Universal iOS push certificate and uploaded it to ConnectyCube admin panel
Please double check it
Yes, I followed the instruction in this document https://developers.connectycube.com/reactnative/push-notifications and uploaded to the admin panel
Is that possible that the reason is that the bunder ID is not aligned with the environment, since I'm using expo client, with bundler ID set in config "app.json". As for Testflight, I think I tried once but still got some error.
After moving to the Testflight, everything works as expected, so I believe it's bunder-id problem
@DaveLomber I tried to send push notifications using curl command and logs in dashboard show that it connecty cube server search subscribers ALWAYS in production environment. But shouldn't it search subscribers in environment provided in event params?
@xj-m we recently release some updates to EXPO push notifications this may help https://developers.connectycube.com/reactnative/push-notifications?id=expo
@GRyabkin we made it simpler you do not need to specify the ENV instead, the push will be sanded to ALL envs a user has subscriptions to
In the example code, the "react-native-push-notification" is used for notification, which is not available in the expo, so I referred to https://docs.expo.io/push-notifications/sending-notifications-custom/ and here is my code
Then I have registered devices in "admin dashboard" > "push notification" > "Device Subscription", but the notification on the "Queue" page shows they failed, the errors are "BadDeviceToken" or "DeviceTokenNotForTopic"
How should I debug this error, and is there an official way on push notification on Expo? Thank you so much!