APN 设备令牌是否对每个单独的应用程序都是唯一的? [英] Is the APN Device Token unique to each individual app?

查看:29
本文介绍了APN 设备令牌是否对每个单独的应用程序都是唯一的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 iTunes 商店中有两个应用程序 - 都实现了推送通知.当我测试向这些生产应用发送通知时,我注意到针对应用 A 的推送被命名为并打开了应用 B.

I have two apps on the iTunes store - both implement push notifications. While I was testing sending notifications to these production apps, I noticed that a push intended for app A was titled and opened app B.

这两个应用都安装在同一部手机上.我查看了我的设备表,发现为两个应用程序列出的设备令牌(当然还有设备 ID)都是相同的.

Both of these apps are installed on the same phone. I looked in my device table and saw that the device Tokens (and of course, the Device ID) listed for the two apps were both the same.

根据要求,我在服务器上使用了两个不同的证书 - 每个应用程序一个.我有点假设设备令牌或证书会将消息路由到正确的应用程序,但显然不是.

As required, I am using two different certificates on the server - one for each app. I sort of assumed the device Token or certificate would route the message to the right app but clearly it isn't.

我可以在 NSLog 中看到每个应用程序发送的令牌确实相同.

I can see in NSLog that the tokens being sent from each app are indeed the same.

设备令牌是否应该对每个应用程序都是唯一的?如果是这样,知道我的测试手机如何将两个应用程序的相同设备令牌发送到我的服务器.请记住,这是来自当前应用商店中的两个应用程序.

Should the device Token be unique to each app? If so, any idea how my test phone could be sending the same device token for both apps to my server. Keep in mind this is from two apps currently on the app store.

感谢您的帮助!

推荐答案

注意:这是一个旧答案,仅适用于 iOS <= 6.请参阅 user1641761's answer 对当前的方法.

NOTE: this is an old answer that is true only for iOS <= 6. See user1641761's answer for the current approach.

想通了.设备令牌不是电话应用程序配对所独有的.它们仅适用于手机.如果您在同一部手机上有多个推送应用程序,它们都将使用相同的设备令牌.您用于发送通知的证书将决定它转到哪个应用程序.

Figured it out. The Device Tokens are NOT unique to the phone-app pairing. They are unique to the phone only. If you have multiple apps with push on the same phone they will all use the same Device Token. The certificate you use to send the notification will dictate which app it goes to.

这篇关于APN 设备令牌是否对每个单独的应用程序都是唯一的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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