Chris Chen
Chris Chen

Reputation: 5407

how to navigate user to Location Service in system preferences

i want to know if it's possible to implement following behaviors:

take system app "Map" for instance: 1. user turned off location service from system preferences 2. user runs Map app 3. Map app will detect that location service is disabled, it pops an alert. if user clicks on the ok button from the alert view, it will redirect to Location Service settings in system references.

I just want to know how to do step 3 in my app

PS: i know the code to detect if locatio service is enabled or not

many thanks!

Upvotes: 1

Views: 697

Answers (2)

TechValens
TechValens

Reputation: 437

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]];

Upvotes: 0

Vanja
Vanja

Reputation: 4615

This is not recommended behaviour by the iOS Human Interface Guidelines:

"The alert does not allow users to make this change within the app; instead, they must go to Settings and change their preference. This ensures that users are fully aware that they are granting systemwide permission to use their location information."

http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/TechnologyUsage/TechnologyUsage.html#//apple_ref/doc/uid/TP40006556-CH18-SW1

Upvotes: 1

Related Questions