“无效令牌";在生产环境中发送PushKit通知时 [英] "Invalid Token" while sending PushKit notification in production environment

查看:121
本文介绍了“无效令牌";在生产环境中发送PushKit通知时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过PushKit发送VoIP通知,但是在生产(分发)环境中,我从服务器获取无效令牌".

Im trying to send VoIP notifications via PushKit, but in Production(Distribution) environment, I get "Invalid Token" from server.

在具有相同证书和URL:ssl://gateway.sandbox.push.apple.com和端口:2195的开发环境中一切正常 但是当我将URL更改为:ssl://gateway.push.apple.com时,我收到"Invalid Token"错误,没有多余的数据

everything works fine in development env with same certificate and url:ssl://gateway.sandbox.push.apple.com with port:2195 but when i change the url to:ssl://gateway.push.apple.com, I get "Invalid Token" error with no extra data

推荐答案

您似乎在沙箱环境和生产环境中使用由客户端在沙箱环境中生成的相同Voip设备令牌.这就是您将获得无效令牌错误的原因.

Looks like you are using same Voip device token generated by Client in sandbox environment for both sandbox as well as production. That's the reason you will get invalid token error.

这将不起作用.如果要使用生产环境,则需要确保客户端/应用程序正在生产环境中创建设备令牌. (当服务器使用生产环境时,不能使用客户端使用沙箱生成的设备令牌)

This will not work. If you want to use production environment, you need to make sure your client/app is creating device token in production environment. (You can not use device token generated by client using Sandbox when your server is using production environment)

Pl.请注意,为同一设备上的同一应用程序/客户端的沙箱/生产环境生成了单独的设备令牌.希望对您有所帮助.

Pl. note separate device tokens are generated for sandbox/production environment for the same app/client on the same device. Hope it helps.

这篇关于“无效令牌";在生产环境中发送PushKit通知时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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