I'm attempting several methods trying to enable/disable Wi-Fi (toggle). Here are some things I am trying:
//Enable
WiFiManagerClientEnable(WiFiManagerClientCreate(kCFAllocatorDefault, 0));
//Disable
WiFiManagerClientDisable(WiFiManagerClientCreate(kCFAllocatorDefault, 0));
-and-
//Enable
WiFiManagerClientSetProperty(WiFiManagerClientCreate(kCFAllocatorDefault, 0), @"AllowEnable", kCFBooleanTrue);
//Disable
WiFiManagerClientSetProperty(WiFiManagerClientCreate(kCFAllocatorDefault, 0), @"AllowEnable", kCFBooleanFalse);
Each of those end up crashing the app, even though I have an exception function (@try{}). I've imported the MobileWiFi.framework and everything, just cant seem to get this to work. Are these the correct methods I need to call to be able to enable/disable Wi-Fi?
NOTE: NOT FOR APP STORE :-)
Fing is the #1 Network Scanner: discovers all the devices connected to your WiFi and identifies them, with our patented technology used also by router manufacturers and antivirus companies worldwide.
Select Wi-Fi in the iPhone's settings to turn on the Wi-Fi. Tap Direct-xx-BRAVIABRAVIABravia (stylized as BRAVIA) is a brand of Sony Visual Products Inc., a wholly owned subsidiary of Sony Corporation, and used for its television products. Its backronym is "Best Resolution Audio Visual Integrated Architecture".https://en.wikipedia.org › wiki › Bravia_(brand)Bravia (brand) - Wikipedia on the iPhone's screen to display the password input screen. Enter the WPA key (password) displayed on the TV screen, then tap Join. Allow a few minutes for the connection to be established, and the Settings screen to appear.
notify_post("com.yourcompany.yourapp.yournotification");
#import <SpringBoard/SBWiFiManager.h>
HOOK(SpringBoard, applicationDidFinishLaunching$, void, id app) {
//Listen for events via DARWIN NOTIFICATION CENTER
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL,
&NotificationReceivedCallback, CFSTR("com.yourcompany.yourapp.yournotification"), NULL,
CFNotificationSuspensionBehaviorCoalesce);
}
//THIS IS WHERE THE MAGIC HAPPENS
static void NotificationReceivedCallback(CFNotificationCenterRef center,
void *observer, CFStringRef name,
const void *object, CFDictionaryRef
userInfo)
{
[[objc_getClass("SBWiFiManager") sharedInstance] setWiFiEnabled:NO];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With