Android sdk facebook how to find out when a user no longer uses your application

I have a question and do not seem to find a solution. I have a game like Draw Something. Therefore, users need to authorize my application to access it. I save the user id of all users in the mysql database.

To create a new game, I select a random user ID from my database. The problem is that I want to know which user is still using my application.

It happens that several users install your application, go to facebook, they are saved in my database, but after a while they delete the application. If someone then generates a random game, it is quite possible that he should play with a former user of my application (a user who has already uninstalled my application).

Can I still recognize the active users of the application? I know that if the user cancels the authorization of your application, we can check it with is_app_user, but this is not what I need. Users rarely refuse to authorize imo applications.

Now I just check, choosing random users who have: 1) registered between 7 days 2) last time opened the application between 7 days

but still this is not an elegant solution.

If someone knows the solution, I will also use it to clear my db (delete all inactive users).

Thanks for entering!

+4
source share
2 answers

Using GCM may work

http://developer.android.com/guide/google/gcm/gcm.html

In this document:

When users delete an application, it does not automatically register with GCM. It is only unregistered when the GCM server tries to send a message to the device, and the device responds that the application has been deleted. At this point, the server should mark the device as unregistered (the server will receive a NotRegistered error).

+1
source

One way to do this is to have a service that occasionally tells you that the application is still installed for user x.

But why don't you just use active users and completely ignore inactive users? Whenever a new game needs to be created, find a player and if contact cannot be reached, the user will not be present and you will need to find a new player.

0
source

Source: https://habr.com/ru/post/1432036/


All Articles