Wednesday, 14 March 2018

cllocationmanager - tvos Location Services prompt never prompted



Have anyone gotten CLLocationManager to prompt for permission on tvos? I'm using the following code (that works on other platforms) to get a user's location and prompt for permissions.




self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
self.locationManager.delegate = self;
[self.locationManager requestWhenInUseAuthorization];
[self.locationManager requestLocation];


However, the authorization delegate is called with a status of kCLAuthorizationStatusNotDetermined.




If I go into Settings > Privacy > Location Services > App Name, I can manually change permission and then getting a user's location works. However, I'm unable to prompt the user within the app. Has anyone else gotten this to work?


Answer



It turns out my info.plist needed CFBundleDisplayName in order to show the location services prompt. Adding this enabled the ability to prompt the user.


No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...