1

Push notification is not showing when the app is closed(i.e,not present in foreground or background) Getting the following error code in log

 W/BroadcastQueue: Reject to launch app com.nexhop.dev.debug/10129 for broadcast: App Op 63
W/GCM-DMM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000000 pkg=com.nexhop.dev.debug (has extras) }

But the notification is showing few phones like samsung galaxy. I am using FCM for sending notification.

Please give any suggestion to fix this issue?

thanks

Vamsi Abbineni
  • 479
  • 3
  • 7
  • 23
tinto mathew
  • 216
  • 4
  • 22

2 Answers2

0

Could it be the WAKE_LOCK permission is not defined? Make sure you have all the permissions implemented for push notifications

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<permission
    android:name="${applicationId}.permission.C2D_MESSAGE"
    android:protectionLevel="signature"/>
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
MrJM
  • 1,214
  • 1
  • 12
  • 26
0

When the app is closed forcelly by the user : notifications don't arrive

It's a feature of the Android platform. Force stopping an application by the user puts the application in a stopped state and none of its code is run, including any broadcast receivers declared in manifest. Only when the user explicitly launches the app it is put in a state where the receivers get fired.

Thread@laalto

Upate:

can be possible solution you can hide your app from recent so your cant swipe it and your app will be able to receive the notification.

Community
  • 1
  • 1
Sohail Zahid
  • 8,099
  • 2
  • 25
  • 41