Enabling Apple Push Notifications for ad hoc distribution environment

Saleel  picture Saleel · Aug 26, 2011 · Viewed 21.2k times · Source

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

Answer

Sushma Satish picture Sushma Satish · Jun 30, 2012

For Adhoc distribution, Please follow the instructions below:

  1. In Provisioning Portal, Create a Distribution certificate.
  2. 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.
  3. In Provisioning portal, Go to Devices -> Add new Device -> Enter the copied Device ID and give it a name.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. Send this .ipa file and the new provisioning profile for testing adHoc distribution.

How to load the adHoc distribution on the test device:

  1. Open iTunes, Connect your test device.
  2. Drag and Drop the new provisioning profile to iTunes.
  3. Drag and Drop the .ipa file iTunes.
  4. Sync ur device. This would load the app.

For Push Notifications to work on Adhoc distribution:

  1. Use the production certificates.
  2. Use production APN Host: gateway.push.apple.com
  3. Use production APN Feedback Host: feedback.push.apple.com.