“Invalid Token” while sending PushKit notification in production environment

时间秒杀一切 提交于 2019-12-11 14:31:36

问题


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

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


回答1:


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. note separate device tokens are generated for sandbox/production environment for the same app/client on the same device. Hope it helps.



来源:https://stackoverflow.com/questions/44860641/invalid-token-while-sending-pushkit-notification-in-production-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!