Google sdk map for IOS 8 does not update location

I am working on an IOS8 simulator and counteracting this issue:
 GMSMapView

able to load the map but does not ask for placement permission, so it cannot update the user's current location. (I set a custom location using a GPX file)

However, GMSMapView

it still works fine on IOS 7.1, 7.0 ...
My code is simple, init mapView

, add it to the controller view and use KVO myLocation

to change the observer location.

What should I do now?

+3


source to share


1 answer


Google Maps SDK v1.8.1 does not ask for location authorization, which is required in iOS8 , so you need to do this in your application.

Use the method CLLocationManager

requestWhenInUseAuthorization

, and in the case of delegation of authority allowed by authorization, enable location update in map view when permission is allowed.



Also, don't forget to add the correct keys in info.plist

to explain to your users why you need their location, as without this the call requestWhenInUseAuthorization

does nothing.

+3


source







All Articles