如何在 iOS 中卸载我们的应用程序时收到通知 [英] How to get notified when our app is uninstalled in iOS

查看:55
本文介绍了如何在 iOS 中卸载我们的应用程序时收到通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一款 iPhone 应用程序,当目标用户安装了我们的应用程序时,它允许用户通过 Apple 推送通知服务向他人发送消息,或者在没有安装我们的应用程序时通过 SMS 向他人发送消息.

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.

我们希望在卸载应用程序时立即收到通知,以便我们决定如何将消息发送给目标用户.

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.

我们发现APNS反馈服务器有很长的延迟,不符合我们的要求.所以我们换一种方式:当我们的服务器记录到目标用户安装了我们的应用程序时,我们通过APNS向他发送消息,如果他在30分钟内没有阅读消息,我们认为他已经卸载了应用程序,所以我们发送通过短信发送消息.

We find the APNS feedback server have a long time delay that doesn't agree with our requirement. 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.

有没有更好的方法?

推荐答案

正如 Oleg 所说,没有办法准确检测您的应用是否被卸载.

As Oleg said, there is no way to accurately detect if your app was uninstalled.

APNS 反馈服务会为其无法传递的消息返回时间戳和推送令牌.有时,这表示卸载,但也可以简单地表示用户当时处于离线状态.反馈服务确实有一些滞后,因此不能用于时间敏感的情报收集.

The APNS feedback service returns a timestamp and a push token for messages it was not able to deliver. 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.

一个对您可能有用也可能不起作用的建议是,当您发送短信时,在您的应用中包含一个链接(通过 url 处理程序).如果用户返回到您的应用程序是有意义的,单击该链接应该会启动该应用程序,并且如果您进行简单的调用,您将在服务器上进行跟踪.但是,如果在发送 SMS 后未检测到用户重新访问应用程序,则很有可能应用程序确实已被卸载或用户离线时间异常长,这可能需要其他类型的采取行动.

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.

这篇关于如何在 iOS 中卸载我们的应用程序时收到通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆