Using Private API To read WiFi RSSI Value
I ended up using this workaround:
+ (int) wifiStrength {
UIApplication *app = [UIApplication sharedApplication];
NSArray *subviews = [[[app valueForKey:@"statusBar"] valueForKey:@"foregroundView"] subviews];
NSString *dataNetworkItemView = nil;
for (id subview in subviews) {
if([subview isKindOfClass:[NSClassFromString(@"UIStatusBarDataNetworkItemView") class]]) {
dataNetworkItemView = subview;
break;
}
}
return[[dataNetworkItemView valueForKey:@"wifiStrengthRaw"] intValue];
}
Works without any entitlements or jailbreaking
How to use iOS CNCopyCurrentNetworkInfo to read WIFI signal strength (RSSI)?
if you want to be App Store conform I see no way -- there is no public api for that
the answer here mentioned a C function that does what you want but it isn't public api:
Accessing iPhone WiFi Information via SDK
further info on how to use that function:
Accessing & Using the MobileWiFi.framework
NOTE: private api may break at any point and this might even be broken already anyways
CCNCopyCurrentNetworkInfo
won't help you AFAIK -- you CAN misuse the captive networks API to get the current SSID but I don't see how it could get you the RSSI
Reading Rssi value without connecting any wi-fi
In conjunction with the previous answer, you can add code inside of the following timer to check it every few seconds. Of course you can modify how long you want the timer to execute.
var timer = new Timer();
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = 2000; //2 seconds
timer.Start();
void timer_Tick(object sender, EventArgs e)
{
..your code here..
}
Related Topics
Build Video from Uiimage Using Swift
Get Sms Broadcast with Text Body Without Jailbreak But Private Frameworks in iOS
Array of Multiple Url's Nsfilemanager Swift
Itunes Connect: Can't See Build
Disabling Some Files in Xcode Project from Compilation
Detecting Tap Inside a Bezier Path
Arkit Session Paused and Not Resuming
Usage of String.Range in Swift 3.0
Cannot Create PDF Document with 400+ Pages on iOS
How to Show "Would Like to Send You Push Notifications" Alert View Again
Uiscrollview with Dynamically Sized Content
How to Only Override a Method Depending on the Runtime System iOS Version
Access Iphone's Built-In Ringtones