Emre Önder
Emre Önder

Reputation: 2537

Use two production APN Certificate

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?

Upvotes: 1

Views: 2192

Answers (3)

Swapnil Luktuke
Swapnil Luktuke

Reputation: 10475

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.

Upvotes: 1

Lynx
Lynx

Reputation: 401

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.

Upvotes: 0

Shebuka
Shebuka

Reputation: 3228

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.

Upvotes: 2

Related Questions