OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
606 stars 204 forks source link

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

Open andreaparadigma opened 5 months ago

andreaparadigma commented 5 months ago

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?

Relevant log output

No response

Code of Conduct

faisal-atrule commented 5 months ago

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

iOS -> Runner -> Runner.entitlements

fabioselau077 commented 5 months ago

Same here in new project onesignal

image
fabioselau077 commented 5 months ago

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 commented 5 months ago

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:

InfoSpecific commented 4 months ago

I am facing same issue.

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

petodavid commented 4 months ago

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."
wearemeeters commented 4 months ago

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.