0

Mobile in sleep mode: Generally 5-10 min after the screen power turned off
Mobile is awake: as soon as the screen power is turned on
Mobile:Micromax A064
Android Version: 4.4.2
When the mobile is in sleep mode, I stop receiving GCM Push Notification
and when the mobile is back awake, I start receiving all the Push notifications which were sent in the duration of sleep mode.
During sleep mode, I don't understand weather my GCMListenerService has stopped listening or the internet is being disabled.

Note: During sleep mode not only for my application, I stop receiving GCM Push Notifications for all the applications in mobile i.e. WhatsApp,Gmail,Shopping Application etc.,

There are no power saving applications in my mobile which can alter the network settings based on battery power. I disabled builtin "Clean Master" Application

Can any one know how to resolve this.

user3616287
  • 145
  • 1
  • 1
  • 11
  • which type of Internet You are using Wifi or Data Packet ?. – Hradesh Kumar Sep 15 '15 at 11:55
  • @HradeshKumar Wifi, I am facing the issue when I am using Data Packet also. – user3616287 Sep 15 '15 at 12:21
  • Have you put `android.permission.WAKE_LOCK` in your Application's Manifest? You need to check your Manifest [here](https://developers.google.com/cloud-messaging/android/client#manifest). You can also try code [here](https://github.com/googlesamples/google-services/tree/master/android/gcm) – bjiang Sep 15 '15 at 17:37

1 Answers1

1

WiFi will be sleep after some time 5 to 20 minutes,its not fixed, Depend on the Device Manufacturer. if your device is in Sleep Mode. There may be two solution for it:-

  1. Go to Setting and set WiFi policy to "Never Sleep".
  2. Prevent Device from going to Sleep mode programatically using WACK_LOCK.
Hradesh Kumar
  • 1,765
  • 15
  • 20
  • I changed the Wifi Policy, But I am facing the same problem while use Data Packet. I am using `WAKE_LOCK` permission, I am using `WakefulBroadcastReceiver` and `WakefulIntentService` to receive push notificaiton – user3616287 Sep 16 '15 at 08:22
  • @user3616287 as you told me that you were using WiFi.so I provide you solution Accordingly.Pls accept this answer if it was usefull to you. – Hradesh Kumar Sep 16 '15 at 16:23