Device Tokens for Apple Push Notification Provider

If I am an Apple Push Notifier provider for " multiple iOS applications, can I use the same token for multiple applications? I know that I need unique SSL certificates for each application. However, I got confused in the device tokens.

An example . I have two applications A and B. I want to provide push notifications for both applications. Say I collect a device token T from a user who installs application A. Suppose I have unique SSL certificates for both applications. When the same user installs application B, can I reuse the T token when providing push notifications for application B?

Additional information : after re-reading Apple docs is still not clear. This paragraph, in particular, suggests that the device token can be reused:

Each notification that a provider sends APNs for delivery to a device must be accompanied by a device token received from the application on that device. APN decrypts the token using the token key, thereby ensuring that the notification is valid. It then uses the device identifier contained in the device token to determine the target device for notification.

Note It appears that the “subject” / batch identifier contained in the SSL provider certificate for each application sends notifications to a specific application on the device. Therefore, it seems plausible that device tokens are unique to the device (and not to applications on the device).

+4
source share
1 answer

For two applications A and B, the device token will be the same for the ssl certificate of the sandbox, but it will change for the distribution profile (i.e. when using the production ssl certificate)

In addition, device tokens may change when updating the OS

I also developed a “provider”, and I prefer to store device tokens for each application. ie (APP_A => Token1; APP_B => Token1) Each time the device sends a registration request to the provider, check if there is a combination of APP and the device token in the table if you do not make a new insert.

This way, you don’t have to worry even if the device’s token changes for some reason.

+7
source

Source: https://habr.com/ru/post/1381959/


All Articles