新GCM如何处理APNS反馈?

时间:2015-06-24 10:33:27

标签: ios google-cloud-messaging

我正在尝试使用新的GCM功能向iOS设备发送通知。除反馈信息外,一切都很顺利。我假设GCM通过APNS发送消息后,GCM也会调用APNS的反馈服务来获取无效令牌。下次当我们对GCM使用相同的设备令牌时,它应该响应错误消息。我在卸载应用程序后尝试了几次,但从未收到过来自GCM的错误消息。每次显示成功消息。这里出了什么问题?

注意:如果您不熟悉新的GCM功能,请不要盲目回答。

2 个答案:

答案 0 :(得分:2)

I think the problem here is with the environment. I am using developer certificate to test the notification. APNS may not be giving any details for developer environment. Hope it will work in production.

Updates


Support from Google gave following details.

We did some digging, it seems that is how things are being handled by APNS:

  • When last sandbox app is removed from the device, device disconnects from APNS sandbox and not able to receive pushes/provide feedback anymore. Thus, APNS feedback doesn't register that the device has been uninstalled.
  • If you install another push-enabled sandbox app on the device, which would force device connection to APNS again. And we checked that under this circumstance, we get notified that the device has been uninstalled and return NotRegistered to our client.

答案 1 :(得分:0)

APNS feedback service is not instantaneous. GCM does poll APNS feedback service but in my experience it was a bit delayed (not sure if it was APNS's delay or GCM's delay).

You should wait for some time and then try to use an old registration token and you should see a "Invalid Registration Token" error.