<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>
dies in viewDidLoad
locationManager.delegate = self
self.locationManager.allowsBackgroundLocationUpdates = true
self.locationManager.startUpdatingLocation()
'locationManger? .delegate = hinzufügen self' wird in' viewDidLoad' gesetzt? –
@InderKumarRathore ja, aber wenn ich delegate in viewWillAppear dann immer noch nicht funktioniert. –
Haben Sie vom Benutzer eine Position angefordert? 'locationManager.requestWhenInUseAuthorization()' oder 'locationManager.requestAlwaysAuthorization()' –