Not receiving any notification from FCM Firebase cloud messaging when application is swiped from recent application list in OnePlus 3 [duplicate]

爷,独闯天下 提交于 2020-01-10 03:04:30

问题


I'm using OnePlus 3 (7.1.1) There is one problem of not receiving notification when application is swiped from recent task (becomes dead) and then after if I push a notification from Firebase console, it won't receive any notification.

Any solution? Same bugs are on with vivo, oppo, huwai, xiomi, redimi, MI

And the same code works fine with Sony, Samsung moto.!


回答1:


You need to whitelist your app in the one plus settings. Chinese manufacturers block apps from running in the background. You would face a simillar situation in Xiaomi, Vivo, gionee, Oppo etc.

As for Xiomi ...go the security app ..auto start and allow your app to run in the background. This is a device specific thing and there is no code solution to it. You have to manually enable it. Hope it helps!




回答2:


Yes If you use any Xiaomi phone you have to enable the app to run in the background. -To Enable go to setting>Permisssions>autostart and select your app. and enable to autostart.




回答3:


Four things need to check to receive notification

  1. Auto Restart mode must be turn ON
  2. Background data
  3. Low Power Mode(Battar Saving mode)
  4. App's Notification Setting

vivo, oppo, huwai, xiomi, Redmi, MI all are Chinese vendors they customize stock android and blocks Auto Restart, Running in background mode.

For oppo I have fixed by implementing below steps

You can go to SECURITY CENTRE - PRIVATE PERMISSION - STARTUP MANAGER - add App to the STARTUP APPS ALLOWED

Go to SETTING - ADDITIONAL SETTING - APPLICATION MANAGEMENT - AUTOMATIC CLEANING -TURN OFF AUTOMATIC CLEANING

Go to SETTING - BATTERY - OTHERS - choose the app that you want to keep notification - turn off FREEZE BACKGROUND APPS

SETTING - NOTIFICATION AND STATUS BAR - MANAGEMENT NOTIFICATION - choose the apps - turn on PRIORITY NOTIFICATION

SETTING - BATTERY->Low Power Mode turn Off



来源:https://stackoverflow.com/questions/45602194/not-receiving-any-notification-from-fcm-firebase-cloud-messaging-when-applicatio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!