I have successfully implemented APN for development Environment. But i am facing problems while implementing the same for ad-hoc distribution environment. Can anybody please suggest me do i need to create different App Id , Certificate and Provisioning Profile for that? And is there any change in Sandbox? A tutorial of steps will be very much appriciated.
Thanks Saleel Karkhanis
For Adhoc distribution, Please follow the instructions below:
How to load the adHoc distribution on the test device:
For Push Notifications to work on Adhoc distribution:
I had major problems with this as well. I had absolutely no errors in my code. I just never got a push notification on the phone in Ad Hoc.
It turns out that I had some sort of problem with my certificates. I created
I'm not really certain what the problem was, exactly, but I solved it by logging into my developer account as the team agent and recreating everything under that login. I had originally created the certificates as a team admin.
Your development mode may work just fine, since any team member can create development distribution profiles. But only certain team members can create distribution profiles. Have your team agent create everything and try it again.
There is a separate persistent connection to the push service for each environment (Development and Production). The operating system establishes a persistent connection to the sandbox environment for development builds; ad hoc and distribution builds connect to the production environment.
If you are using GCM. Go to your AppDelegate.swift. Find method: didRegisterForRemoteNotificationsWithDeviceToken and replace
with
In addition to Sushma Satish's answer , When you change certificates from developement to distributon , the device token generated for your phone is different. So make sure you're changing the device token on the server.