[Android Q&A, Help & Troubleshooting] Mister_Diamond:
I have a phone with Nougat 7.1.1, but also older phones (eg with Lollipop and Gingerbread): the common trouble on all phones is that I have an annoying issue when connected using mobile data:

all the apps which relies on push notifications (eg whatsapp, facebook messenger, Hangouts and Gmail) doesn’t receive push notifications in realtime or in a acceptable time: I mean that I receive notifications - delayed - also after 30 minutes or i receive them only when I turn on the screen. On all these phones I use a SIM card of same carrier.

When I am connected using Wifi (so without mobile data) I receive notifications in realtime (in about 1 or 2 seconds).

What I checked is that all these apps have background data always enabled and I don’t use any battery saver app.

Is like if the mobile data, after some minutes of inactivity, falls in a sort of idle status, and needs to be kept awake: in facts, if I use a method to run a ping command every X minutes, the notifications are received in an acceptable time (in few seconds).

Not all of my phones are rooted: on the phones which are rooted I solved by installing the app called “Push Notification Fixer”; I am aware of the fact that there’s also available the “NO ROOT” version of such app, but doesn’t works for me.

I said “if I use a method to run a ping command every X minutes, the notifications are received in an acceptable time (in few seconds)”: I noticed that mobile data of my carrier falls in a “sleep” state after about 7 minutes: so I setup the following command in a Terminal Emulator:

ping -i 420 www.google.com

420 is the time in seconds, which is equal to 7 minutes.

The ping method, however, cause other issues: it cause a lot of wakeups (as I can see from Better Battery Stats) and sometimes I notice that it hangs: I excluded the Terminal Emulator from battery optimization and from data saver (and I enabled the option “Wake Lock” (to keeps phone from sleeping while running a command) , but this doesn’t help: I also excluded Google Play Services from battery optimization/Doze and I ensured that background data is not restricted

Obviously I’ve also tried to wipe applications cache and uninstall and reinstall applications: however, since with Wifi I don’t have any trouble, seems not a fault of the phone or apps, since I faced this issue on all phones and different versions of Android: always occurs with mobile data but not with Wifi.

Is sure the fact that when I am on mobile data the phone needs to be awake to receive the notifications. I repeat that when I am connected using wifi, the notifications are instant.

I don’t think that Doze is the culprit: as I’ve said I excluded apps and Google Services from battery optimization/Doze.

I also disabled the data saver option. I have notifications delay issue only when connected with mobile data: furthermore the signal strenght of my carrier (4G) is good.

What can I do (a robust and reliable method) to keep the mobile data connection always active?

I also tried by using “Connection Stabilizer” from the Play Store: this app, also have a method to run a ping command every X seconds or minutes, but also this app suffer from the same issue: after a while the ping command no longer works.

I heard of the fact that this issue could be related to fast dormancy: unfortunately, since the phone is not rooted, I can't disable fast dormancy.

I installed this app: https://play.google.com/store/apps/details?id=eu.thedarken.wl (Wake Lock - PowerManager): This app implemented a Partial Wakelock: in this way the notifications arrives in 1 - 2 seconds, but the downside (due the Partial wake Lock) is a battery drain.

No one else, here, faced the issue of delayed notifications when connected with mobile data?

As I've said, with Wifi I don't have any issue with notifications; furthermore I am not "forced" to rely on wakelocks.

Kind regards.