简体   繁体   English

使用某些令牌发送后,Apple推送通知无法在生产中使用

[英]Apple push notification not working in production after send using some tokens

I'm totally stuck, please help. 我完全被困住了,请帮忙。

I have two devices for testing. 我有两个要测试的设备。 When i build and run app with xcode on this devices i got two device tokens which i successfully used to send notifications through sandbox server. 当我在此设备上使用xcode构建和运行应用程序时,我得到了两个设备令牌,这些令牌已成功用于通过沙盒服务器发送通知。

When i tried to test production certificate with Ad Hoc provisioning profile(i uploaded build on TestFlight), i had two NEW tokens which i also successfully used to send notifications through release server. 当我尝试使用临时供应配置文件(我在TestFlight上上传了构建文件)测试生产证书时,我有两个新令牌,这些令牌也成功用于通过发布服务器发送通知。

BUT! 但! If i have, for example, 4 tokens, 2 of which is for dev provisioning profile and 2 for Ad Hoc and send first using dev tokens and THEN Ad Hoc tokens through release server notifications don't appear... 例如,如果我有4个令牌,其中2个用于开发人员配置文件,另外2个用于Ad hoc,并且首先使用dev令牌和THEN Ad Hoc令牌通过发布服务器通知发送...

Even if i have 1 token dev token and many Ad Hoc tokens, notifications which were sent after this 1 dev token is not appear. 即使我有1个令牌dev令牌和许多临时令牌,在此1个dev令牌之后发送的通知也不会出现。

Is this how APNS work or i've missed something? 这是APNS的工作方式,还是我错过了什么?

Also sorry for my english! 也为我的英语感到抱歉!

You can't mix production tokens and sandbox tokens. 您不能混合使用生产令牌和沙箱令牌。 The former only work with production certificate when connecting to production APNS server, and the latter only work with sandbox certificate when connecting to sandbox APNS server. 前者仅在连接到生产APNS服务器时才使用生产证书,而后者仅在连接到沙盒APNS服务器时才使用沙盒证书。

Sending a token to the wrong APNS server would close the connection and any following messages will be discarded. 将令牌发送到错误的APNS服务器将关闭连接,并且随后的任何消息都将被丢弃。

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

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