ios8 - `CLLocationManager requestWhenInUseAuthorization` perform action after the user accepts -
ive update app include [cllocationmanager requestwheninuseauthorization]
. possible start update after user gives permission? in ios7 use users location when view loads, there 1 step , result method not using valid latitude , longitude.
the solution perform action in cllocationmanager
delegate
method ;
// location manager delegate methods - (void)locationmanager:(cllocationmanager *)manager didupdatelocations:(nsarray *)locations
this method gets called after user gives permission use location services. or if user has given access automatically called. if want call method once can do:
// location manager delegate methods - (void)locationmanager:(cllocationmanager *)manager didupdatelocations:(nsarray *)locations{ cllocation *location = [locations lastobject]; if(location !=nil){ //we got location //<your method goes here> [manager stopupdatinglocation]; } }
Comments
Post a Comment