قالب وردپرس درنا توس
Home / IOS Development / ios – Get a list of access points and signal strength

ios – Get a list of access points and signal strength



I am currently trying to build a proof-of-concept iOS app to check whether we are able to implement a kind of indoor positioning capability without distributing beacons or other hardware.

What we have

There is a database that contains all registered access points in our building including their X and Y coordinates. The coordinates are mapped to a specially built grid that spans the entire building.

The app will be released using our Enterprise deployment, so there are no restrictions on any Apple Store requirements. The app runs exclusively on devices that automatically connect to the correct WiFi using a certificate.

What we want to build

To improve the usability of the app, we want to show the user his current position. Using Apple's native CLLocation services is not accurate enough because we operate in a building. The basic idea is to retrieve all of the nearby access points including their BSSID and signal strength and calculate a more or less accurate position using both the signal strength and the location database of our access points (see above).

What I have tried so far

User SystemConfiguration.CaptiveNetwork to get BSSID

  import SystemConfiguration.CaptiveNetwork

func getCurrentBSSID () -> String {
guard leave currentInfases = CNCopySupportedInterfaces () as? [String] else {return ""}
for interfaces in currentInterfaces {
print ("Look up BSSID information for (interface)") // no0
let SSIDDict = CNCopyCurrentNetworkInfo (interface as CFString) as! [String : AnyObject]
return the SSIDDict [kCNNetworkInfoKeyBSSID as String] as! string
}
return ""
}
]] to read signal strength 

  private func wifiStrength () -> Int? {
la app = UIApplication.shared
was rssi: Int?
guard leave statusBar = app.value (forKey: "statusBar") as? UIView, leave foregroundView = statusBar.value (forKey: "foregroundView") as? UIV see other {
return rssi
}
for viewing in foregroundView.subviews {
if statusBarDataNetworkItemView = NSClassFromString ("UIStatusBarDataNetworkItemView"), see .isKind (of: statusBarDataNetworkItemView) {
if la val = view.value (forKey: "wifiStrengthRaw") as? Int {
rssi = choice
break
}
}
}
return rssi
}

This is kind of obvious, it only reads the signal strength of the connected WiFi network, not the access point specific.

QUESTION

Is there any way to read a list of available access points ( not WiFi networks) including BSSID and signal strength? We cannot jailbreak the devices since they are under device management.

Maybe there is some way to do it using MobileWiFi.framework (see this link), but I couldn't bother and do it in Swift (kind of a beginner when it comes to iOS development).


Source link