FatFractal customer forums

NoServer => NoServer Questions and Answers => Topic started by: Ken on May 21, 2014, 10:30:20 PM

Title: iOS Push Notifications - going from Development to Production (Ad Hoc)
Post by: Ken on May 21, 2014, 10:30:20 PM
Hi all,

Was wondering if anyone has the same APNS issues as me when moving from Development certificate to Production (Ad Hoc) certificate?

This is the error I get when sending a push notification using FF JS server-side SDK (note that I managed to get development version working fine):
Code: [Select]
APNS: [1] Invalid token javapns.notification.exceptions.ErrorResponsePacketReceivedException: An error response packet was received from the APNS server: APNS: [1] Invalid token]
Here are the steps I took when moving to Production cert:

Am I missing something here?

I also noticed that when I changed to Production, the FFNotificationID for the same user did not change. I tried deleting the entries in FFNotificationID and got the app to regenerate it but the IDs remained the same. Switching FFUser in the app also resulted in the same FFNotificationID. Is this expected?


Thanks in advanced!

Ken
Title: Re: iOS Push Notifications - going from Development to Production (Ad Hoc)
Post by: dave on May 22, 2014, 10:25:17 PM
Hi Ken,

The issue is the FFNotificationID. Your device should get a completely different token when you switch to production. I would recommend examining the the token received in application:didRegisterForRemoteNotificationsWithDeviceToken:, that's the most direct way to see what token you're getting. Once you confirm that you are getting different tokens, we can move on to figuring out why they're not syncing to the backend.

Remember also that you need to install an ad-hoc build for the production push service to work -- if you just run with Command-R, that will make a debug build using your dev provisioning profile, so it will use the development push servers.

Hope this helps! Sorry it took so long to get back to you, but I've now tested that everything on our end is working. Let me know if you have any other questions.

Dave
Title: Re: iOS Push Notifications - going from Development to Production (Ad Hoc)
Post by: Ken on May 22, 2014, 10:41:10 PM
Thanks Dave, I'll give that a go and update you on the results.
Title: Re: iOS Push Notifications - going from Development to Production (Ad Hoc)
Post by: Ken on May 25, 2014, 10:01:56 PM
Hi Dave,

Thanks for pointing me in the right direction. I managed to get APNS working on ad hoc. Issue was as you guessed, running a debug build from XCode (Command-R) instead of an ad hoc build. Noob mistake!

All working fine now, thanks!