Facebook app is draining your iPhone’s battery

The last few weeks my beloved iPhone 4S lost battery extremely fast. After a normal work day there was hardly 10% left. That means after 12 hours and little usage of the iPhone.

So I went on to find the cause. As an iOS developer I know Instruments form Apple’s developer tools. Instruments is mainly a tool to benchmark your own apps, find slow parts and fix memory leaks.

But Instruments can show the running processes on your iPhone, too. It’s just like Activity Monitor on your Mac.

There is this nice overview and something caught my eye:

That is a list of processes using the most CPU time. Or more easily said: that are the apps that have been running the longest time. The first four are system processes (SpringBoard is essentially the thing that shows your home screen and stuff), at the bottom there is the Facebook app. It is using twice as much time as DTMobileIS (that is the process that feeds Instruments with live data from the phone). That seemed a little much to me. I’m using Facebook quite often, but not like every minute of the day.

So I let Instruments run a little longer and watched the flags.
The flags indicate when an app is getting started, getting terminated and what interested me the most: when it’s getting send to the background and when it’s getting suspended.

To understand that I have to start from the beginning:
If you start an app, then it’s running in the foreground. Sure. If you press the home button, the app is not getting terminated but it’s suspended (the app is sleeping). If an app is sleeping it is frozen and is doing nothing (not using any CPU time), although it is using memory. But that’s a good thing: so if you return to that app it’s faster available, because the system does not have to start it, but simply unfreezes it. Apps can be terminated when frozen (either by the system when memory is running low or by the user using the multitasking switcher, which is normally not necessary).

Since iOS 4 there is multitasking. With that it’s possible for an app to keep running up to 10 minutes after being sent to the background. This is very handy for apps like Instacast, which can finish the podcast downloads in the background (in the past you had to leave the app open until finished) or for my app Home Remind which is sending your reminder in the background. That is no big deal and iOS freezes these apps after 10 minutes at the latest or when the app says it’s done.

Unfortunately some apps are exploiting this. WhatsApp for example. When it seems like it’s terminated it’s actually running exactly those allowed 10 minutes and continues to communicate directly with it’s server instead of using iOS‘ push notifications. That’s draining more battery, of course.
So if you are getting a message in this 10 minute timeframe and open WhatsApp, this 10 minute period starts again. That means if you are getting lots of messages it could happen that WhatsApp is running the whole day. Thankfully most of us are not that popular, so this would become a problem.

Additionally to this 10 minute background time there are four more multitasking modes. They all have something in common: they are running indefinitely. But more important they are defined by the apps themselves.

These four modes are:

  • Playing audio: for apps like Spotify/Pandora who play music when you are doing something else
  • Location based apps: this is for your navigation apps like Garmin or TomTom
  • Newsstand downloads: Newsstand apps can download new issues in the background
  • Voice over IP apps: this is for Skype and apps that allow to phone someone, they run in the background waiting for calls

Let’s return to our case: Facebook.
As said before the app is defining what it’s using. Facebook is using two of them: Audio and VoIP!
VoIP since you can call someone via Facebook and Audio is mandatory for VoIP apps: „Most VoIP apps also need to be configured as background audio apps to deliver audio while in the background. Therefore, you should include both the audio and voip values to the UIBackgroundModes key. If you do not do this, your app cannot play audio while it is in the background.“ Source

That means the Facebook app could be active in the background the whole time.
According to Instruments that’s not the case. Not quite.
Looking at the flags in Instruments you can see that the app is waking up every few minutes, does something for 10 second and sleeps again.

I let this run for two hours and as you can see in the rightmost column, the Facebook app is waking up at regular intervals, does something for almost exactly 10 seconds and sleeps again. The whole day long.

This explains why this app is in the first place in the CPU time listing.
Theoretically the app could use your location when awake and send it to Facebook, but I found no evidence for that.

After this discovery I searched for a way to disable this background actions. So I thought: you can disable the chat inside the app. Probably the app is just running because it is waiting for calls.

So this is the result with disabled chat:
Chat aus

As you can see there’s no difference at all.

Except for that I have found no other setting that has changed anything about this behavior.

So it seems there are only two solutions for this problem:
1. delete the Facebook app
2. quit the Facebook app after every use with the multitasking switcher (press the home button twice in a short time, then you see a bar showing your apps, tap a little longer on one app and they start to shake, now hit the little minus on the Facebook icon)
Now the Facebook app is really terminated and is not running in the background any longer. But if you forget the terminate the app at least one time, it’s running in the background again.

I’m currently using the second method. Since then the Facebook app is no longer in the list of the biggest CPU time consumer and my battery is lasting longer.

A better solution would be if Facebook changes its app to not use so much battery. I don’t see any reason at all why that app has to run every few minutes.

Just try for yourself and comment if you see any difference in your phones runtime.

P.S.: I’ve tested this on two different iPhones, so it’s clearly not a problem of my phone.

P.P.S.: I’ve run that test again on the Facebook Messenger app and on Facebook’s iPad app. The results are the same. They run every few minutes, too:
Facebook Messenger

iPad App:
Facebook iPad

This article is a translation of the original article which was written in my native language German, so please excuse any mistakes.

Please share this article! Together we can get Facebook to fix their app!

Update: Facebook updated its app on June, 18th to version 6.2 but that did not fix this problem.

Update 2 (11/26/2013): Facebook did not change anything, even the current version 6.7.2, released 11/13/2013 is running every 15 minutes for 10 seconds. Same is true for the Facebook Messenger 3.0.1, released 11/18/2013. Just sad.

Update 3 (02/21/2014): No news here. Yesterdays version 7.0 of the Facebook app does not change anything. 🙁

Update 4 (03/18/2014): Version 8.0 of the Facebook app is still running in the background, BUT if you turn background refresh off for Facebook in the system settings it is not running in the background anymore!

128 Gedanken zu „Facebook app is draining your iPhone’s battery“

  1. The funny thing is that I just checked my phone, and as derided as the Android client for Facebook is, it’s reportedly only responsible for 3% of my power consumption. A single GMail thread is issuing almost twice as many wakelocks as Facebook Messenger, and GMail isn’t issuing a significant amount of those either. Granted, though, I’m not running the latest version of the Facebook app because their latest updates have the thing snooping on what apps I’m currently running and feeding it back to the mothership.

  2. If you have a jailbroken iPhone/iPod, you can install Background Manager from Cydia and set certain apps to have backgrounding blocked.

  3. It doesn’t show up in Berkeley’s Carat. So iff it’s a common problem, it is at least not using much more battery than the phone does on average.

  4. the 10 minute checks might be to notify Facebook about the last time you’ve opened your mobile device. Thus, they are able to know how long you’ve been idle w/ your device and display that information in the website’s chat client. You’ll see the mobile device icon and the time (15 min) next to your closest friends.

    1. When you own the server, you don’t need the client to tell you how long you have been away; that is just shitty, cutting-corners programming.

    2. When you own the server, you don’t need the client to tell you how long they have been away; that is just shitty, cutting-corners programming.

  5. Pingback: iWyre
  6. Hi Sebastian, thanks for putting so much effort into this. This strange phenomenon is bothering a lot of iPhone5 users too. Many of us have tried to figure out why this incredibly rapid battery drain occurs. I’ll definitely experiment with your suggestions. Thanks so much again.

  7. Pingback: Quora
  8. The actual importance of Iphone App Developer as well as the part your iPhone application plays in giving you better customer’s service but if we talk about the battery drain. Its a common problem with every phone. The question is what we do?. It is necessary to close all the running applications after use.

  9. You are totally right. I just deleted the app and i see improvements on my battery life! i can now enjoy life better with less facebook.
    Thanks again.

  10. Good info .. Thanks for going to all the trouble to diagnose the problem. The battery problem has been a real pain! I will start using method #2 as well & see if that helps. Hopefully FB will fix it.

  11. I experienced the same problem, but the worse scenario is caused by Whatsapp in my case. I switched from an iPhone 4 to iPhone 5 but my habits remained the same: never quit background apps after use. With the iPhone 4, my battery lasted the whole day; with the 5, instead, around noon I must recharge it, as I have around 10-20% remaining. This morning I force closed my Whatsapp after every use and I still have the 80% of battery remaining. I noticed this thing looking in the preference panel, in the Usage menu. Without closing Whatsapp, the Standby time and Usage time were almost matched because it was running in background in the 10-minutes window. To force close it fix the problem. This morning I have 1 hour of usage and more than 5 hours of standby. I think that Whatsapp developers should fix this problem because in iOS 7 the situation could be even worse (thanks to the background app refreshing).

  12. I think that Mail is doing the same, cause it is checking for mail every now and then. Anyway I deleted Facebook from my 4S, cause I only use that at night and then I’m home on my Mac

  13. Did you turn off updates or the app data refreshing? Perhaps what you were seeing was the app checking for updates per your settings (i.e. every 30 minutes, every hour, etc.)

  14. You absolutly right, because of Facebook app is drainning your iPhone bettry life. but it’s not happen just because of Facebook app. But if any app running in background than it’s also drain bettry life. So alwasy exit properly from any app. I am alwasy close apps after use it. so now not face this kind of problem.

  15. My experience with my 4s is much the same. I last charged it 14 hours ago and I’ve taken a few photos, read emails, taken a 20 minute call, sent txts and used facebook and twitter throughout the day and I still have 64% battery remaining. Facebook is always running in the background and I can’t say I’ve noticed any sort of battery issues at all. I have WiFi turned on at all times but never use Bluetooth – don’t know if that makes any difference…

  16. Thanks! I’v been so bugged with the battery drain. Also, I am certain this is why when I dock my ipod to charge I hear static every few minutes. (It’s got to be the facebook app) Which the whole static issue seems to coincide with the battery drain, docking it before never did that, and even when I was listening to music on the speaker dock it would randomly start static. I am a mother of 4 young kids so I am not going to test my theory as rigorously as you so graciously did, instead I am going for option 1. Delete facebook apps. Today was the first day I haven’t had to charge my ipod every 1-2 hours (which is totally ludicrus) and I have you to thank for that. 🙂

  17. Yes, facebook running in the background do drain battery rapidly. And I found ios 7 drain battery so quick, My iPhone 5S is easy to be low power, I have to charge it everyday. I bought a portable charger from Kinkoo: http://www.ikinkoo.com/shop/portable-charger/kinkoo-infinite-one-8000mah.html, because I am planing to go out for a trip. I find Kinkoo is so good, it has 8000 mah capacity, can charge mine for 4 times, with juice still to spare, and the charging speed is fast.

  18. Thank you for this great article!!! I was suspicious about battery draining and FB app and now i can confirm it thanks to you. I am using an iphone 5s now, to you think i can have FB freely if i don’t allow it in the app background refresh list of iOS 7?

    Do you know any other apps that can abuse from battery lie FB does?

    Thanks a lot!

  19. hank you for this great article!!! I was suspicious about battery draining and FB app and now i can confirm it thanks to you. I am using an iphone 5s now, to you think i can have FB freely if i don’t allow it in the app background refresh list of iOS 7?

    Do you know any other apps that can abuse from battery like FB does?

    Thanks a lot!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.