我正在开发一些不需要在App Store上的东西,所以我没有使用私有API来满足我的需求的问题我正在尝试使用MobileWiFi. framework to read the RSSI value for the wireless network the phone is currently connected to. I've included thehttps://github.com/Cykey/ios-reversed -headers/tree/c613e45f3ee5ad9f85ec7d43906cf69ee812ec6a/MobileWiFi`标题并使用桥接头将它们包含在我的swift项目中并编写如下代码.请原谅,我是新手.
import SystemConfiguration.CaptiveNetwork
typealias _WiFiManagerClientCreate = @convention(c) (CFAllocator, CInt) -> UnsafeRawPointer
typealias _WiFiManagerClientCopyDevices = @convention(c) (UnsafeRawPointer) -> CFArray
typealias _WiFiDeviceClientCopyProperty = @convention(c) (UnsafeRawPointer, CFString) -> CFPropertyList
if let libHandle = dlopen (Paths.ipConfiguration, RTLD_LAZY) {
result = libHandle.debugDescription
let _createManagerPtr = dlsym(libHandle, "WiFiManagerClientCreate")
let _clientCopyDevicesPtr = dlsym(libHandle, "WiFiManagerClientCopyDevices")
let _clientCopyPropertyPtr = dlsym(libHandle, "WiFiDeviceClientCopyProperty")
if (_createManagerPtr != nil) …Run Code Online (Sandbox Code Playgroud)