0

Done with the setting up the required pre-requisites. set distance filter , accuracy filter and using start updating locations. Able to receive location co-ordinates once moved to background for some time say 10 -15 minutes. Later Didreceivelocation updates not returning any co-ordinates even after the device is moved beyond the provided distance filter. But when app brought back to foreground, it returns location co-ordinates. Any solution to receive location co-ordinates when ever the user moves to set distance filter irrespective of the app being in foreground or background.

Any way to keep the app to behave as always run in foreground even though app is in background mode?

Arasuvel
  • 2,971
  • 1
  • 25
  • 40
FunniC
  • 1

2 Answers2

1

I think you have to look at this answer to make sure you've set up everything right:

allowsBackgroundLocationUpdates in CLLocationManager in iOS9

"This new property is explained in the WWDC session What's New in Core Location"

Paul Zahra
  • 9,522
  • 8
  • 54
  • 76
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/17716832) – Maraboc Oct 24 '17 at 07:59
  • 1
    Thanks for the comment. Won't do it again. – Ilya Rudometov Oct 24 '17 at 13:19
  • So you can update your answer to to include the essential parts now ^^ – Maraboc Oct 24 '17 at 13:28
0

Put a code in that view controller

$if ([self.locationManager respondsToSelector:@selector(setAllowsBackgroundLocationUpdates:)]) { [self.locationManager setAllowsBackgroundLocationUpdates:YES]; }

Aarif
  • 87
  • 1
  • 10