Notifications are 100% broken on Android

I have know idea if it is the wrong path but i do know using the ADB command fixes the issue for the few apps I have that have the delayed notification issue. I haven’t checked in a bit but I had the issue with Gmail also. I would love it to be fixed though as it is a hack and a pain to do it every time you boot the phone.

As far as I can tell, at least on Android 11, setting apps as not “battery optimized” adds them to the doze / device idle whitelist. This can be checked using adb, so it seems they are related. That said, setting the Wyze app to be not battery optimized does not appear to have any effect on notifications. They still seem to be delayed and pile up when the device wakes up, so I’m not sure.

Doze and device idle are two different things though.
If you turn off idle with adb, notifications come through fine. As you say, removing them from optimization, does nothing.
The apps whose notifications work, somehow end up whitelisted. So removing them from the optimization list I don’t believe puts them on the white list.
You can add them to the white list with adb also, I’ll play with that and see if it works… It’ll better than disabling idle completely I guess?
Although, with idle disabled, I’ve not seen any impact on the battery life, I can still squeeze 2 days off a charge with light use.

It does, I’ve verified it by removing them from the optimized list and looking at the idle whitelist with adb. No noticeable improvement though. I’ve tried disabling idle altogether and will see how that performs. I figured it wouldn’t make a difference due to the whitelist.

Disabling idle definitely works, mine is disabled and I get all the notifications… They’re slow 5 to15 seconds but it’s the same on the iPhone… But at least they work.
You should disable “adaptive notifications” under “special access” as well, just for good measure.

Doze is what triggers deviceidle, I used to reverse engineer android apps and build custom android roms and the code was always referred to as doze. I checked with another android developer and they said that the same.

I understand, but it’s not working, somehow dozing or in our case excluding the app from dozing isn’t preventing deviceidle from suppressing it… whitelisting it doesn’t work, it should no?

I’m not an Android developer but I remember when my company was upgrading an app to work on Android Q (10) they were worried Android would break the app by constantly forcing it into the background as part of its aggressive battery saving feature.

Assuming the same thing is happening here, are there any Android developers in the community who could advise the Wyze programmers on what to look for? :face_with_monocle:

I’m still on Android 8 so I haven’t seen such huge delays but I do sometimes get a flood of notifications when I unlock my phone.

Here’s the pertinent info straight from Google developer. As I stated previously, with doze enabled, notifications are almost instant for Wyze Lock and doorbell notifications, so they need to apply the appropriate code for the rest of the devices.

That is exactly what is needed, thank you very much.
It comes with sample code and a very good description of all processes and triggers involved… Very cool. Heck even I understand it now👍
Maybe you should send / share that link to the Wyze folks? I find it hard to believe that they couldn’t fix this problem armed with that level of detail?

Nice. I was looking online and coming at it from a different direction. Again, I don’t code Android apps so was making a best guess.

From WorkManager  |  Android Developers

“WorkManager is an API that makes it easy to schedule deferrable, asynchronous tasks that are expected to run even if the app exits or the device restarts.”

I surmised that this is how the App regularly checks for new events.

“A (deferrable periodic) WorkRequest for repeating work. This work executes multiple times until it is cancelled, with the first execution happening immediately or as soon as the given Constraints are met. The next execution will happen during the period interval; note that execution may be delayed because WorkManager is subject to OS battery optimizations, such as doze mode.”

But Ken’s article looks far more likely to be relevant:

" FCM is optimized to work with Doze and App Standby idle modes by means of high-priority FCM messages. FCM high-priority messages let you reliably wake your app to access the network, even if the user’s device is in Doze or the app is in App Standby mode."