Skip to content

Instantly share code, notes, and snippets.

@olxios
Last active January 13, 2023 12:59
Show Gist options
  • Save olxios/a52aabece2432bad77520d8b7beeacaf to your computer and use it in GitHub Desktop.
Save olxios/a52aabece2432bad77520d8b7beeacaf to your computer and use it in GitHub Desktop.
/* You can find private iOS frameworks bundled with Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/
In Xcode 7.3 beta private frameworks have been removed from the Xcode bundle. As a workaround you'd have to load the framework at runtime
You can find the reversed CoreTelephony header here: https://raw.githubusercontent.com/Cykey/ios-reversed-headers/master/CoreTelephony/CTCellularDataPlan.h
*/
#import <CoreTelephony/CTCellularDataPlan.h>
@implementation Cellular
+ (void)toggleMobileData:(BOOL)cellularEnabled
{
CTCellularDataPlanSetIsEnabled(cellularEnabled);
}
/*
Entitlements:
CTCellularDataPlanSetIsEnabled needs com.apple.CommCenter.fine-grained entitlement starting with iOS 8.3.
*/
@end
<?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.CommCenter.fine-grained</key>
<array>
<string>spi</string>
</array>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment