0

Hi have to fetch device current location and for this I am using CLLocationManager class but didUpdateLocations is not calling.

I am

My code and plist are below:

enter image description here

enter image description here

enter image description here

enter image description here

ajeet sharma
  • 753
  • 9
  • 33

1 Answers1

2
<key>NSLocationAlwaysUsageDescription</key>
    <string>Requires GPS to track persons</string>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>Requires GPS to track persons</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Requires GPS to track persons</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>fetch</string>
        <string>location</string>
    </array>

add this in viewdidLoad

locationManager.delegate = self
   self.locationManager.allowsBackgroundLocationUpdates = true
   self.locationManager.startUpdatingLocation()
Uma Madhavi
  • 4,761
  • 5
  • 36
  • 73