OneSignal-Flutter-SDK icon indicating copy to clipboard operation
OneSignal-Flutter-SDK copied to clipboard

[Bug]: Apns Bad Device Token after update from 3.5.0 to 5.0.4

Open andreaparadigma opened this issue 1 year ago • 7 comments
trafficstars

What happened?

After update from 3.5.0 to 5.0.4 in iPhone I no longer receive push notifications.

Steps to reproduce?

1. update to onesignal_flutter: ^5.0.4
2. migrate the code https://github.com/OneSignal/OneSignal-Flutter-SDK/blob/user_model/main/MIGRATION_GUIDE.md
3. launch the app
4. send a notification
5. no notification received and "Apns Bad Device Token" in Dashboard under "Subscription Status"

If revert to 3.5.0 all works correctly

NB: In the iOS config on the OneSignal settings page I don't have any warnings

What did you expect to happen?

I expected to receive a push notification

OneSignal Flutter SDK version

Release 5.0.4

Which platform(s) are affected?

  • [X] iOS
  • [ ] Android

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

andreaparadigma avatar Jan 18 '24 15:01 andreaparadigma

I was facing this issue also. I have fixed that by manually setting the 'aps-environment' to 'production'

iOS -> Runner -> Runner.entitlements

faisal-atrule avatar Jan 23 '24 08:01 faisal-atrule

Same here in new project onesignal image

fabioselau077 avatar Jan 27 '24 03:01 fabioselau077

I was facing this issue also. I have fixed that by manually setting the 'aps-environment' to 'production'

iOS -> Runner -> Runner.entitlements

make but same error :/

fabioselau077 avatar Jan 27 '24 03:01 fabioselau077

For OneSignal support, work!

"Hi there, The error "Apns Bad Device Token" can be fixed following the troubleshooting guide. Please follow the steps in our iOS Mismatched User Environment docs if you have not already. Then try the following:

  • uninstall the app on these listed player IDs (if you recognize the player ID)
  • click the iOS config on the OneSignal settings page and press save, this will clear the warning
  • re-install the app on the device
  • open the app and re-subscribe to the prompt. This will give you a new player ID.
  • Send yourself a notification and see if the warning appears again If you don't recognize any of the listed player IDs, just click the iOS config on the OneSignal settings page and press save, this will clear the warning. On the next iOS notification see if the warning shows again. Let us know if you have any additional questions for us. Thanks."

fabioselau077 avatar Jan 27 '24 03:01 fabioselau077

I am facing same issue.

https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/828#issuecomment-1937012011

InfoSpecific avatar Feb 10 '24 13:02 InfoSpecific

We are facing the same issue, the mentioned steps are not working in our case, any updates?

For OneSignal support, work!

"Hi there, The error "Apns Bad Device Token" can be fixed following the troubleshooting guide. Please follow the steps in our iOS Mismatched User Environment docs if you have not already. Then try the following:

  • uninstall the app on these listed player IDs (if you recognize the player ID)
  • click the iOS config on the OneSignal settings page and press save, this will clear the warning
  • re-install the app on the device
  • open the app and re-subscribe to the prompt. This will give you a new player ID.
  • Send yourself a notification and see if the warning appears again If you don't recognize any of the listed player IDs, just click the iOS config on the OneSignal settings page and press save, this will clear the warning. On the next iOS notification see if the warning shows again. Let us know if you have any additional questions for us. Thanks."

petodavid avatar Feb 22 '24 14:02 petodavid

we are experiencing the same behaviour but on our Xamarin SDK 4.3.4 and this started to appear on ios 17. Before on ios 16 it worked as expected. And from fellow developer I know that he same happens on the MAUI version. So this does not look like a SDK issue to me.

Tried to fix certificates, to no avail. I am using p8 key to authorize APNS via OneSignal if that helps.

wearemeeters avatar Feb 26 '24 13:02 wearemeeters