after 'Force stop', no more notifications and broadcast intent callback: result=CANCELLED

11,678 views
Skip to first unread message

iamyellow

unread,
Aug 1, 2012, 2:25:38 PM8/1/12
to andro...@googlegroups.com
Hi all!

I got GCM working perfectly in my app, BUT when I 'force stop' it -from Settings / Apps-, no way... there won't be more notifications. This happen starting with ICS, not with > 2.2 < 3.X. In DDMS I can see the following log after send a message from my server:

08-01 18:54:25.435: W/GTalkService(562): [DataMsgMgr] broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=net.iamyellow.gcmdemo (has extras) }
08-01 18:54:25.454: W/GTalkService(562): Receiver package not found, unregister application net.iamyellow.gcmdemo sender 273995793176

I have to re-register the service in order to keep receiving notifications.

Did anybody now if this behavior is suposed to be the expected? I can see the same is happening with Whatsapp, so I guess maybe I'm not doing something wrong...

Thanks for your time.

francesco nerieri

unread,
Aug 1, 2012, 6:31:08 PM8/1/12
to andro...@googlegroups.com
What service are you 'force stopping'?
> --
> You received this message because you are subscribed to the Google Groups
> "android-gcm" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-gcm...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-gcm/-/6O4TdU1pm0UJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
---
https://plus.google.com/u/0/104524825852741167674

iamyellow

unread,
Aug 2, 2012, 1:19:24 AM8/2/12
to andro...@googlegroups.com
Not a service, the application itself. It's because of this:
http://developer.android.com/about/versions/android-3.1.html#launchcontrols

So, I'm afraid this is an expected behavior. Also I cannot flag the intent with FLAG_INCLUDE_STOPPED_PACKAGES because it's thrown by the OS.

Now it seems like GCM is unregistering devices after the force stop command...

francesco nerieri

unread,
Aug 2, 2012, 6:50:40 PM8/2/12
to andro...@googlegroups.com
So if you force stop the app, the intended behavior for ICS is for the
app to not receive the message.
In JB this means that GCM will also unregister the app, this is an
unfortunate behavior and we are working to change this (the unregister
part in JB).

Hth,
f
> --
> You received this message because you are subscribed to the Google Groups "android-gcm" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-gcm...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msg/android-gcm/-/8d2AS6__xnsJ.

iamyellow

unread,
Aug 3, 2012, 6:43:40 AM8/3/12
to andro...@googlegroups.com
thanks Francesco!


On Friday, August 3, 2012 12:50:40 AM UTC+2, Francesco Nerieri wrote:
So if you force stop the app, the intended behavior for ICS is for the
app to not receive the message.
In JB this means that GCM will also unregister the app, this is an
unfortunate behavior and we are working to change this (the unregister
part in JB).

Hth,
  f

On 1 August 2012 22:19, iamyellow <jo...@iamyellow.net> wrote:
> Not a service, the application itself. It's because of this:
> http://developer.android.com/about/versions/android-3.1.html#launchcontrols
>
> So, I'm afraid this is an expected behavior. Also I cannot flag the intent with FLAG_INCLUDE_STOPPED_PACKAGES because it's thrown by the OS.
>
> Now it seems like GCM is unregistering devices after the force stop command...
>
> --
> You received this message because you are subscribed to the Google Groups "android-gcm" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-gcm+unsubscribe@googlegroups.com.

nasif

unread,
Aug 29, 2012, 2:57:19 AM8/29/12
to android-gcm
any updates on this, am not receiving push on any ICS android device
when app is not running either in forground or background or
forcestopping the app

thanks

On Aug 2, 3:31 am, francesco nerieri <francesco.neri...@gmail.com>
wrote:

Mark Murphy

unread,
Aug 29, 2012, 7:16:21 AM8/29/12
to andro...@googlegroups.com
On Wed, Aug 29, 2012 at 2:57 AM, nasif <nas...@gmail.com> wrote:
> any updates on this, am not receiving push on any ICS android device
> when app is not running either in forground or background or
> forcestopping the app

If the use force-stops your app from Settings, then nothing in your
app will run again automatically. This includes the GCM
BroadcastReceiver. Only after something manually runs one of your
components (e.g., user launches an activity from the home screen) will
your receivers work again.

Do not give the user a reason to want to force-stop your app.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in NYC: http://marakana.com/training/android/
Reply all
Reply to author
Forward
0 new messages