简体   繁体   English

如何在iOS中卸载我们的应用程序时收到通知

[英]How to get notified when our app is uninstalled in iOS

We are developing an iPhone application that allow users to send messages to others via Apple Push Notification Service when the target user have installed our application or SMS when haven't. 我们正在开发一个iPhone应用程序,允许用户在目标用户安装我们的应用程序时通过Apple推送通知服务向他人发送消息,或者在没有安装我们的应用程

We want to get notified immediately when our app is uninstalled so that we can decide how to send the message to the target user. 我们希望在卸载我们的应用程序时立即收到通知,以便我们决定如何将消息发送给目标用户。

We find the APNS feedback server have a long time delay that doesn't agree with our requirement. 我们发现APNS反馈服务器有很长的时间延迟,不符合我们的要求。 So we use another way: when our server recorded the target user have installed our application, we send him message via APNS, if he haven't read the message in 30 minutes, we believe that he has uninstalled the application, so we send the message via SMS. 所以我们用另一种方式:当我们的服务器记录了目标用户已经安装了我们的应用程序时,我们通过APNS向他发送消息,如果他在30分钟内没有阅读该消息,我们认为他已经卸载了该应用程序,所以我们发送了消息通过短信。

Is there any way better? 有没有更好的方法?

As Oleg said, there is no way to accurately detect if your app was uninstalled. 正如奥列格所说,没有办法准确地检测你的应用程序是否已卸载。

The APNS feedback service returns a timestamp and a push token for messages it was not able to deliver. APNS反馈服务为其无法传递的消息返回时间戳和推送令牌。 Sometimes, this indicates an uninstallation but it can also simply indicate a user that was simply offline at that moment. 有时,这表示卸载,但它也可以简单地指示当时仅处于脱机状态的用户。 The Feedback service does have some lag so can not be used for time-sensitive intel gathering. 反馈服务确实有一些滞后,因此不能用于时间敏感的英特尔收集。

Based on your requirements, I'd say you're doing it right. 根据您的要求,我会说你做得对。

One suggestion that may or may not work for you would be to include a link (via url handler) to your app when you resort to sending an SMS. 可能会或可能不适合您的一个建议是当您使用发送短信时,在您的应用中包含一个链接(通过网址处理程序)。 If it makes sense for the user to return to your app, clicking on that link should launch the app and you'll have a trace on your server if you make a simple call. 如果用户返回您的应用程序是有意义的,点击该链接应该启动该应用程序,如果您进行简单的通话,您将在服务器上找到跟踪。 If, however, after sending the SMS the user is not detected as coming back into the app, chances are highly likely that the app was indeed uninstalled or that the user is offline for an unusually long amount of time which may require some other type of action on your part. 但是,如果在发送短信后没有检测到用户回到应用程序中,则很可能确实卸载了应用程序,或者用户在非常长的时间内处于脱机状态,这可能需要其他类型的你的行动。

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

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