Open esisa opened 9 years ago
Where are you adding this code @esisa? See https://github.com/mapbox/mapbox-ios-sdk/commit/8d6b14a9a8463a80b6aff96a2d22df0648d41ca0 where I think we've taken care of this in the latest couple releases.
I have just added it into viewDidLoad in my own view controller.
I have the same problem using the weekend-picks-template and adding the same code there works too. https://github.com/mapbox/weekend-picks-template-ios
@esisa Are you using the latest release? Can you submit some complete sample code that shows this problem?
I am running weekend-picks-template-ios with no changes from the current master branch. I have updated to the latest XCode.
Running on iOS7 simulators work just fine. Running it in iOS8 does not bring up the location prompt and the location button does not bring me to the location set in the simulator.
It is probably some quirk with my setup, but I have no idea what it would be.
Did you add the NSLocationWhenInUseUsageDescription to your info.plist?
<key>NSLocationWhenInUseUsageDescription</key> <string>String shown in the alertview</string>
I'm also having this issue. The example app also doesn't show the user location on iOS8.1.
I have the NSLocationWhenInUseUsageDescription key on my info.plist
I'm using MapBox 1.4.1 installed as a binary.
Yes, I have added that.
Espen
Did you add the NSLocationWhenInUseUsageDescription to your info.plist?
<key>NSLocationWhenInUseUsageDescription</key> <string>String shown in the alertview</string>
Reply to this email directly or view it on GitHub https://github.com/mapbox/mapbox-ios-sdk/issues/519#issuecomment-60246622 .
The example app also doesn't show the user location on iOS8.1.
Which example app @joaosobrinho?
@incanus The app in this link: https://github.com/mapbox/mapbox-ios-example
This sounds line my issue as well. I am not using CLLocationManager directly, the RMMapView does it all and I call: mapView.showsUserLocation = TRUE; mapView.userTrackingMode = RMUserTrackingModeFollow; And then I would receive location updates from the MapView.
In looking through the code for 1.1.4 in RMMapView i see the NSAssert
// enable iOS 8+ location authorization API if ([CLLocationManager instancesRespondToSelector:@selector(requestWhenInUseAuthorization)]) { NSAssert([[[NSBundle mainBundle] infoDictionary] valueForKey:@"NSLocationWhenInUseUsageDescription"], @"For iOS 8 and above, your app must have a value for NSLocationWhenInUseUsageDescription in its Info.plist"); [_locationManager requestWhenInUseAuthorization]; } This doesn't appear to be working as intended ??
Broken for me too on iOS8+. Fortunately you can work around it with a dummy location manager
BOOL needToRequestAuthorization = [CLLocationManager instancesRespondToSelector:@selector(requestWhenInUseAuthorization)];
if (needToRequestAuthorization && !self.dummyLocationManager) {
self.dummyLocationManager = [[CLLocationManager alloc] init];
[self.dummyLocationManager requestWhenInUseAuthorization];
}
This should be working fine. Check that the develop
branch maybe helps resolve your problem (as of commit https://github.com/mapbox/mapbox-ios-sdk/commit/5703eb138bd406ffe8f6677365cefc99f78e379c).
That commit won't make any difference to my usage. I'm using NSLocationWhenInUseUsageDescription in the Info.plist as per original code.
This doesn't appear to be working as intended ??
Does your code break on this section if running on iOS 8 @wasatchtechnology?
When testing out the SDK I cannot get requestWhenInUseAuthorization to work. No prompt is shown to the user to accept getting the location. I have added the necessary strings to the info.plist file.
To get it working I had to manually add this code: