0

I know there might be many questions like my question. But It is different. Actually, I am making a static chart that will show how many devices currently having my Android app installed and how many devices have uninstalled it.

For this, I am creating a uniqueID when the app is installed on a device and saving uniqueID along with FCM token to SQL database on the server.

To Create uniqueID:

uniqueID = UUID.randomUUID().toString()

Now, while I am saving every device with a token and uniqueID to the database. Of course, the device will be considered to have active app installation even when uninstalled the app.

So, I want to add a field in the database as inactive against the device that has uninstalled the app. To achieve this, I am thinking to send a request to the database and update the information when the app uninstallation is triggered.

Is this possible? And if yes, then can anyone please tell me how. Or are there any other method to achieve this. Thanks in advance.

Strange
  • 310
  • 5
  • 20

3 Answers3

2

Yes it it possible. You can send a push notification to your app to all your active users everyday from your backend side, and on your Android side, call an API on your server to confirm that you exist. If a client does not confirm his existence in a period of time (like 3 days), you know they have uninstalled the app. This is what Adjust and other statistics do for uninstall statistics.

Adib Faramarzi
  • 3,798
  • 3
  • 29
  • 44
  • It could be done but say if someone doesn't use his phone for a few days (like 5 days) and I update it to be uninstalled in 3 days. Then the report will not be correct. – Strange Feb 09 '19 at 11:39
  • Your service should be alive in the background (background service) so it is not bound to the visuals of the app, so when the user is not using it, it can still send the acks to the server. – Adib Faramarzi Feb 09 '19 at 11:42
  • by (if someone doesn't use his phone) I actually mean that if phone is in dead state – Strange Feb 09 '19 at 11:43
  • 1
    Yes in that case there is nothing you could do about your data. But what you can do is when they turn on the phone, they send their ack to the server and server can re-activate them. – Adib Faramarzi Feb 09 '19 at 11:47
0

You can't easily run your own code when an app is uninstalled. It is possible to run code in another app, but that requires that you get the user to install both apps.

In addition to the approach Adib described, you can consider using Google Analytics for Firebase to detect uninstalls of your app by Android users. As shown in the answer to this question, Firebase automatically tracks uninstalls in that case.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
0

Maybe you want to use Firebase Analytics and the event app_remove. Mark it as a conversion and use Functions to remove the user from your Firebase Project(if anonymous) and/or any other data associated with the user(Storage, Database, Firestore, etc.) or anything else you might want to do upon user removal of the app.

Guanaco Devs
  • 1,822
  • 2
  • 21
  • 38