Replies: 1 comment 5 replies
-
I'm unsure of your exact use case, but I know it's possible to use background messages without CPU usage as my most important work app does so and has done so for a couple years, and I watch the battery usage. I suspect something else in your project (in response to the message maybe?) is doing it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Two users have reported to us that our app is draining their batteries. They send us screenshots of the battery dashboard while it shows that our app is in the background using the CPU for 4+ hours.
When I look at our logs, we see that during those hours, the user received notification in background 2-3 times.
We are wondering if maybe the background message handler might be causing some kind of wake lock to be stuck. I looked into background messaging code and understand that it's using Headless JS. I also understand there's a wakelock there to run the background task.
Other than the fact that the wake lock is acquired without any timeouts though, I don't see anything obviously wrong. I also figure since the core Headless JS code has been around for several years, such obvious wake lock problems would've been discovered already.
Does anyone have insights about this? Perhaps other reasons why this might be happening, or theories on where the background message handler might be going wrong?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions