In the apps world, uninstall is a very common phenomenon, especially in Android, where there are no checks before an app gets published.
So how do you find if a particular user has uninstalled 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 uninstalled.. (picked up from GCM docs)
- The end user uninstalls 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
- The GCM client informs the GCM server that the application was uninstalled.
- The GCM server marks the registration ID for deletion.
- The 3rd-party server sends a message to GCM.
- The GCM returns a
NotRegisterederror 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 “NotRegistered” error message, then the app has been uninstalled 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.
Though from my personal experience, GCM server doesn’t return the error message even the app has been uninstalled, at least for the first few days of uninstallation.My guess is that GCM server takes some time to update the information of app uninstallation.
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 uninstall category.
Identifying the uninstallation details can help you find some insights about the app if you can map user’s information with device information.