Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single APNs key on multiple applications in one organisation

My organisation maintains multiple applications and there's a confusion about how the APNs keys are supposed to be used. We are using firebase to send push notifications.

So far we have two apple keys for two different applications. But cannot create a third key with APNs activated. Apple key APNs error

This question indicates that we're supposed to use the same key for all applications.

My questions are:

If we only can create two keys for one organisation is one supposed to be used for production and one for testing/development?

If we use the same keys for multiple unrelated application (unrelated except that the apps are all created by the same organisation) what stops cloud messages from being pushed to the wrong application. Is it related to identifiers for apps? Are we supposed to create a convention to circumvent the problem of sending messages to the wrong app? ( I don't actually think this is a very valid option. It feels very wrong.)

For example:

  • using topics with a prefix for each app?
  • create device groups, one for each app?

I've asked this question here as well: https://forums.developer.apple.com/message/415911#415911

like image 587
Tejpbit Avatar asked May 12 '20 08:05

Tejpbit


People also ask

Can I have more than one Apple push certificate?

Actually you can create only 2 apple push certificates for one App ID and no more.

How do I generate APNs authentication key?

[1] To begin, visit the Apple Developer Member Center and log in with your credentials. [2] Click Certificates, Identifiers & Profiles. [3] Click Keys then the “+” button in the top right corner to create a new key. [4] Enter a descriptive name for your APNS Auth Key, then select Apple Push Notification Service (APNs).

Does APNs key expire?

No. APNs Auth Key will never expire as Apple suggests. It is now a more preferred way to handle Push Notifications than using APNs Certificate.

What is APNs and how it works?

An Access Point Name (APN) a allows device's network to connect to the internet. With the APN settings in place, your device builds a connection to a carrier's gateway. Part of this process involves the carrier using a defined APN network to choose the assigned IP address(s) and security settings where applicable.


1 Answers

The key is used to authenticate to the service. It identifies your organisation to the service.

The reason you can have two keys is so that you can create a new one before revoking the old one if the key is compromised.

When an app registers for remote notifications you receive an identifier that is unique for that app on that device. If you have multiple apps on that device each will get a different identifier.

When you send a push notification the identifier ensures that it gets to the right app on the right device.

You need to ensure that you store the identifier against the right app on your backend (or you may have different backends for different apps).

like image 178
Paulw11 Avatar answered Oct 09 '22 16:10

Paulw11