58

Guys I'm having some trouble figuring out the key differences between the APNS (push notification) Developer (Sandbox) and Production modes. In particular I have the following questions:

1) Can I launch an app on the app-store with Push Notifications that is only registered for the APNS Developer Certificate? Or do I need to use to use APNS Production for apps I want to launch on the app store?

2) In general, what are the functional reasons other than "development on development APNS" and "production on production APNS" that would inform my decision. In particular why would I choose to implement an APNS Developer certificate for my app at all and why not just run everything on a Production push account?

Here's what Apple says on it's website but it doesn't get to the heart of my question:

Development: Use the development environment for initial development and testing of the provider app. It provides the same set of services as the production environment, although with a smaller number of server units. The development environment also acts as a virtual device, enabling simulated end-to-end testing. You access the development environment at gateway.sandbox.push.apple.com, outbound TCP port 2195.

Production: Use the production environment when building the production version of the provider app. Apps using the production environment must meet Apple’s reliability requirements.

mfaani
  • 33,269
  • 19
  • 164
  • 293
Eugene
  • 1,377
  • 2
  • 18
  • 22
  • FWIW If you were to look in the list of your certificates in the dev portal then the production Certificate Type is named: _Apple Push Services_, while the sandbox's certificate type is named: _APNs Development iOS_ – mfaani Feb 18 '20 at 21:13

2 Answers2

50

If you want to post your app to the app store you will need to use a Production Provisioning Profile, therefore all notifications sent with APNS Developer Certificate will not arrive to your app signed with a Production Provisioning Profile.

Why not use only a production APNS certificate? Well you can do this but...

  • In order to test you will need to build your app with a Production Ad Hoc Provisioning Profile, this is a lot of extra work at compiling
  • Using a production cert in development, and therefore using an ad-hoc build, you cannot run with the debugger. Makes troubleshooting very painful.
  • Test notifications makes everything goes to production so you have to be extra careful
dminones
  • 2,236
  • 20
  • 21
  • 1
    What do you mean by "Test notifications makes everything goes to production"? Do you mean that you will have to use production provisioning profile, certificates, etc... ? – Yaron U. Aug 07 '15 at 16:12
  • I mean that if you use for every purpose a Prod certificate you're not going to be able to push only to sandbox devices – dminones Aug 07 '15 at 19:22
  • What exactly is a "Production Ad Hoc Provisioning Profile"? In Xcode, I can only see one type of Ad Hoc profile. – waldgeist Feb 05 '16 at 14:09
  • Is a provisioning profile that works like the app is in the app store in terms of apns certicate required to send notifications. – dminones Feb 07 '16 at 15:46
  • A key thing to be aware of is that if you are using a production cert in development, and therefore using an ad-hoc build, you cannot run with the debugger. Makes troubleshooting very painful. – C6Silver Jun 09 '17 at 16:41
  • 1
    If type of APN certificate is determined by type of provisioning profile, what does `aps-environment` in entitlements mean? – sesm Feb 19 '18 at 13:56
  • so for a given bundleID, you can send both sandbox or production push notifications? – mfaani Feb 18 '20 at 19:37
  • 1
    @Honey yes, exactly! – dminones Feb 18 '20 at 20:54
  • 1
    Thanks. I was just able to run my Xcode and then use the production cert with it. I didn't have to any of the ad-hoc stuff and I can use the debugger. Does this invalidate the first two bullets? – mfaani Feb 18 '20 at 21:02
26

dminones' answer is very accurate. I want to point out that you can now use production cert in development. The difference is that you will send to 'gateway.sandbox.push.apple.com' for development and 'gateway.push.apple.com' for production. I think the reason for separating sandbox and production is to avoid sending test push notifications to real users. Imagine you do blast notifications, all of your users will have the notification.

Rohan Talip
  • 356
  • 4
  • 13
Terry Tan
  • 421
  • 5
  • 12