Search code examples
javaandroidfirebasefirebase-cloud-messaging

how I can wake up the device when send Firebase notification (FCM)


when my mobile is in charging any time I send FCM it's wake up

but when it's not On charging the notification not received until I press the power or home button to wake up the mobile

is there any way to make it wake up even if it not charging

things I have tried:

  1. from developer options ( set Linit background process to 4 at most)
  2. FCM does not contain notification JSON when send it, only contain data
  3. added and requested this permission RECEIVE_BOOT_COMPLETED WAKE_LOCK

Solution

  • The documentation suggests that you are supposed to send a high priority message to wake the device.

    FCM attempts to deliver high priority messages immediately, allowing the FCM service to wake a sleeping device when necessary and to run some limited processing (including very limited network access). High priority messages generally should result in user interaction with your app or its notifications.

    See also: