Question

In my app I run service, which load dynamic broadcast receiver. I register app on GoogleCloudMessagining, try send push messages from server via PHP - app get messages, makes notifications - everything working just fine. Then I go to eat my lanch - come back in a hour - try send push message and got error NotRegistered.. Then I register app again, and then thith new reg_id is no problem.. This situation continues over and over.. I have no canonic_id messages on result, were is no way to check registration_id valid or not, force registration process every hour seems not a very good idea, and still will be the problem: if no internet - no registration update - missing push messages.. Why registration expires so quikly? How fix this problem?

Was it helpful?

Solution

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.., and i hope app will not unregistered in hour..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top