I want to detect whether the user has enabled hotspot/tethering on an iOS device. I can use private APIs, knowing it wont make it to the app store.
I was trying to go through private APIs list/runtime headers, but there are too many to decide which might be helpful. I'm trying to find where UIApplicationWillChangeStatusBarFrameNotification gets fired from in private APIs (probably called for active call and activated hotspot, etc.)
I tried detect personal hotspot and also used CaptiveNetwork, but it only returns the connected WiFi SSID, not the created hotspot.
With the above code the compiler shows the error
SCDynamicStoreCreate is unavailable: not available on iOS.
So I went into SCDynamicStore.h and changed the following:
SCDynamicStoreRef SCDynamicStoreCreate ( CFAllocatorRef allocator, CFStringRef name, SCDynamicStoreCallBack callout, SCDynamicStoreContext *context ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA); to:
SCDynamicStoreRef SCDynamicStoreCreate ( CFAllocatorRef allocator, CFStringRef name, SCDynamicStoreCallBack callout, SCDynamicStoreContext *context ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_6_0); Now I am able to get the dictionary with the states 1022 and 1023.
By changing the file like this, will I have any problem in archiving the build (or any other problem) other than the fact that we know this code won't make it to the app store?