4

I am currently developing an Android app which uses Firebase Messaging to receive notifications from the server.

It works fine on most of the devices but on some devices such as my Oneplus 3, when i restart the device and do not open my app after restart it starts missing notifications and when i open the app it only receives notifications sent after opening the app.

The following message shows in the logcat when i send notifications during the time when app is not opened after restart.

This is the message in the logcat:

W/GCM-DMM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.website.app (has extras) }

The same message is received in logcat when app is force closed.

I can request users not to force stop but how can i stop them from rebooting their device. Therefore I request a help from stackoverflow community in this context. Is there any way i can know that app has missed some messages while it was closed?

Anuj Bansal
  • 41
  • 1
  • 4

2 Answers2

1

Some devices have a vendor specific way of stopping apps that are not mainstream from being awakened by push notifications thereby not receiving in dead state.

Confirm if this is the case by looking for protected apps in that device and tap allow to start receiving push notifications in dead state.

Devices that I have encountered with this issues are:- Techno, Infinix Huawei e.t.c

kabangi julius
  • 2,709
  • 2
  • 16
  • 25
  • Yes, this is the case. The issue is with mostly Chinese mobile manufacturers such as Xiaomi, Oneplus, Huawei etc. But limitations like these are ruining the user experience as they do not receive important updates in the app. Google must do something to atleast deliver those messages whenever user restarts the app. All those messages are never delivered to the user when app has been stopped by the device. – Anuj Bansal Mar 12 '18 at 11:22
0

You may want to try this solution in this related SO post which is by defining enabled and exported with values set to true.

Here's the code given in the post:

<service
     android:name=".MyFirebaseMessagingService"
     android:enabled="true"
     android:exported="true">
     <intent-filter>
          <action android:name="com.google.firebase.MESSAGING_EVENT"/>
     </intent-filter>
</service>
Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22
  • Thanks Teyam for your response. This is not helping in my case. I am still getting the same message in the logcat. I think this problem is created by the manufacturer itself, in my case it is Oneplus. It does not start any services on phone reboot except prominent ones like whatsapp. – Anuj Bansal Jan 07 '17 at 16:01
  • This Message is shown when phone is rebooted in the logcat: `01-07 21:29:56.074 1371-1844/? D/OnePlusProcessManager: loadNPMConfigFiles: mPkgList[com.android.cts.net, com.android.cts.stub, com.android.cts.verifier, com.android.cts.permissiondeclareappcompat, ccom.leixun.nvshen, com.jianjian.clock, com.happyelements.AndroidAnimal, com.skype.raider, com.microsoft.office.lync15, com.whatsapp, com.viber.voip, jp.naver.line.android, com.linecorp.linelite, com.bsb.hike, com.Slack, com.google.android.apps.messaging, com.google.android.apps.tachyon]` – Anuj Bansal Jan 07 '17 at 16:02