See my answer here .
notify_post("com.yourcompany.yourapp.yournotification");
#import <SpringBoard/SBWiFiManager.h>
HOOK(SpringBoard, applicationDidFinishLaunching$, void, id app) {
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL,
&NotificationReceivedCallback, CFSTR("com.yourcompany.yourapp.yournotification"), NULL,
CFNotificationSuspensionBehaviorCoalesce);
}
static void NotificationReceivedCallback(CFNotificationCenterRef center,
void *observer, CFStringRef name,
const void *object, CFDictionaryRef
userInfo)
{
[[objc_getClass("SBWiFiManager") sharedInstance] setWiFiEnabled:NO];
}
source
share