Why is my CLLocationmanager delegate not getting called?

前端 未结 5 1589
梦谈多话
梦谈多话 2020-12-13 07:34

I\'m not getting any location callbacks on either sim or device. I\'ve got this code being called:

- (void)startLocationCallbacks: (NSObject*) ignore
{
  loc         


        
5条回答
  •  再見小時候
    2020-12-13 07:48

    For iOS 8

    1) I placed these lines right after I init'd the location manager.

    if([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
        [self.locationManager requestAlwaysAuthorization];
    }
    

    2) I added NSLocationAlwaysUsageDescription to the plist and set it to a string and added a message. 3) In my target, I clicked on Capabilities tab, and then turned on Background Modes and checked "Location Updates" and "Uses Bluetooth LE accessories"

    This worked for me

提交回复
热议问题