Push notification implemented and tested well, but recently encountered one weird issue, where it stopped push notification in IT environment and working fine in UAT.
Using same APS certificate in both environments (IT and UAT) and app also having the same APS certificate.
The device token generated in mobile is registered in two users in respective environments.
When we try to push the notification from UAT server, it was successful and when we try to push the same from IT server the response says “BadDeviceToken”
"message": "Notification failed for the devices XXXXXXXXXX8275A19D4EE30C73C18CFEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX : reason -BadDeviceToken"
Tried to fix:
1) Delete and reinstall the app and tested first for IT and then for UAT. But same result – working fine in UAT, but not in IT.
2) Verified APS certificates at both servers, and are same.
3) Tested an old iOS build, on which push notification was working fine earlier on IT. But same result – working fine in UAT, but not in IT.
Expectation is Push notification should work for both environment.