简体   繁体   English

基于令牌的 APNs 连接错误 400 BadDeviceToken | Apple 推送通知错误

[英]Token-Based Connection to APNs Error 400 BadDeviceToken | Apple Push Notification errors

we are planning to move to the new Token-Based Connection to APNs to send notifications.我们计划转移到新的基于令牌的连接到 APNs 以发送通知。 Apple Document. 苹果文档。

This supports sending notifications to multi apps under the same team id and irrespective of environment stage/prod.这支持向同一团队 ID 下的多个应用程序发送通知,而与环境阶段/产品无关。

But weirdly when try to send notif to device token of production app it's working.但奇怪的是,当尝试将通知发送到生产应用程序的设备令牌时,它正在工作。 whereas when I tried to send notif to stage app device token it failed with error 400 BadDeviceToken.而当我尝试将 notif 发送到暂存应用程序设备令牌时,它因错误 400 BadDeviceToken 而失败。

From the documentation, it mentions the following:从文档中,它提到了以下内容:

For security, APNs requires you to refresh your token regularly.为了安全起见,APNs 要求您定期刷新您的令牌。 Refresh your token no more than once every 20 minutes and no less than once every 60 minutes.不超过每 20 分钟刷新一次您的令牌,并且不低于每 60 分钟刷新一次。 APNs rejects any request whose token contains a timestamp that is more than one hour old. APNs 拒绝任何其令牌包含超过一小时的时间戳的请求。 Similarly, APNs reports an error if you recreate your tokens more than once every 20 minutes.同样,如果您每 20 分钟重新创建一次以上的令牌,APN 就会报告错误。

Are you refreshing your development token regularly?您是否定期刷新开发令牌? If yes, then try deleting the app from the device and reinstalling it from Xcode as mentioned in this LINK .如果是,则尝试从设备中删除该应用程序并按照此LINK 中所述从 Xcode 重新安装它。

Hope this helps fix your issue.希望这有助于解决您的问题。

Regards,问候,

AJ AJ

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM