本文介绍了apns http2 api在卸载app后没有返回状态410的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用带有http2协议的apns来发送推送,我使用的代码类似于这篇文章:

Im using apns with http2 protocol for sending pushnotifications, the code i use is similar to this post:https://stackoverflow.com/a/34831873/1546652

当我的应用程序正确安装时,apns http2 api在发送消息时工作正常,我的响应是样式:
{response:,httpcode:200}

When my app is correctly installed the apns http2 api works ok while sending messages, my reponse is something of the style :{"response":"","httpcode":200}

问题是当我卸载应用程序并发送推送信息时无效的registrationId我没有收到状态410,也没有收到响应reason:Unregistered,仍然收到状态为200的真实回复。

The problem is that when i uninstall the app and send a pushnotification to the invalid registrationId i dont receive status 410 nor the response "reason:Unregistered" and still receive a true response with status 200.

我如何收到410状态和对应响应什么时候在apns http2中取消应用程序?

How can i receive 410 status and correspondig response when unistall the app in apns http2?

推荐答案

可能有所帮助,基本上

This technical note might be of help, basically

iOS将保持每个APNS环境(生产/沙盒)的一个套接字连接,当你从iOS删除应用程序时,如果它是给定环境的最后一个应用程序,它也会杀死该套接字连接,这会导致删除事件删除最后一个应用程序。

iOS will keep one socket connection per APNS environment (Production/ Sandbox) and when you delete the app from iOS, if its a last app for a given environment it kills that socket connection as well, which causes the deletion event to be dropped for that last app.

这通常发生在开发应用程序中。

This generally happens with development apps.

解决方案是在设备上安装虚拟应用程序,该设备注册APN并使用开发者身份进行签名,现在当您在开发期间从设备中删除真实应用程序时将保持与APNS的连接打开,导致应用程序删除被报告给APNS。

The solution is to keep a dummy app installed on a device which registers for APNs and is signed with developer identities, now when you delete your real app from device during development it will keep the connection to APNS open resulting in app deletion being reported to APNS.

此外,在我的测试中,我在删除应用程序之前经历了大约30-60分钟的延迟反映在APNS响应中。

Also, In my testing I have experienced delays around 30-60 mins before an app deletion is reflected in APNS Response.

这篇关于apns http2 api在卸载app后没有返回状态410的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 13:33