I'm trying to build an app using Google Cloud Messaging.
I used the google gcm samples, with almost no modifications, and so far, I can send message between my client app and my personnal little php server. (no code problem here)
In samples, google let a sendRegistrationToServer()
method (click here) for me to write when InstanceId
is set, but I don't find any clue on the net about how to manage such things.
How should my database look like to handle users and tokens ?
(if someone could provide a little database structure example, it would make my day !)
Since tokens
register an app or a phone and users
a user (which imply a registration activity to get username and password, and I haven't made it yet), I kind of don't want to mix them in the same table,
but I might have misconceptions about the purpose of token.
For instance, I wonder why nobody seem to save the token in SharedPreferences...
EDIT : now I get the whole process :
- Registration Activity --> Register your user
- Send email adress and secured password to your server
- Connection Activity --> Connect your user
- Get a gcm_token and send it to your server and then map it with connection informations
This seems so simple and clear right now, but really didn't back then, so maybe it could help someone else...