4

i have a question and don't seem to find the solution. I have a game like Draw Something. So users have to authorize my app to access it. I save the userid of all the users in a mysql database.

To generate a new game, i pick a random userid from my database. The problem is that i want to know which user is still using my app.

It happens that several users install your app, login to facebook, they are saved in my database but after a while they uninstall the app. If someone then generates a random game it is quite possible he has to play to an ex-user of my app (a user who has already uninstalled my app).

Is there anyway to know the still active users of an app? I know that if the user de-authorizes your app, we can check it with is_app_user but that is not what i'm looking after. Users seldomly de-authorize apps imo.

Right now, i'm just doing the check by selecting random users who have : 1) registered between now - 7 days 2) last opened the app between now - 7 days

but still, this isn't an elegant solution.

If someone knows a solution, i would also use it to clean my db (deleting all inactive users).

Thanks for you input!

Verthosa
  • 1,671
  • 1
  • 15
  • 37

2 Answers2

1

Taking advantage of GCM might work

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

In this document:

When users uninstall an application, it is not automatically unregistered on GCM. It is only unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled. At that point, you server should mark the device as unregistered (the server will receive a NotRegistered error).

Julian Shen
  • 151
  • 3
0

One way you could do this was to have a service that runs once in a while telling you that the app is still installed for x user.

But why don't you just only use active users and completely ignore inactive users? Whenever a new game is to be created find a player and if no contact can be achieved the user is not present and you'll have to find a new player.

Warpzit
  • 27,966
  • 19
  • 103
  • 155
  • Hey, thanks for your reply. It's not an option of just selecting 'present' people. It's not that i only want users who have the app running to play. A game is made by one user and then, when the other users opens his app, he gets a notification of a new pending game. So the problem is that i can't distinct active and unactive users. – Verthosa Sep 04 '12 at 09:39
  • Couldn't you just check if you can connect to the user and if not don't count the game as active? – Warpzit Sep 04 '12 at 15:42