Mobile dev meetup · From polling to push
Push cut our battery use by 22%, and we still poll
What changed when our app stopped asking for messages every 30 seconds, and why we kept a fallback anyway.
Before: every app asked our server for messages every 30 seconds
That is 2,880 requests per device per day, and a delay of up to 30 seconds.
After: the server pushes through FCM and APNs, with a slow poll behind it
Messages now arrive in about 1.2 seconds instead of up to 30
The polling bar is the worst case; push is the median.
Our servers now handle 70% fewer requests
Requests to our server, with the polling setup as 100%.
Our app used 22% less battery in a one-week test
Battery used by our app, before against after, one week on 40 devices.
About 3% of Android devices never got a single push
Some manufacturers ship aggressive battery savers that block them.
So we kept a poll, but slowed it from 30 seconds to 15 minutes
The slow poll is the safety net for devices whose pushes never arrive.
We still don't fully understand iOS's limits on background work
- Android
- We know the gap: about 3% of devices, and the slow poll covers it.
- iOS
- We don't yet know how its background limits apply to our case.
If you have mapped them for an app like ours, I'd like to hear how.
If you make the same move, do these three things
Keep a fallback
Some devices will never get your pushes.
Measure battery before and after
Our 22% came from a one-week test on 40 devices.
Test on the cheap phones your users actually have
Our missing pushes came from some manufacturers’ battery savers.