2

Ich benutze diesen Code becore iOS 10 und es hat gut funktioniert.CCLocation mit startMonitoringForRegion funktioniert nicht mehr seit iOS 10

//Start monitoring 
    CLLocationCoordinate2D centre; 
    centre.latitude = [latZone floatValue]; 
    centre.longitude = [lonZone floatValue]; 

    [self.locationManager startMonitoringForRegion:[[CLCircularRegion alloc] initWithCenter:centre radius:[radiusZone floatValue] identifier:nameZone]]; 

Aber seit der iOS 10 Version funktioniert es nicht mehr. Es ruft nicht auf didEnterRegion: didExitRegion: & didStartMonitoringForRegion:

Irgendwelche Ideen?

Antwort

1

Ich löste es schließlich durch zwei Schlüssel in der info.plist Zugabe:

NSLocationAlwaysUsageDescription 
NSLocationWhenInUseUsageDescription 

Und fügte hinzu, dass zwei Linien kurz vor:

[self.locationManager requestAlwaysAuthorization]; 
    [self.locationManager requestWhenInUseAuthorization]; 
Verwandte Themen