detect hotspot enabling in iOS with private api's

admin

Administrator
Staff member
ok so i want to detect weather the user has enabled hotspot/tethering or not in a iOS device. I can use private api's knowing it wont make it to the app store.

i was trying to go through <a href="https://github.com/nst/RuntimeBrowser/" rel="nofollow">private api's list/ runtime headers</a> but there are too many to decide which might be helpful.

or if i could get to know where <strong><em>UIApplicationWillChangeStatusBarFrameNotification</em></strong> gets fired from in private api's(probably called for active call and activated hotspot etc)

i tried this <a href="https://jorudolph.wordpress.com/2011/07/22/ios-detect-personal-hotspot/" rel="nofollow">detect personal hotspot</a> and also used <strong><em>CaptiveNetwork</em></strong> but it only returns the connected wi-fi ssid and not the created hotspot.

any knowledge shared will be extremely helpful

<strong><em>Update: @creker</em></strong>

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

Code:
    SCDynamicStoreRef
SCDynamicStoreCreate            (
                    CFAllocatorRef          allocator,
                    CFStringRef         name,
                    SCDynamicStoreCallBack      callout,
                    SCDynamicStoreContext       *context
                    )               __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA);

<strong><em>to</em></strong>

Code:
    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. Just wanted to confirm by changing the file like this(not done before) will i have any problem in archiving build(or any other problem) other then the fact that we know this code won't make it to the app store