X
Tech

​Facebook: We sucked your iPhone battery dry - but now we've fixed it

Facebook says it has resolved two issues that were causing its app to run excessively in the background, dramatically shortening iPhone battery life.
Written by Liam Tung, Contributing Writer
iphones.jpg
iPhone battery drain: Facebook blamed poor iOS app performance on CPU spin and audio running silently in the background.
Image: Apple

A Facebook engineer has explained why its app was draining the life out of iPhone batteries - but insists the problem wasn't caused by incessant location tracking.

The explanation by Facebook engineer Ari Grant came alongside an update to its iOS app and a note stressing that GPS tracking was not the culprit.

"Continued use of GPS running in the background can dramatically decrease battery life. Facebook doesn't run GPS in the background unless you give us permission by turning on optional features that require this," Facebook notes in the update.

Continuous location tracking by Facebook was one of the chief suspects before Grant's post, which may explain why the app was running in the background for twice as long as it was active on the screen.

According to Grant, two key issues in its app were a 'CPU spin' in its network code and another that stemmed from its handling of audio in video files, which these days auto-play on Facebook.

"A CPU spin is like a child in a car asking, 'Are we there yet? Are we there yet? Are we there yet?' with the question not resulting in any progress to reaching the destination. This repeated processing causes our app to use more battery than intended. The version released today has some improvements that should start making this better," Grant explained.

The second issue isn't caused by videos auto-playing but rather by audio running silently in the background after a user has finished watching a video - a problem already noted by a number of iPhone owners.

"If you leave the Facebook app after watching a video, the audio session sometimes stays open as if the app was playing audio silently. This is similar to when you close a music app and want to keep listening to the music while you do other things, except in this case it was unintentional and nothing kept playing," Grant noted.

"The app isn't actually doing anything while awake in the background, but it does use more battery simply by being awake. Our fixes will solve this audio issue and remove background audio completely."

Read more

Editorial standards