Firebase(FCM) notifications not coming when android app removed from recent tray

后端 未结 3 1472
囚心锁ツ
囚心锁ツ 2021-02-09 02:12

I\'m sending Firebase notifications through my own webservice with PHP like below.

$url = \'https://fcm.googleapis.com/fcm/send\';
        $fields = array(
              


        
3条回答
  •  终归单人心
    2021-02-09 03:04

    I was having problem with FCM on exactly Mi Phone and Huawei phone as well! Turns out that it was not a problem with FCM or your app, but on their device level.

    They have device level app settings that disable notifications or even wake lock, so onMessageReceived() is not fired when the message arrives. After I changed the settings (mainly allow notifications & disable battery optimisation for my app), everything works just fine!

    Refer to Firebase cloud messaging not received when app in background.

提交回复
热议问题