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

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

问题描述

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

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

在具有相同证书和网址的开发环境中一切正常:ssl://gateway.sandbox.push.apple.com 端口:2195但是当我将 url 更改为:ssl://gateway.push.apple.com 时,我收到无效令牌"错误,没有额外数据

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.

这行不通.如果您想使用生产环境,您需要确保您的客户端/应用程序正在生产环境中创建设备令牌.(当您的服务器使用生产环境时,您不能使用客户端使用 Sandbox 生成的设备令牌)

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天全站免登陆