0

Location updates are working fine in all other devices, but not in iPhone 8 plus

Below is the simple set of code I am using

 _locationManager = [[CLLocationManager alloc] init];
 _locationManager.delegate = self;
 _locationManager.desiredAccuracy = kCLLocationAccuracyBest;
 _locationManager.distanceFilter = kCLDistanceFilterNone;
  [_locationManager requestAlwaysAuthorization];
 _locationManager.allowsBackgroundLocationUpdates = YES;
 _locationManager.pausesLocationUpdatesAutomatically = NO;
  [_locationManager startUpdatingLocation];
Jas_meet
  • 366
  • 1
  • 20
  • there is new key required to add for iOS 11 however you are added Privacy - Location When In Use Usage Description you must be add this : Privacy - Location Always and When In Use Usage Description – Mrugesh Tank Nov 02 '17 at 05:51
  • Yes I have added this key in .plist and its working in other devices with iOS 11, but not in iPhone 8 plus – Jas_meet Nov 02 '17 at 05:55
  • If you're working with simulators then you must need to simulate location. You can also create gpx file and set it to you scheme. – Mrugesh Tank Nov 02 '17 at 05:57
  • I am working with real devices – Jas_meet Nov 02 '17 at 06:00
  • Ensure that location services are enabled on that device, ensure that your app has been granted location access in the settings and if all else fails, try rebooting the device. – Paulw11 Nov 02 '17 at 06:06
  • Anything useful ? All the settings are enabled which need to be, so please do not worry about that, I won't have posted question if I haven't checked all these cases – Jas_meet Nov 02 '17 at 06:09
  • Well, your code is working on other devices. Location code is working fine on my iPhone 8plus with iOS 11, so the most logical answer is that there is something wrong with your device; hence my suggestions. Are other apps able to receive location information on that device? Have you used the debug menus in Xcode to simulate a location on that device? If so then location services can be adversely affected until you reboot the device. – Paulw11 Nov 02 '17 at 06:31

0 Answers0