Group Group Group Group Group Group Group Group Group

APNS with Vapor, in the .production environment


I followed the guide, “Sending Push Notifications With Vapor” (Sending Push Notifications With Vapor | I am looking to switch the environment to .production from .sandbox in the app.configuration portion. When I change it, errors are returned and I’m not sure why. Do you have a guide or resource for APNS in production?

The error returned is “badDeviceToken” when I send an APNS to a device registered in .production environment. This hadn’t happened when in the .sandbox environment. Thank you ahead of time for your help!

Things are basically the same from the server point of view. You need a production certificate that’s configured for the prod environment but that’s about it. You also need to change things on the iOS side. It needs to be build for distribution and you need to request a new token in the app from the device that works with the prod environment

OK, will try. It has returned that error each time I compile from XCode, not using a Test Flight instance of the app. I’ll try to push to Test Flight, thank you!