APN BadDeviceToken iff运行开发版本 [英] APN BadDeviceToken iff running dev version
问题描述
我在处理应用程序时未收到推送通知,
并且 APN服务器返回"BadDeviceToken
" .
I'm not receiving Push Notifications to my app when I'm working on it,
and the APN server returns "BadDeviceToken
".
在这里我必须缺少一些简单的东西,这就是这种情况:
I've got to be missing something simple here, this is the situation :
-
当我向从App Store下载的应用程序发送推送通知时,它会起作用
When I send a Push Notification to my app downloaded from the App Store it works
当我从同一台服务器向同一版本(*)发送推送通知但使用Xcode构建时,APN服务器返回status: '400'
失败,并显示failed[0].response.reason: 'BadDeviceToken'
When I send a Push Notification from the same server, to the same version (*) of my app but built off Xcode, the APN server returns a status: '400'
fail with the failed[0].response.reason: 'BadDeviceToken'
(*)我说的是相同版本,代码是相同的,插件应该是相同的,但是我将Cordova iOS版本从4.x更改为3.x.
(*) I say the same version, the code is the same and the plugins should be the same, but I have changed Cordova iOS version down to 3.x, from 4.x.
我正在使用更新的推送通知"方法,其中在服务器上,我在服务器上只有一个.p8 APNs身份验证密钥.
服务器是使用 node-apn插件的节点代码.
客户端应用程序是Cordova,使用 Telerik推送插件.
I'm using the newer method of Push Notifications where on the server I just have a .p8 APNs Auth Key on the server.
The server is node code using the node-apn plugin.
The client app is Cordova, using the Telerik Push Plugin.
-
我尝试创建一个新的APNs Auth Key并将其上传到服务器;仍适用于该应用的App Store版本,并且APN在发送至该应用的本地版本时仍返回"BadDeviceToken".
I've tried creating a new APNs Auth Key and uploading that to the server; that still works on the App Store version of the app, and APN still returns "BadDeviceToken" when sending to my locally built version of the app.
在将推送发送到本地构建的应用程序之前,我曾尝试在服务器配置上为node-apn设置production: false
;我仍然收到"BadDeviceToken"错误.
I've tried setting production: false
on the server config for node-apn before sending the push to my locally built app; I still get the "BadDeviceToken" error.
Doing an extra hexadecimal encode to the token as per this question; result is that it still says "BadDeviceToken", though in that case it would actually be true.
将cordova-ios版本恢复到4.3.1;仍然得到"BadDeviceToken".
Bumping the cordova-ios version back up to 4.3.1; still getting "BadDeviceToken".
在构建时再次检查推送通知"功能是否启用
Double checking that the "Push Notifications" Capability is on when building
按照建议在此处进行发布版本而不是调试版本,并在此处
为什么显然不是这样的情况下,APN服务器为什么说BadDeviceToken
?
而且,我该如何解决?
Why is the APN server saying BadDeviceToken
when that is obviously not true?
And, how can I fix it?
推荐答案
删除该应用程序并重新安装(即从Xcode重新运行它)会提供一个新令牌,并且新令牌可以正常工作.
Deleting the app and reinstalling it (ie. re-running it from Xcode) gave a new token and the new token worked without complaint.
这篇关于APN BadDeviceToken iff运行开发版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!