0

I have a JSON formatted like this:

{
 "message":"something", 
 "data":{
         "id":"id",
         "name":"new name"
        }
}

With this format, in Xiaomi Mi4 device, I can process my action with onMessageReceived() in background state and foreground state.

But, in Oppo A71 device, I can process it only in foreground state.

I'm trying to send a notification from my Firebase console. And I get the same condition when my app is in background state for Oppo A71 device, I get no notification.

Why this happened? And how to solve it?

Matheus Lacerda
  • 5,983
  • 11
  • 29
  • 45
ikhwan aja
  • 105
  • 1
  • 7

1 Answers1

0

There is no fix for this, AT LEAST IN YOUR CODE!!! This is manufacture/OEM related issue. Certain device manufacturers modify the OS to terminate all the background services when the app is put in the background. They do it for various reasons ranging from battery saving to improved security and privacy. There will be option to allow certain app to run services in background. This option will be buried somewhere deep on settings app. Read this well written article for more information and see what developers can do about it link

Anoop
  • 993
  • 6
  • 16