5
votes

Similar to this post, push notifications works on development, but does not work through testflight. Here are screenshots of my certs:

  • 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 genereated and uploaded enter image description here
  • iOS Distribution Provisioning Profile, that usese the above mentioned Certificate and App ID as well as lists Push Notifications among enabled services enter image description here
  • distribution and adhoc signing enter image description here

Using Heroku and "node-pushnotifications". It works on development, does not work on testflight. APN_key.p8 and serviceAccountKey.json are in there as well.

I've been working on this all day and been scouring the internet for answers but have yet to find any. Any ideas?

2
I believe TestFlight builds are using production push server not sandbox, in case you didn't know. Are you able to verify you're sending to the production push server? If your database have existing push token and if one of them is dev token, it will stop sending push as soon as it reaches that bad token.Zhang
@Zhang I believe this was the case in the past, but server tokens are now the same for distribution and production. source: "Thankfully, Apple has greatly simplified the process of authenticating with APNs with the introduction of APNs Auth Keys, which never expire (unless revoked by you) and work for all deployment schemes." (eladnava.com/…).cwRichardKim
That sounds like just the auth key not the push tokens themselves. The tokens are still separated by dev and prod (I resolved this bad token issue a few weeks ago :D) The auth key is what you use to connect to Apple's push server. The push tokens are identifiers to the device, the push notifications will be sent to. Still nice that Apple makes it easier to connect to server now.Zhang

2 Answers

12
votes

I was having the same issue with my Firebase project when going from development to testflight production. Changing my APS Environment value to "production" solved this problem for me.

enter image description here

0
votes

Issue resolved! we didn't properly set up our node environment in the server (needed NODE_ENV=production)