0

I'm developing an app which has two targets, one is for enterprise in-house distribution and other one is for Appstore. There are two Apple dev account, one is enterprise (used for enterprise target) and other one is standard one for Appstore.

I'm using in-house target for testing purposes only (I have lots of test devices so I'm using it). I have a production push notification certificate for the Appstore target and I want to add a new certificate for in-house target too. I'm curious about if it will be a problem for my Appstore target?

So my question is: Can I have two sandbox & production apn certificate one for Appstore and other one is for in-house? Will notifications will mix?

Emre Önder
  • 2,408
  • 2
  • 23
  • 73

3 Answers3

2

If you have different bundle ID for each app then each APNS certificate will be different as they are treated as two different applications.

So, Yes you can have two sandbox & production APNS certificates (one per bundle ID); No notifications will not mix.

Shebuka
  • 3,148
  • 1
  • 26
  • 43
  • Is there any official document for it? Thank you. – Emre Önder Sep 11 '19 at 10:21
  • Here is link to official APNs certificate creation documentation: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_certificate-based_connection_to_apns – Shebuka Sep 11 '19 at 10:26
  • It does not have any info about two production certificate and how they will be used. – Emre Önder Sep 13 '19 at 10:12
  • By having different bundle ID you have effectively two separate applications. So follow the procedure to create one production certificate for each bundle ID. – Shebuka Sep 13 '19 at 11:52
1

There is no official APNs documentation specifically for handling separate targets within same project, because APNs has nothing to do with your project / target set up.

As you can read in Setting Up a Remote Notification Server,

The delivery of remote notifications involves several key components:

  • Your company's server (known as the provider server)
  • Apple Push Notification service (APNs)
  • The user's device
  • Your app (running on the user's device).

Each item in above list is identified by

  • Apple Push Notification service (production, or sandbox/development): the url you use to trigger APNs from you server
  • User's device: device token your app gets when it registers for remote notification
  • Your app (running on the user's device): bundle id, and provisioning profile (dev/appstore/adhoc/inhouse) you use to run the app
  • Your company's server: APNs certificate you create, in dev portal for you bundle id (mentioned above), and use to trigger remote notifications to a particular device

As you can see there is not restriction on which server can trigger which remote notification, or how the app code, project, or targets are set up.

A single server (or even a developer machine, from command line using curl), can trigger push notifications, for all the right combinations of above conditions. It is up to you to make sure you use the correct certificate for the correct version of the app. e.g. if you use the InHouse app's APNs certificate with an AppStore app's device token it will fail, etc.

Many developers (including myself) have triggered push notification from command line, to multiple versions of the same app, with separate targets and it works.

Community
  • 1
  • 1
Swapnil Luktuke
  • 10,385
  • 2
  • 35
  • 58
  • 1
    So I can trigger different push notifications with different server, different app target both for production? – Emre Önder Sep 13 '19 at 13:28
  • 1
    Yes, absolutely.. your server, your app and apple's APNs are completely different entities, which need not know anything else about each other.. other than the identifiers i have mentioned above.. so if you have a single dev server supplying push notifications for ALL your environments with correct certificates and device tokens ... it will still work (not advised, but will work) – Swapnil Luktuke Sep 16 '19 at 06:41
0

If you get two targets,then yes.Just make sure your app is in right target when you are using it.When you put your app in the App Store,use the Appstore target.

Lynx
  • 381
  • 1
  • 13