APN BadDeviceToken iff 运行开发版本 [英] APN BadDeviceToken iff running dev version

查看:29
本文介绍了APN BadDeviceToken iff 运行开发版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在处理应用程序时没有收到推送通知,
并且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 :

  1. 当我向从 App Store 下载的应用程序发送推送通知时,它可以正常工作

  1. 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 Push Plugin.

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.

根据 这个问题;结果是它仍然显示BadDeviceToken",尽管在这种情况下它实际上是真的.

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屋!

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