Jonny Wilson
Jonny Wilson

Reputation: 177

Asking user permission for accessing their location with iOS when mapView does

I've developed an app using a MapView - when the app starts up, it asks the user to allow their location to be accessed/used without any coding from me. Is this sufficient for permission or should I also specifically ask the user and provide a reason for the access? Will Apple reject the app on submission if I don't specifically make the request and allow the MapView to request this on my behalf?

Upvotes: 4

Views: 5210

Answers (3)

Jon Deokule
Jon Deokule

Reputation: 1646

As of iOS 6, the correct place for the "purpose" message is in the Info plist file.

The NSLocationUsageDescription property should be set with the message to display to users

Apple provides good documentation: https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html

Upvotes: 10

progrmr
progrmr

Reputation: 77271

You don't need to ask the user for permission, iOS does it for you automatically.

You should set the purpose string property in the CLLocationManager object so that when the system asks it can also tell the user why you want their location.

locationManager.purpose = @"Location needed to show zombies that are nearby.";

Set this property before calling startUpdatingLocation so that it gets shown to the user in the system alert that asks for permission to use location.

In the delegate you can implement the method locationManager:didChangeAuthorizationStatus: to know whether the user allowed core location or not.

Upvotes: 11

Steve Moser
Steve Moser

Reputation: 7807

You don't need to tell the user why their location is being accessed especially if the application is based on location and mapping. With that said it is nice to tell the user what exactly you will do with their data before the permission popup comes up so that hopefully more users will accept.

Upvotes: 0

Related Questions