iPhone Wi-Fi Manager SDK

前端 未结 2 391
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 21:37

I\'m attempting several methods trying to enable/disable Wi-Fi (toggle). Here are some things I am trying:

//Enable
WiFiManagerClientEnable(WiFiManagerClient         


        
相关标签:
2条回答
  • 2020-12-09 22:31

    From Application

    notify_post("com.yourcompany.yourapp.yournotification");
    

    From Dylib

    #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];
    }
    
    0 讨论(0)
  • 2020-12-09 22:38

    You cannot disable WiFi on the phone. The user is responsible for this action through the Settings App, this capability is not available through the SDK.

    -t

    0 讨论(0)
提交回复
热议问题