So how do you find if a particular user has UN-installed your application, a quick answer is GCM.
Lets look at what happens when you send a push to a device where your application has been UN-installed.. (picked up from GCM docs)
- The end user un-installs the application.
- Your server sends a message to GCM server.
- The GCM server sends the message to the device.
- The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns false.
- The GCM client informs the GCM server that the application was UN-installed.
- The GCM server marks the registration ID for deletion.
- The 3rd-party server sends a message to GCM.
- The GCM returns a NotRegistered error message to your server.
- Your server should delete the registration ID.
So from the above steps, it’s easy to understand that if your server gets “Not Registered” error message, then the app has been UN-installed on the user’s device. So all you need to do is, send a silent push to your application, to check if it exists on user’s device.
But GCM server doesn’t return the error message even the app has been UN-installed, at least for the first few days of UN-installation.My guess is that GCM server takes some time to update the information of app UN-installation.
A more accurate approach will be to receive an ack from the application for the push message, So, if you receive an ack then the app still exists, if you don’t then the app doesn’t exist on the user’s device. But, there is a catch here, what if the app exists on the user’s device but the message is not delivered because the user isn’t connected with INTERNET. How long will you wait to receive the ack, here is where your conscience comes to the rescue, you have to decide the time you will wait for the ack and decide if the app exists on user’s device. If your app is dependent on INTERNET for the app usage and you don’t receive an ack with in 3-4 days, it’s safe to assume the user is useless to you whether he has the app or not, you can safely put him under UN-install category.
Identifying the uninstallation details can help you find some insights about the app if you can map user’s information with device information.