Using sandbox APNS on AdHoc Distribution Builds for iOS
Solution 1
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.
Solution 2
Apple uses a different server for:
- Apps signed with a Development profile
- All other profiles (AdHoc, InHouse and AppStore). These are going via a Live Server.
Comments
-
beno about 2 years
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)
-
beno over 11 yearsnice find, I hadn't seen that explicitly stated anywhere.
-
beno over 11 yearsalso found this answer: stackoverflow.com/questions/2625773/…
-
stakahop about 8 yearsThats right. For GCM just go to your AppDelegate.swift, find method didRegisterForRemoteNotificationsWithDeviceToken and replace kGGLInstanceIDAPNSServerTypeSandboxOption:true with kGGLInstanceIDAPNSServerTypeSandboxOption:false. After that you are not in sandbox environment anymore.
-
bluevoid about 7 yearsIf TestFlight builds are just on-demand ad hoc, then this paragraph means that TF builds can't use the sandbox APNS either (via stackoverflow.com/q/44399563/22147)
-
Nick over 6 years@stakahop I think your answer is very specific to Google Cloud Messaging... I cant see how to apply that to a normal Apply Push setup?
-
bluevoid over 6 yearsAh that’s a shame, would be nice to update this question for 2017/18