Using sandbox APNS on AdHoc Distribution Builds for iOS

By | December 7, 2017

I’ve been reading a bunch of Apple’s docs, as well as many other SO questions, but haven’t found the answer to this particular question.

I have an existing workflow in place for generating AdHoc Distribution builds for QA members and beta testers. Now that I’ve added support for push notifications, I’d like those notification paths to be able to be tested as well.

I’m under the impression that Developer builds, signed with a Development provisioning profile, generate tokens that for the sandbox/development APNS environment, and Distribution builds, signed with a Distribution provisioning profile (whether that be destined for AdHoc Distribution OR AppStore Distribution), generate tokens for the production APNS environment. I believe this can be confirmed by opening the different .mobileprovision files, and examining the aps-environment key.

I’d like to know if there’s a way to have my AdHoc Distribution builds use the sandbox APNS environment, rather than the production APNS environment.

If I really wanted QA and beta testers to use sandbox APNS, would I have to somehow find a way to allow them to run development builds, rather than distribution builds?

Or are my assumptions about the way things work way off base? (referenced this post and this post)


I did found some mention to AdHoc in the context of APNS environments :

Note: There is a separate persistent connection to the push service
for each environment. The operating system establishes a persistent
connection to the sandbox environment for development builds; ad hoc
and distribution builds connect to the production environment.

It’s taken from Technical Note TN2265.
I guess this note confirms that you can’t use the sandbox env in AdHoc distribution.


Apple uses a different server for:

  1. Apps signed with a Development profile
  2. All other profiles (AdHoc, InHouse and AppStore). These are going via a Live Server.

Leave a Reply

Your email address will not be published. Required fields are marked *