Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google map sdk for IOS 8 does not update location

I'm running on IOS8 simulator and counter this problem:
GMSMapView is able to load map but it didn't ask for Location's permission, thus it could not update current user's location. (I did set a custom location, using GPX file)

However, GMSMapView still works fine on IOS 7.1, 7.0 ...
My code is simple, init mapView, add it to controller's view and using KVO myLocation to observer location's change.

What should I do now ?

like image 961
Pham Hoan Avatar asked Dec 07 '25 10:12

Pham Hoan


1 Answers

Google Maps SDK v1.8.1 doesn't request the location authorization that is needed in iOS8, so you need to do this in your application.

Use the CLLocationManager's requestWhenInUseAuthorization method, and in the authorization changed delegate, enable location updates in the map view when authorization can be given.

Also, don't forget to add the correct keys in the info.plist to explain to your users why you need their location, as without this the call to requestWhenInUseAuthorization don't do anything.

like image 173
NigelG Avatar answered Dec 09 '25 23:12

NigelG