Pergunta

So I have two activities: LoginActivity and HomeActivity. In the former the user introduces the usual information (username, email, password), so LoginActivity should be shown only the first time. After the registration is done, HomeActivity is always shown as the first activity.

Now, I'm getting the GCM registration id in the LoginActivity so that I can send to my server all the user information (username, email, password and gcmId) in one POST /users at the beginning. But I've read that I must check the version of my app to get the GCM registration id; if it has changed then I have to obtain a new gcm registration id.

So my question is, should I check (and sometimes, get) the GCM registration id in my HomeActivity whenever my app is opened and not in my LoginActivity?

Thanks (sorry for my English).

Foi útil?

Solução

Google recommend that you register again to GCM after a new version is installed. If you wish to follow this recommendation, and your login activity is not called when a new version is installed, that means you'll have to register from your other activity. Or the code in which you decide which activity to start in launch of app can check whether a new version was installed, and register to GCM if necessary.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top