Skip to content

Instantly share code, notes, and snippets.

@aleciogomes
Created October 16, 2014 15:05
Show Gist options
  • Select an option

  • Save aleciogomes/5cabfca21ba67cc99958 to your computer and use it in GitHub Desktop.

Select an option

Save aleciogomes/5cabfca21ba67cc99958 to your computer and use it in GitHub Desktop.
iOS 8 Location Services request
// BEFORE the map actual use (maybe on viewDidLoad) you should call this
// You may change the selector do adequate to your app location use (in use or always)
self.manager = [CLLocationManager new];
SEL requestSelector = NSSelectorFromString(@"requestWhenInUseAuthorization");
if ([self.manager respondsToSelector:requestSelector]) {
((void (*)(id, SEL))[self.manager methodForSelector:requestSelector])(self.manager, requestSelector);
}
<!-- All the string tags can, but shouldn't, be empty -->
<!-- When your app uses location when active (foreground) -->
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used in &apos;Near Me&apos; and &apos;Directions&apos;</string>
<!-- When your app uses location always (including background) -->
<key>NSLocationAlwaysUsageDescription</key>
<string>Used to track your location and inform your GF in case of cheating.</string>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment