3
votes

Push notifications worked fine with a Development provisioning profile, but once I tried putting the app on the Beta testing programme (TestFlight), they don't.

I tried following all the required steps when switching to a Production profile, but it still doesn't work. Here's what I have.

In the Member Center:

  • Certificate of type iOS Distribution. enter image description here
  • App ID. Named (not wildcard). Push notifications enabled for both Development and Distribution - green lights - with all SSL certificates generated and uploaded. enter image description here
  • iOS Distribution Provisioning Profile, that uses the above mentioned Certificate and App ID as well as lists Push Notifications among enabled services. enter image description here

In XCode. Target > Build Settings > Code Signing:

  • Provisioning profile - iOS Distribution, same as in Member Center.
  • Code signing identity (both Debug and Release) - iPhone Distribution. enter image description here

Am I missing something (not so) obvious? Any help would be greatly appreciated.

2
As ever, context is key. I failed to mention that I use parse.com to handle my push notifications, and what I hadn't done was to upload a .p12 production certificate to parse.com to make it work.artooras
Also, I haven't tested this, but it's worth noting that I selected a distribution provisioning profile for both Project and Target in Xcode - for some reason, they are handled independently.artooras

2 Answers

2
votes

Everything seems correct. Maybe you should precise what is not working :

  • App not registering to APNS token at all
  • App correctly registering but push not received

Process to the following checks

App not registering to APNS token at all

Mobile Provision

Make sure you refresh your mobileprovisions through XCode after enabling push to be sure those includes the correct entitlements. You can check this by opening the mobile provision in an editor and look for the aps-environment key?

Registration to APNS

make sure the code to register to APNS does not depend on any personal settings (like a Push Id for some SaaS push service that is missing)

.

App correctly registering but push not received

  • Check that the pushToken received is sent to the correct environment of your server (the one that connect to APNS)
  • Check that your server is using the Production APNS Certificate
0
votes

As it happens, I failed to provide full context in my question. I use Parse.com to handle my backend as well as push notifications. So what I was missing was a production certificate on Parse.com, not just a development one. So, if anyone else is using Parse and ran into a similar problem, I hope this is helpful.