设备令牌苹果推送通知供应商 [英] device tokens for Apple Push Notifications provider

查看:107
本文介绍了设备令牌苹果推送通知供应商的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我为多个 iOS应用程序,我可以使用多个应用程序相同的设备令牌的苹果推送通知提供者?我知道,我需要为每个应用程序的唯一SSL证书。但我困惑的设备令牌。

If I'm an Apple Push Notification "provider" for multiple iOS apps can I use the same device token for multiple apps? I'm aware that I need unique SSL certificates for each app. However I'm confused about the device tokens.

示例:我有两个应用程序A和B.我想为这两个应用提供推送通知。说我收集了设备令牌牛逼从谁安装的应用程序A.假设我有两个应用独特的SSL证书的用户。当同一用户安装的应用程序B I可以重新利用作为应用b。提供推送通知,当令牌T'

Example: I have two apps A and B. I want to provide push notifications for both apps. Say I collect a device token T from a user who installs app A. Assume I have unique SSL certificates for both apps. When the same user installs app B can I re-use token T when providing push notifications for app B?

更多信息:后重新读<一个href=\"http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html\"相对=nofollow>苹果的文档它仍然不明确。本段特别似乎暗示设备标记可以被重新使用:

More info: After re-reading Apple's docs it's still not clear. This paragraph in particular seems to imply the device token can be re-used:

这提供者发送到的APN用于递送到设备的每个通知必须通过它从该设备上的应用程序获得的设备令牌陪同。的APN解密使用记号密钥令牌,从而确保该通知是有效的。然后,它使用包含在设备令牌的设备ID来确定该通知目标设备

Every notification that a provider sends to APNs for delivery to a device must be accompanied by the device token it obtained from an application on that device. APNs decrypts the token using the token key, thereby ensuring that the notification is valid. It then uses the device ID contained in the device token to determine the destination device for the notification.

注意:听起来载/ bundleID为每个应用提供者的SSL证书中指示通知到设备上的特定的应用程序的主题。因此,它似乎是合理的设备令牌(在设备上的应用程序,而不是)的设备是唯一的。

Note: Sounds like the "topic"/bundleID contained in the provider's SSL certificate for each app directs the notifications to a particular app on a device. So it seems plausible that device tokens are unique for a device (and not for apps on the device).

推荐答案

有关的两个应用程序A和B设备令牌将成为沙箱SSL证书相同,但它会为分配模式变化(即使用生产SSL证书时)

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

此外,当您升级操作系统的设备令牌可能会更改

Also, the device tokens might change when you upgrade the OS

我也已经制定了供应商,我preFER每个APP STORE设备令牌。
即(APP_A => TOKEN1; APP_B => TOKEN1)
每当一个设备发送注册请求提供商,检查APP和设备令牌的组合在表中存在,如果不是做一个新的插入。

I too have developed a "provider" and I prefer to store device tokens per app. i.e (APP_A => Token1; APP_B => Token1) Everytime a device sends a registration request to the provider, check if the combination of the APP and device token exists in the table, if not do a new insert.

这样,您就不必担心,即使由于某种原因,设备令牌的变化。

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

这篇关于设备令牌苹果推送通知供应商的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆