Sunday 15 May 2011

ios8 - iOS 8 Location Service not working in spite of adding NSLocationWhenInUseUsageDescription -



ios8 - iOS 8 Location Service not working in spite of adding NSLocationWhenInUseUsageDescription -

i'm using ios8 [8.0.2] , no matter seek cant cllocationmanager work.

i added next lines info.plist.

<key>nslocationwheninuseusagedescription</key> <string>this app utilize location services.</string> <key>nslocationalwaysusagedescription</key> <string>this app utilize location services.</string>

in implementation file :

in viewdidload : locationmanager = [[cllocationmanager alloc] init]; locationmanager.delegate = self; locationmanager.desiredaccuracy = kcllocationaccuracybest; locationmanager.distancefilter = kcldistancefilternone; [locationmanager requestalwaysauthorization]; [locationmanager startupdatinglocation];

but none of below methods beingness called.

- (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation - (void)mapview:(mkmapview *)mapview didupdateuserlocation:(mkuserlocation *)userlocation

what i'm missing?

check post.

- (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation

the above delegate deprecated in ios 6. used next instead:

- (void)locationmanager:(cllocationmanager *)manager didupdatelocations:(nsarray *)locations

edit

do not set mapview.showuserlocation yes before receiving authorization via locationmanager:didupdatelocations:

set way:

- (void)locationmanager:(cllocationmanager *)manager didupdatelocations:(nsarray *)locations { self.mapview.showuserlocation = yes; [locationmanager stopupdatinglocation]; }

ios ios8 mkmapview cllocationmanager

No comments:

Post a Comment