Facebook iOS App Update Includes Fixes for Battery Draining Issues

Facebook iOS App Update Includes Fixes for Battery Draining Issues

Facebook released an update to their iOS app on Thursday. and it fixes a battery draining bug that has plagued users for the past few weeks. Users were seeing a huge drain on their iPhones, due to Facebook running in the background, even if Background Refresh was turned off.

Facebook iOS App Update Includes Fixes for Battery Draining Issues


While the latest Facebook app release notes don’t include a reference to the issue, Facebook engineering manager Ari Grant wrote a post (via TechCrunch) explaining the issues behind the battery drain and what Facebook has done to fix it. According to Grant, there were several factors that contributed to the problem, including a “CPU spin” in the network code and silent background audio sessions that kept the app awake even when it wasn’t open.

Grant says the first issue they attacked was a “CPU Spin” they discovered in the app’s network code:

The first issue we found was a “CPU spin” in our network code. 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.

Another battery sucking culprit was how the app managed audio sessions:

The second issue is with how we manage audio sessions. 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. 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.

Grant notes that fixes for both issues have been included in Thursday’s update to the app, and says Facebook will continue to work to improve the battery usage of the app.

In our personal experience, while the Facebook app is draining our battery to a lesser extent, (36% of all battery usage, down from 47% before the app update), 36% is still a huge amount of battery use for one app. Hopefully, it will continue to improve.