1

To start with the problem, the push notification certificates in the backend was set-up by another developer and was perfectly working fine. However, the developer has left and as I do not have access to his machine hence I created new distribution certificates to upload the new version of the app, which then stopped the push notifications to get delivered. I'm working with push notifications for the first time and quite confused where the problem lies. Can anyone give me a clear picture what is happening and how to go about it?

Here's what I did after it stopped working. I went to the developer portal, and as it was showing push notification was enabled hence,

  1. generated a code signing request or CSR file in my mac
  2. downloaded the aps.cer file
  3. created .p12 and .pem file

After this, I have provided both the .p12 and .pem file to our backend guy, but still, it was not working on our test flight builds.

I then tested using Pusher application which was available from GitHub and it successfully delivers the push notification to the test flight build using production certificates.

Hence can anyone give me a clear idea, where I could have gone wrong? Do I need to revoke my push notification SSL certificate and generate again? or what could be the possible mistake?

Rameswar Prasad
  • 1,331
  • 17
  • 35
  • For test flight you need to provide production p12, Most probably your backend guy is doing something wrong :D. – mustafa96m Oct 25 '17 at 19:45
  • @mustafa96m for backend which one is required for released or in general for production? Is it the .pem file or .p12 file or both? – Rameswar Prasad Oct 25 '17 at 19:47
  • Checkout this : [link](https://stackoverflow.com/questions/21250510/generate-pem-file-used-to-setup-apple-push-notification) – mustafa96m Oct 25 '17 at 19:50

2 Answers2

0

If it is working using any online tool such as pusher, then it should work fine from code as well. your developer is missing something, Ask him to check configuration properly. he must invoke production APNS url/port if it is production certificate and production app. he must invoke sandbox APNS url/port if it is sandbox certificate and sandbox app. Below url/ports are used for APNS(assuming you are using directly APNS instead firebase)

SANDBOX_GATEWAY_HOST = "gateway.sandbox.push.apple.com"
SANDBOX_GATEWAY_PORT = 2195
SANDBOX_FEEDBACK_HOST = "feedback.sandbox.push.apple.com"
SANDBOX_FEEDBACK_PORT = 2196
PRODUCTION_GATEWAY_HOST = "gateway.push.apple.com"
PRODUCTION_GATEWAY_PORT = 2195
PRODUCTION_FEEDBACK_HOST = "feedback.push.apple.com"
PRODUCTION_FEEDBACK_PORT = 2196

Also make sure these url are reachable from your server, try to send a push notification from server using curl command and debug if still issue persist. Keep in mind proxy also if you using.

Mukesh
  • 207
  • 1
  • 6
0

Just answering here so that it can be helpful to someone else. Everything was set up as accordingly, however, the problem was 'Sandbox' key in the server was set to 'True' for even production. Once we turned it false, everything worked perfectly.

Rameswar Prasad
  • 1,331
  • 17
  • 35