0

I am trying to add the background location updates (i.e. the feature where applications running in background can still receive continuous lcoation updates) into my iPhone app. I implemented (in the view controller) the location update methods didUpdateToLocation and didFailWithError. I also added to the Info.plist file, the UIBackgroundModes key with the value 'location' in its string array. I have added the methods like applicationWillResignActive, applicationDidEnterBackground, applicationWillEnterForeground, applicationDidBecomeActive, applicationWillTerminate in the application delegate class, but I have kept them empty.

However when I run my app on an iPodTouch or an iPhone simulator, the application does not receive updates when its in background. It receives updates when in foreground. Also, when I bring the app back into foreground, there is a flurry of updates, like 5-6 updates at the same time.

Could you please point out what I am missing ? Does keeping the methods in delegate (which I mentioned) empty causes this ?

Thanks,
Abhinav.

abhinav
  • 221
  • 1
  • 3
  • 13

1 Answers1

0

You need to implement you location manager delegate, i.e. didUpdateToLocation etc, in the app delegate. See this answer for detail:

to run app continuously in the background

Community
  • 1
  • 1
Bushra Shahid
  • 3,579
  • 1
  • 27
  • 37