Earlier this week Facebook was accused of draining people's battery with its iOS app. 

It has now admitted the problem, which caused the app to run in the background even if it had been closed, is being caused by one of its request processes being stuck on a loop. The social network has apologised for the inconvenience this has been causing people and has issued an update to the app to fix the problem.

In a post on his personal page, ?Facebook's engineering manager Ari Grant wrote: '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.' His team also found a second issue being caused by the way the app manages audio. 'If you leave the Facebook app after watching a video, the audio session sometimes stays open as if the app was playing audio silently,' he continued. '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.' His team has identified improvements and 'some of these' are in the version of the app the site released yesterday. People concerned about the problem can update their app by opening the App Store and clicking on Updates.

If automatic updating is enabled the update should have already been made. Mr Grant also stressed that the issues they found were not caused by the optional Location History feature in the Facebook app, or anything related to location.

'If you haven't opted into this feature by setting Location Access to Always and enabling Location History inside the app, then we aren't accessing your device's location in the background,' he said. 'The issues described above don't change this at all.'  Matt Galligan, co-founder of mobile news app Circa was among the first to publicise the problem. 

He said the seemingly power-hungry app was responsible for 15 per cent of all battery drain over a week, despite disabling the background app refresh feature, which should stop the app running in the background. It is possible to see how much battery life apps use thanks to a new feature in iOS 9, which shows power consumption over different periods of time.