Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get production APNS token

In development everything works fine:

  • my app (built with Phonegap) sends the device token to the server
  • my server sends the notification to the Apple servers
  • I receive the notification on my iPhone

But, when I switched to production (enabled push notifications and created a new SSL certificate for production) I keep getting "(8) Invalid token" from Rapns (which is installed on my push notification server).

I have read that this message is probably caused because I use a development device token in production (i.e. my server use a production certificate, but the app is running in development and sends a development device token to the server).

How can I run the app in production mode, so that I get a valid device token for production?

I think I should use an Ad Hoc Distribution Provisioning profile, but even if I have changed the "Code Signing Identity" properly in Build settings, I still get the same token I was getting in development! And this obviously doesn't work.

like image 316
collimarco Avatar asked Apr 07 '13 18:04

collimarco


1 Answers

Solved by creating an archive - instead of run - and signing it with an Ad Hoc Distribution Provisioning profile.

like image 135
collimarco Avatar answered Oct 02 '22 20:10

collimarco