FAQ
Hi,

we have a working GCM app, which has to re-register itself every time it
receives a push message. Is this the expected behaviour? If the
registration process is not repeated as soon as the "unregistered" intent
is received, the app continues to receive messages for another hour or so.
After that push messages are no longer received.

Here is a snippet from the used broadcast receiver:

@Override

*public* *void* onReceive(Context context, Intent intent) {

Log.*i*(MessageReceivingService.*class*.getSimpleName(),

"BroadcastReceiver :: Received action - "

+ intent.getAction());

*if* ("com.google.android.c2dm.intent.REGISTRATION".equals(intent

.getAction())) {

*final* String registrationId = intent.getExtras().getString(

"registration_id");

updateRegistrationId(registrationId);

*return*;

}


  *final* String message = *parseMessage*(context, intent);

*if* (message != *null*) {

*if* (!MainActivity.*inBackground*) {

sendToApp(message);

} *else* {

saveToLog(message);

}

}

}


Any ideas?

--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm+unsubscribe@googlegroups.com.
To post to this group, send email to android-gcm@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/e07ff0d9-ec27-4835-9558-6c9892822ade%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Kerya Bang at May 12, 2014 at 5:42 am
    Hi. I got the same problem, i've don't find any answer on web. But i have
    idea: i use PHP script to send messages from html page, maybe GCM send
    "unregister" intent becouse don't see any constant GCM server, no getting
    some required feedback???

    --
    You received this message because you are subscribed to the Google Groups "android-gcm" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm+unsubscribe@googlegroups.com.
    To post to this group, send email to android-gcm@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/0e97332e-980d-4d43-ba6a-b779d1bfb628%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Kerya Bang at May 12, 2014 at 6:43 am

    On Monday, 12 May 2014 08:42:37 UTC+3, Kerya Bang wrote:
    Hi. I got the same problem, i've don't find any answer on web. But i have
    idea: i use PHP script to send messages from html page, maybe GCM send
    "unregister" intent becouse don't see any constant GCM server, no getting
    some required feedback???
    --- OK, seems i find answer..

    in my upp i register GCMbroadcastReceiver dinamically, from the code. But
    in GCM manual find this:

    *Unregistered Device*An existing registration ID may cease to be valid in a
    number of scenarios, including:

        - If the application manually unregisters by issuing a
        com.google.android.c2dm.intent.UNREGISTER intent.
        - If the application is automatically unregistered, which can happen
        (but is not guaranteed) if the user uninstalls the application.
        - If the registration ID expires. Google might decide to refresh
        registration IDs.
        - If the application is updated but the new version does not have a
        broadcast receiver configured to receive
        com.google.android.c2dm.intent.RECEIVE intents.

    The last one - it's my situation, my app manifest dot't have requaried
    receiver, ant becouse app get "unregister" intent.

    I change app, put receiver in manifest - and now is not receive
    "unregister" intent after "PECEIVE" intent..



    --
    You received this message because you are subscribed to the Google Groups "android-gcm" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm+unsubscribe@googlegroups.com.
    To post to this group, send email to android-gcm@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/4330751c-9f74-4e6e-8f78-781063a87fef%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupandroid-gcm @
categoriesandroid
postedMay 8, '14 at 8:58a
activeMay 12, '14 at 6:43a
posts3
users2
websitedeveloper.android.com...

2 users in discussion

Kerya Bang: 2 posts Todor Dimitrov: 1 post

People

Translate

site design / logo © 2019 Grokbase