1

I'm developing an iPhone application which uses Apple's push notifications. I've followed the steps listed here: https://parse.com/tutorials/ios-push-notifications and my device receives notifications when I run the app by connecting my device through Xcode. But, when I upload the app to Test Flight, the app fails to receive notifications. Upon further investigation, I found that the token returned by

NSString * token = [NSString stringWithFormat:@"%@", deviceToken];

is different when the app is run through Xcode, and different when it's run from Test Flight. Why is that? And how can I fix it? I'm using APNS to send push notifications.

1 Answers1

3

You need to check for certificates. When you register for bundle id, you get options to generate two provisioning profiles and corresponding two push notification certs, dev and production. When you run app in dev mode from Xcode i.e. when Xcode target you are running configured to pick up development provisioning profile specified, your server needs to use dev/sandbox certs which returns you token from apple's sandbox servers (this is happening in your case). When you sign app with prod certs i.e you use prod provisioning profile while generating ipa, your server needs to use prod push certs. Probably in your case, you uploaded the app signed with prod certs and server still using dev certs. Check for that. Good luck.

Avi
  • 2,196
  • 18
  • 18