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:
- In Provisioning Portal, Create a Distribution certificate.
- Get the "Device ID" of the iPhone that you intend to use for testing. Open iTunes -> Connect your device -> Select your device -> In Summary Pane, Click on Serial Number label, it will change to identifier (40 Hex characters) -> Choose Edit, Copy.
- In Provisioning portal, Go to Devices -> Add new Device -> Enter the copied Device ID and give it a name.
- In Provisioning portal, Create a Distribution Provisioning Profile. (Go to Provisioning -> Distribution). For Distibution type , Check "AdHoc". Select the App Id, If you have a distribution certificate, it will automatically be selected here. Select the newly entered device and Submit. Download this Provisioning Profile.
- In Xcode, Window -> Organiser. Click on Devices and select Library -> Provisioning Profiles. If you are the admin, then Clicking on Refresh should fetch the newly created provisioning profile. If not, Drag and Drop the Adhoc Provisioning Profile to this list.
- In Xcode, in your project Build Settings -> Code Signing Identity -> Release section, Select "iPhone Distribution". For "Any iOS SDK", Select the newly created Provisioning Profile. It will be available in the list.
- In Xcode, Product -> Archive. Once it finishes, Archiving, it will open the Archive window automatically. Select the project and click Distribute, In the Distribute window, Select "Save for Enterprise or AdHoc Deployment" -> Select the "Code Signing Identity" which corresponds to the new Provisioning Profile. Continue the process and this will create an ".ipa" file.
- Send this .ipa file and the new provisioning profile for testing adHoc distribution.
How to load the adHoc distribution on the test device:
- Open iTunes, Connect your test device.
- Drag and Drop the new provisioning profile to iTunes.
- Drag and Drop the .ipa file iTunes.
- Sync ur device. This would load the app.
For Push Notifications to work on Adhoc distribution:
- Use the production certificates.
- Use production APN Host: gateway.push.apple.com
- Use production APN Feedback Host: feedback.push.apple.com.