Device Tocken will Change after install from diawi or TestFlight? So Push notification is not coming

后端 未结 2 762
有刺的猬
有刺的猬 2021-02-06 19:04

I\'m currently creating an app that needs to receive push notifications from a server.

When I got the device token, I send it to my server and save it into DB,

M

2条回答
  •  抹茶落季
    2021-02-06 20:03

    When you install your app on the device via XCode it will run in development (sandbox) configuration. You will receive development token and you need to issue push notification via ssl://gateway.sandbox.push.apple.com:2195 (using development certificate).

    However: when you install your app via TestFlight your app is compiled (an run) in distribution (production) mode: production token is not the same as development token. It is also not enough to simply use this new (production) token. Push notification has to be issued via ssl://gateway.push.apple.com:2195 (using production certificate) in this case.

提交回复
热议问题