Push notifications not working while screen is off

  • Thread starter Android Central Question
  • Start date
A

Android Central Question

I've recently switched over from iOS to a Samsung Galaxy S8 running Android 8. During the first week everything worked just fine. I was receiving push notifications on a regular basis. A few days ago suddenly notifications stopped working intermittently when screen is off. I couldn't find a pattern really. It does it both on Wi-Fi and 4G, for all apps. Sometimes push notifications work, sometimes they are delayed (receiving them after a few minutes) and sometimes they do not work at all.

Each time it doesn't work when I turn on the screen, all notifications pop up with both sound and visual.

What I checked so far:

- Notifications turned on for the specific apps and allowed on lockscreen
- Apps were also put into the "Unmonitored apps" under Device Maintenance - Battery
- Wi-Fi on during sleep set to always
- Data saver turned off
- Optimize battery usage - checked that the apps are set to off
- Even tried by enabling Always On Display setting - same behavior.

For me it seems that the something in the battery optimization process is messing up with the notification service. I can't say for sure if it happens for messages as well as I don't receive text messages so often, but it happens for all other apps: Gmail, Whatsapp and some other apps I use.

I noticed that under Optimize battery usage there are a lot of system services and they are all set to be optimized. Which I find very odd considering that probably some of them are very important for the system to run properly. Is it possible that there is a service there that handles notifications and I should switch off battery optimization for it as well? The only name I found close was a service called "notification" which I disabled, but without success. Still not getting push notifications.

Any idea what else can be checked? If I cannot find a solution to it I will most probably go back to iOS as this is very annoying. I heavily rely on notifications for work purposes as well.
 

Raul T2

Member
Sep 4, 2018
13
0
0
Visit site
Thanks for the answer! Yes, Power Saving Mode is turned off. I also checked that some system apps under Optimize Battery Usage are unchecked, including Notifications, no success. I also disabled the Google app in Google Play and disabled auto update for it. Still no change.

What I also noticed is that at some point I do receive notifications even with screen turned off. But this can be a matter of 5 minutes up to a few hours overnight. I even did tests by sending mails and they are not getting through once the screen has been locked for some time.

Each time I open the screen and there are notifications pending they show up immediately.

What else can be checked? It's really annoying to try so many things and nothing helps
 

Raul T2

Member
Sep 4, 2018
13
0
0
Visit site
I tried this right now and it is the same behavior. I've sent a test mail and the notification didn't come through. Once I opened the screen it instantly showed up with the time stamp from earlier when the mail was sent. Which means the notification on the app side is working but it's not showing up as the device is "sleeping"
 

Raul T2

Member
Sep 4, 2018
13
0
0
Visit site
Another thing to mention is that if I turn off the screen there is a short time of about a few minutes when notifications instantly arrive. After that the problem occurs. I'm pretty sure at this point that the phone somehow goes to a deep sleep mode and puts the notification service to sleep as well. As the apps are working and sending notifications, but those are not getting forwarded by the system.

Is there any way to check the notification service and make it not sleep?
 

B. Diddy

Senior Ambassador
Moderator
Mar 9, 2012
165,536
4,671
113
Visit site
Frustrating. I know this is a common question that comes up, but the solution to most instances is to turn off Battery Optimization. Did you already try turning off optimization for all apps (and not just specific ones)?
 

Al Borland

Active member
Sep 4, 2018
32
0
0
Visit site
I have the exact same problem. S8. I have my phone set up where I don't automatically update apps. I also have very few apps on my phone. No facebook/whatsap, etc.

My phone has been flawless at promptly notifying of a new gmail until mid-week last week when google or samsung pushed an update. Ever since then I have the exact same problem you describe with Gmail.

I have tried every possible change I can find on AC and other forums for similar problems to no avail. Whatever update was pushed out last week (I highly suspect it was a touchwiz update) it has messed up Gmail notification syncing whether it be to the Samsung Mail app or the Gmail App. If the screen is on and they come right through. Screen off and they are delayed until I turn the screen on or wait for anything from 15 min till sometimes it is hours later.

Text messages come through fine and instantly. Call alerts and notices that a phone message was left are also instant. I don't have any other apps that provide notifications.

Watching the outcome of this thread with interest!
 

Raul T2

Member
Sep 4, 2018
13
0
0
Visit site
I haven't disabled optimization for all apps but what AI Borland says is really interesting.

The problem appeared for me in the same period, on Thursday last week. I know I haven't installed anything new but I also have auto-update apps enabled. So maybe there is an update that affected us both.

Can you recall which apps got updated at around Thursday last week? I can't see any Samsung updated apps around that time. Only Google Duo and Samsung Internet Browser.

Or are the Samsung apps updated somewhere else and not in Google Play?

I think that if we can find out what app is causing it we can probably isolate the problem.
 

Al Borland

Active member
Sep 4, 2018
32
0
0
Visit site
T2,

I am fairly confident it was a Samsung update, and saw on APK mirror that Touchwiz/Experience received updates at the same time (Aug 28). In my case many, but not all, of my general settings changed back to default Samsung setup, so I had to go back and fix all those back to how I had them set. I am still on Nougat. I do not use any Samsung services and do not have a Samsung account set up.

There are Google and Samsung updates that get pushed to the phone and installed, even if you have auto-update disabled. I see this regularly where I get a notice that there are a number of apps available for me to allow to have update, but at the same time several apps/files updated on their own. These appear to be items that you can't control the update. I have every auto update setting configured not allow auto update (play app, developer options, PDP update packages disabled), but there are still things that get pushed, which I'm fairly certain are system apps/files.

Much discussion on the Samsung Community help forum on this same problem.
 

Raul T2

Member
Sep 4, 2018
13
0
0
Visit site
I'm running Oreo so that would be a bit different. I opened a support ticket with Samsung and will have a remote troubleshooting session. I'll report if I find out something useful.
 

Al Borland

Active member
Sep 4, 2018
32
0
0
Visit site
I'm running Oreo so that would be a bit different. I opened a support ticket with Samsung and will have a remote troubleshooting session. I'll report if I find out something useful.

Thank you T2. For giggles i pulled out my old phone, a Nexus 6P. Made sure it was running the newest release of gmail so that both phones are on the same version. I had both phones logged into my gmail account, and both phones with screen off. 6P would get the push and give me my notification sound quickly, within one minute of an email having been sent from another account. My Samsung S8 would lag anywhere from a few minutes to 20 minutes.

If I kept the screen alive on the S8 then it would mirror the timing of the 6P.

Frustrating, but perhaps Samsung will actually look into it. On their own community forum there is a long thread of frustrated users, and despite being marked resolved, it is not based on the recent postings.
 

Raul T2

Member
Sep 4, 2018
13
0
0
Visit site
I have been doing some further tests and I noticed that the delayed notifications are actually isolated for 2 apps: Gmail and another app I use a lot. As I receive a lot of notifications for those 2 apps it mislead me thinking it applies to all apps.

While I haven't found a solution for Gmail yet, which also doesn't bother me too much, I'll reach out to the developer of the other app.

So the Gmail problem may be related to the gmail app itself as it occurs to you as well. To isolate that it is not a general problem, I did sent myself an E-Mail from a laptop and after 2-3 minutes if it didn't arrived on my S8 I was sent a whatsapp notification as a test and this did come through instantly. Gmail however still didn't come up.

So when I woke up the screen the Gmail popped up instantly.
 

chanchan05

Q&A Team
Nov 22, 2014
8,519
0
0
Visit site
This basically sounds like the Battery Optimization setting in the Samsung isn't overriding Doze as it's supposed to. Doze was made more aggressive on Oreo to make it save more battery. So basically, depending on the exact Android build (some manufacturers change it), this can kick in between 20min to 1hr. Once it kicks in, you won't be receiving any notifications from online sources unless it's flagged as high priority through GCM cloud which overrides the Doze thing (dev should be doing this). Now Doze has "windows" wherein it would trigger a short duration of open connection so apps can update themselves for notifications. The thing here is that these windows gets longer apart the longer the phone remains in Doze. For example the first window opens at 30min after start of Doze, then the second opens at 1hr after the previous window closed, etc.

The Battery Optimization menu should have been overriding this in saying these apps I don't want Dozed and have access always.

Anyway, as far as I can tell, the only option here now for those with the problem would be to use an app that overrides Doze functionality. AFAIK Greenify's Aggressive Doze still works (no need for root). Personally I use this to just make Doze trigger earlier (5-10min after screen off) to save more battery, but it can also control how often the "windows" are open. For example you can set it to check for notifications every 20min instead of an every increasing interval.
 

Raul T2

Member
Sep 4, 2018
13
0
0
Visit site
Thanks a lot for this response! This gives a lot of insight related to how the system works in the background.

I've installed Greenify and unfortunately that option you are speaking off is only for rooted devices (which I don't plan at the moment to do, maybe just as a last resort). It's Shallow Hibernation and apparently push notifications work for High priority GCM push. Now there is a question here. Is there a way to change the GCM priority for an app without root? Or is this something the developer of the app should've done / do?

The good thing is that I found out the app from which I'm looking to get push notifications is GCM enabled. Now the question is whether there is a possibility to change that priority in GCM to high and maybe that could solve the problem? Or any app that could help further?

It may be also a problem on the development of the app itself. As I already added it under Apps not optimized in Optimize battery usage and it is still not working. However, other apps are there and do send push notifications as my test above showed.
 

chanchan05

Q&A Team
Nov 22, 2014
8,519
0
0
Visit site
Thanks a lot for this response! This gives a lot of insight related to how the system works in the background.

I've installed Greenify and unfortunately that option you are speaking off is only for rooted devices (which I don't plan at the moment to do, maybe just as a last resort). It's Shallow Hibernation and apparently push notifications work for High priority GCM push. Now there is a question here. Is there a way to change the GCM priority for an app without root? Or is this something the developer of the app should've done / do?

The good thing is that I found out the app from which I'm looking to get push notifications is GCM enabled. Now the question is whether there is a possibility to change that priority in GCM to high and maybe that could solve the problem? Or any app that could help further?

It may be also a problem on the development of the app itself. As I already added it under Apps not optimized in Optimize battery usage and it is still not working. However, other apps are there and do send push notifications as my test above showed.

I use that option without root. You just need ADB Bridge and Windows PC. There are instructions in the app itself on how to activate Aggressive Dozing without root. Basically you're going to use the PC and ADB Bridge to send a system command to the phone to recognize Greenify without needing to root. I've used Greenify for the last 6 years and have never needed to root for the last 4.

AFAIK GCM cannot be done. It's a register with Google itself and the app developer. Basically notifications are pushed from the source to Google Cloud Manager then to the app. So it's not something you trigger from the phone but from the dev's server itself.
 

Raul T2

Member
Sep 4, 2018
13
0
0
Visit site
I use that option without root. You just need ADB Bridge and Windows PC. There are instructions in the app itself on how to activate Aggressive Dozing without root. Basically you're going to use the PC and ADB Bridge to send a system command to the phone to recognize Greenify without needing to root. I've used Greenify for the last 6 years and have never needed to root for the last 4.

AFAIK GCM cannot be done. It's a register with Google itself and the app developer. Basically notifications are pushed from the source to Google Cloud Manager then to the app. So it's not something you trigger from the phone but from the dev's server itself.

Ok. So you mean I need to test the Aggressive Dozing and not the Shallow Hibernation option. You're thinking that Aggressive Dozing will override what's already in the system? I see that the White List redirects to the Apps not optimized menu. So if this doesn't change anything in the background I will still get the same error as the mentioned app is already there and it doesn't work.

Nevertheless I've ran that command to allow it to run and now it's active. Curious to see whether it will work. If not I'll get in touch with the developer to eventually check the GCM settings on their side. Thanks