Firebase message with high priority not waking device from Doze android 6+

前端 未结 8 1331
一整个雨季
一整个雨季 2020-12-07 19:07

I have migrated my project from using GCM to use Firebase. Push notification comes through ok when the device is awake or been asleep recently but if I leave the device for

8条回答
  •  清歌不尽
    2020-12-07 19:22

    After struggling with a similar issue I managed to get it to work.

    I send following json data through postman:

    {
      "data": {
        "body": "Test body from curl"
      },
      "registration_ids": ["Token"],
      "webpush": {
        "headers": {
          "Urgency": "high"
        }
      },
      "android": {
        "priority": "high"
      },
      "priority": 10
    }
    

    It seems like the last "priority":10 is what's fixing it for me.

    I could not find any reference to this in the Firebase documentation, but in the deprecated GCM documentation it's used. https://developers.google.com/cloud-messaging/concept-options

提交回复
热议问题