问题
I am facing issue in my app regarding doze mode. I am making a chat application and when app is in backgroud during doze mode and receive any message . Device does not show notification in orea.
I have followed the proper procedure for OREO notification by building channel for it.
I need to find if there is a way to whiteList my app from doze mode so that I can have notifications. Or any other process to optimize notification building.
回答1:
I do not need to whitelist my application to get notifications in doze mode. I recommend to look at your notification to see if you can find the issue there.
Some tips:
- Send a notification, use the notification field. If theres no notification field it will be handled as a data notification. Data notifications are delivered when the app starts again.
- Set priority to high.
- Maybe use time to live = 0. That will make firebase to try harder to get it delivered. But it will be lost if it fails.
Hard to give you more direct advice when I do not know where you are sending the notification from.
https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
来源:https://stackoverflow.com/questions/52664059/doze-mode-on-oreo