Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localizing the user on iOS 8

Hullo, I am starting to port my apps to iOS 8 and I soon bounced into a problem with CLLocationManager. Basically the app no longer centers the map on the user's location and instead proposed error:

Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.

Executing

 [CLLocationManager requestAlwaysAuthorization]

does nothing and even inserting the NSLocationAlwaysUsageDescription key in the app’s Info.plist changes nearly nothing. In fact the only apparent effect of the operation is the location setting in the preferences that, upon running the app, has its value reset from the value I had entered.

like image 540
Fabrizio Bartolomucci Avatar asked Jun 06 '14 12:06

Fabrizio Bartolomucci


1 Answers

I added the two lines to my plist (see below), and furthermore i call [locationManager requestWhenInUseAuthorization]; first line in my viewDidLoad:..

Do you have any suggestions? =)

enter image description here

like image 111
Anders Avatar answered Oct 21 '22 05:10

Anders