Search code examples
androidnotificationspush-notificationgoogle-cloud-messagingsleep-mode

Android GCM notification don't appear when device is in sleep mode


I develop an android application with GCM Push Notification. I have started to use the sample of google. Push notifications work when the device is "on". When the device fall asleep, notifications don't appear but they show when I get android device out of sleep mode.

I saw that when I publish a content in Facebook or Snapchat, notification works perfectly in sleep mode so my question is : When I receive a push notification and the device is in sleep mode, how to show this notification ?

**

EDIT

I solve my problem on the server side. I have forgotten to set the property "delay_with_idle" to false in the message parameters.

For more information see the following documentation :

**


Solution

  • I solve my problem on the server side. I have forgotten to set the property "delay_with_idle" to false in the message parameters.

    For more information see the following documentation :