Two developers working separately have identified Facebook's repeated polling of its systems for new posts and data as a principal cause of battery drain. "Disable Background App Refresh for Facebook or other apps you don't absolutely need to stay up-to-date all the time," says Scott Loveless, an ex-Apple Genius bar employee who says he routinely dealt with battery life complaints in that job.
Apple’s iPhone has a relatively small battery with a capacity of 1,560 milliamp-hours (mAh), compared to other flagship smartphones which can have capacities of 2,600mAh. Short battery life has thus become a primary user complaint, prompting Apple to issue advice on battery care and a plethora of articles and tips on how to extend an iPhone’s battery life.
Loveless found that the Facebook app will if allowed constantly use Apple’s location services and background app refresh – a feature that keeps apps up to date by periodically polling the internet for new data such as tweets or Facebook posts.
Digging into processes
Using Apple’s developer tools for monitoring app activity, Loveless analysed Facebook’s iPhone app and found behaviour that explained the diminished battery life he was seeing on his iPhone 5S.
“During testing, Facebook kept jumping up on the process list even though I wasn't using it. So I tried disabling Location Services and Background App Refresh for Facebook, and you'll never guess what happened: my battery percentage increased,” explained Loveless.
“It jumped from 12% to 17%. Crazy. I've never seen that happen before on an iPhone."
The explanation for the apparent increase in charge, he says, is that the load on the CPU had dropped - meaning that the battery would now last longer.
“I have confirmed this behaviour on multiple iPhones with the same result: percentage points actually increase after disabling these background functions of Facebook,” Loveless says.
Separately, Sebastian Düvel, a German iOS app developer also discovered in November last year that Facebook persistently ran in the background and drained an iPhone’s battery using the same developer tools as Loveless.
He also identified background Facebook polling, especially by its Messenger function, to be a principal drain on resources. But he also noted in an update in March 2014 that turning off Background App Refresh cured the problem.
The cause of the battery drain is unlikely to be a bug or flaw in programming, but rather collateral damage in app’s attempts to maintain a connection to Facebook’s servers. The social network introduced an instant messaging function with Facebook chat and Messenger, and later added voice calling over Wi-Fi for users in the US and select other regions, both of which need persistent or frequent connections to the internet.
Facebook also bought the text message replacement app WhatsApp for $19bn in February, which similarly requires an open internet connection to have messages pushed to the smartphone.
For iPhone Facebook users, Loveless suggests turning off the location services and background refresh features for the Facebook app in the iOS settings application, which should prevent it from draining the iPhone’s battery while behaving normally in general use.
He also suggests
- leaving apps that have been used in memory rather than quitting them in the multitasking interface
- disabling push email temporarily
- disabling "annoying" push notifications (because they wake the screen)
- simply ignoring the battery percentage (because checking it turns on the screen and uses power)
- having the phone checked at an Apple Store
- switching the phone to Airplane mode when in an area with poor phone reception
Facebook’s Android apps have also been frequently implicated in battery drain issues, with some going as far as suggesting that ditching the Android apps and using the mobile website is the most affective way of preventing battery issues.
guardian.co.uk © Guardian News and Media Limited 2010