Is it possible to detect Android app uninstall?

后端 未结 7 947
清酒与你
清酒与你 2020-11-22 11:18

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 sto

7条回答
  •  不要未来只要你来
    2020-11-22 12:01

    Google C2DM service is working in passive mode when it comes to detecting uninstalled applications.

    First push notification after uninstalling your application (without unregistering from C2DM!!!) will NOT return any error in response. However, the second push notification will return an "invalid registration" or "not registered" error codes where you can realize the application was uninstalled.

    The reason is that C2DM servers return the response code immediately and only then tries to push the client. When client respond that an application was uninstalled, it is deleted from C2DM servers. Next push attempt will return an error code immediately.

提交回复
热议问题