You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1 line
5.7 KiB

  1. {"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"identifier":{"url":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/NetworkMonitor\/getNetworkInfo(completionHandler:)","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"Gets the network information, including BSSID and SSID."}],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"kind":"text","text":" "},{"text":"getNetworkInfo","kind":"identifier"},{"text":"(","kind":"text"},{"kind":"externalParam","text":"completionHandler"},{"kind":"text","text":": "},{"text":"@escaping","kind":"attribute"},{"kind":"text","text":" (["},{"preciseIdentifier":"s:SS","kind":"typeIdentifier","text":"String"},{"kind":"text","text":" : "},{"kind":"keyword","text":"Any"},{"kind":"text","text":"]) -> "},{"kind":"typeIdentifier","preciseIdentifier":"s:s4Voida","text":"Void"},{"kind":"text","text":")"}],"languages":["swift"],"platforms":["iOS"]}]},{"parameters":[{"name":"completionHandler","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Closure to handle the network information."}]}]}],"kind":"parameters"},{"content":[{"text":"Discussion","level":2,"type":"heading","anchor":"discussion"},{"type":"codeListing","syntax":"swift","code":["func getNetworkInfo(completionHandler: @escaping ([String: Any]) -> Void) {"," var currentWirelessInfo: [String: Any] = [:]"," "," if #available(iOS 14.0, *) {"," NEHotspotNetwork.fetchCurrent { network in"," guard let network = network else {"," completionHandler([:])"," return"," }"," "," let bssid = network.bssid"," let ssid = network.ssid"," currentWirelessInfo = [\"BSSID\": bssid, \"SSID\": ssid]"," completionHandler(currentWirelessInfo)"," }"," } else {"," #if !TARGET_IPHONE_SIMULATOR"," guard let interfaceNames = CNCopySupportedInterfaces() as? [String] else {"," completionHandler([:])"," return"," }"," "," guard let name = interfaceNames.first, let info = CNCopyCurrentNetworkInfo(name as CFString) as? [String: Any] else {"," completionHandler([:])"," return"," }"," "," currentWirelessInfo = info"," #else"," currentWirelessInfo = [\"BSSID\": \"c8:3a:35:4c:85:d0\", \"SSID\": \"Tenda_4C85D0\"]"," #endif"," completionHandler(currentWirelessInfo)"," }","}"]}],"kind":"content"}],"variants":[{"paths":["\/documentation\/fueling\/networkmonitor\/getnetworkinfo(completionhandler:)"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/NetworkMonitor"]]},"kind":"symbol","metadata":{"externalID":"s:7Fueling14NetworkMonitorC03getB4Info17completionHandleryySDySSypGc_tF","role":"symbol","modules":[{"name":"Fueling"}],"title":"getNetworkInfo(completionHandler:)","roleHeading":"Instance Method","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"text":"getNetworkInfo","kind":"identifier"},{"kind":"text","text":"("},{"kind":"externalParam","text":"completionHandler"},{"kind":"text","text":": (["},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"},{"kind":"text","text":" : "},{"kind":"keyword","text":"Any"},{"text":"]) -> ","kind":"text"},{"text":"Void","preciseIdentifier":"s:s4Voida","kind":"typeIdentifier"},{"text":")","kind":"text"}],"symbolKind":"method"},"references":{"doc://rpm.com.production.Scanner/documentation/Fueling":{"kind":"symbol","url":"\/documentation\/fueling","title":"Fueling","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","abstract":[{"type":"text","text":"The Scanner app is designed to facilitate secure and efficient fuel management operations, primarily focusing on user authentication, fuel data collection, and network communication. The app includes several key features to ensure seamless and reliable interactions between users and the backend systems, leveraging technologies like WebSockets, Core Data, and biometric authentication."}],"type":"topic","role":"collection"},"doc://rpm.com.production.Scanner/documentation/Fueling/NetworkMonitor":{"navigatorTitle":[{"text":"NetworkMonitor","kind":"identifier"}],"url":"\/documentation\/fueling\/networkmonitor","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/NetworkMonitor","kind":"symbol","title":"NetworkMonitor","role":"symbol","fragments":[{"text":"class","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"NetworkMonitor"}],"type":"topic","abstract":[{"type":"text","text":"A class that monitors network connectivity, particularly WiFi."}]},"doc://rpm.com.production.Scanner/documentation/Fueling/NetworkMonitor/getNetworkInfo(completionHandler:)":{"url":"\/documentation\/fueling\/networkmonitor\/getnetworkinfo(completionhandler:)","fragments":[{"kind":"keyword","text":"func"},{"text":" ","kind":"text"},{"text":"getNetworkInfo","kind":"identifier"},{"kind":"text","text":"("},{"text":"completionHandler","kind":"externalParam"},{"kind":"text","text":": (["},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"text":" : ","kind":"text"},{"kind":"keyword","text":"Any"},{"text":"]) -> ","kind":"text"},{"kind":"typeIdentifier","preciseIdentifier":"s:s4Voida","text":"Void"},{"text":")","kind":"text"}],"type":"topic","role":"symbol","kind":"symbol","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/NetworkMonitor\/getNetworkInfo(completionHandler:)","title":"getNetworkInfo(completionHandler:)","abstract":[{"type":"text","text":"Gets the network information, including BSSID and SSID."}]}}}