是否有可能发现Android应用程序卸载? [英] Is it possible to detect Android app uninstall?

查看:110
本文介绍了是否有可能发现Android应用程序卸载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序正在使用谷歌的C2DM(推送通知),通知有关从朋友的新活动的用户。一旦安装该软件,我注册设备与C2DM服务器和存储用户的电话号码。所以我知道用户正在使用我的应用程序,我可以送他/她的推送通知。但是,会发生什么,如果用户卸载我的应用程序,是有办法抓住它在我的应用程序?或者,唯一的办法就是抓住我的服务器上的一个错误,当我发送C2DM和它的不可到达,则标记用户为不活动?

My app is using Google's C2DM (push notification) to notify users about new activity from friends. Once they install the app i register the device with C2DM servers and store user's phone number. So i know that the user is using my app and i can send him/her the push notifications. But what happens if users uninstalls my app, is there a way to catch it in my app? Or the only way is to catch an error on my server when i send a C2DM and it's unreachable, then mark a user as inactive?

我很想来通知他们的朋友正在使用的应用程序的用户,当他们不再做。

I would love to notify users when their friends are using an app and when they no longer do.

什么是这种情况的最佳解决方案?

What's is the best solution for this scenario?

推荐答案

不幸的是,ACTION_PACKAGE_REMOVED意图将分差缩小到所有的接收器,除了你自己。这证实了<一href="http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_REMOVED">here.请注意,已安装应该说删除,并在他们的部分错字。

Unfortunately the ACTION_PACKAGE_REMOVED intent will be sent out to all receivers except for your own. This is confirmed here. Note that "installed" should say "removed" and is a typo on their part.

你的C2DM计划的一些问题,因为我不是很熟悉。如果用户刚刚离开他们的设备关闭了很长一段时间,会触发使用错误情况?如何C2DM实际报告一个无法访问的设备?那是只发生条件时,它会试图发送推送通知和失败,或者是当它在某种程度上决定了它到达设备,但未能得到妥善处理?显然,在第二种情况下你的计划会的工作,但我可以看到一些误报发生的除外。

Some questions for your C2DM plan, since I'm not very familiar with it. If the user just leaves their device off for a long period of time, will that trigger the error condition you use? How does C2DM actually report an "unreachable" device? Is that a condition that only occurs when it attempts to send the push notification and fails or is it when it somehow determines it reaches the device but fails to be handled properly? Obviously in the second scenario your plan would work, but I can see some "false positives" occurring otherwise.

较早的SO问题,以供参考:<一href="http://stackoverflow.com/questions/3648166/android-not-receiving-intent-action-package-removed-in-the-removed-package">android不接受意向ACTION_PACKAGE_REMOVED在去除包装

Older SO question for reference: android not receiving Intent ACTION_PACKAGE_REMOVED in the removed package

这篇关于是否有可能发现Android应用程序卸载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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