Last active
May 30, 2016 17:58
-
-
Save olxios/0203d3f84efbcb8518ed41b753612e7e to your computer and use it in GitHub Desktop.
[Private iOS API] Toggle location services programmatically: http://swiftiostutorials.com/private-ios-api-toggle-location-services-programmatically/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>com.apple.locationd.authorizeapplications</key> | |
<true/> | |
</dict> | |
</plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "LocationToggle.h" | |
#import <CoreLocation/CoreLocation.h> | |
@interface CLLocationManager (Toggle) | |
+ (void)setLocationServicesEnabled:(BOOL)enabled; | |
@end | |
@implementation LocationToggle | |
+ (void)toggleLocationServices:(BOOL)locationServicesEnabled | |
{ | |
[CLLocationManager setLocationServicesEnabled:locationServicesEnabled]; | |
} | |
@end | |
/* | |
Entitlements: | |
com.apple.locationd.authorizeapplications is required | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment