FatFractal customer forums



Author Topic: iOS Push Notifications - going from Development to Production (Ad Hoc)  (Read 9997 times)

Ken

  • Newbie
  • *
  • Posts: 18
    • View Profile
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:
  • Configured APP ID in developer center for production push notifications
  • Installed production certificate ​(.cer) in my keychain
  • Exported production certificate to .p12 file (with password)
  • Copied the .p12 file into the ff-config directory (renamed to ApplePushKeystore.p12)
  • Updated ' ApplePushUsingProduction​' FFDL setting to 'true'
  • Updated 'ApplePushKeystorePassword' FFDL se​tting to the .p12 password set during export
  • Created a new Apple Provisioning Profile for Ad Hoc
  • Configured XCode to use the Ad Hoc provisioning profile (checked that everything builds and runs on my device fine)

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

dave

  • Administrator
  • *****
  • Posts: 52
    • View Profile
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
« Last Edit: May 23, 2014, 01:07:47 PM by dave »

Ken

  • Newbie
  • *
  • Posts: 18
    • View Profile
Thanks Dave, I'll give that a go and update you on the results.

Ken

  • Newbie
  • *
  • Posts: 18
    • View Profile
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!

 

Copyright © FatFractal customer forums