Posts

Post not yet marked as solved
1 Replies
241 Views
My App is opening streams like so: var readStream: Unmanaged<CFReadStream>? var writeStream: Unmanaged<CFWriteStream>? CFStreamCreatePairWithSocketToHost(nil, "192.168.42.1" as NSString, &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;UInt32(7878), &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&readStream, &writeStream) self.inputStream = readStream!.takeRetainedValue() self.outputStream = writeStream!.takeRetainedValue() if let inputStream = self.inputStream, let outputStream = self.outputStream { &#9;&#9;self.reader = StreamReader("WiFi", self.responses, onOpened: { successful in &#9;&#9;}) &#9;&#9;self.writer = StreamWriter("WiFi") &#9;&#9; &#9;&#9;CFReadStreamSetDispatchQueue(inputStream, self.workQueue) &#9;&#9;CFWriteStreamSetDispatchQueue(outputStream, self.workQueue) &#9;&#9; &#9;&#9;inputStream.delegate = self.reader &#9;&#9;inputStream.open() &#9;&#9; &#9;&#9;self.writer!.outputStream = outputStream &#9;&#9;outputStream.delegate = self.writer &#9;&#9;outputStream.open() } The StreamReader class has a onOpened callback which is empty here but controls further app flow, like so (in StreamReader): case Stream.Event.errorOccurred:     let e: CFStreamError = aStream.streamError as! CFStreamError     os_log(.default, log: log, "error occured: %{public}s", aStream.streamError?.localizedDescription ?? "")     os_log(.default, log: log, "error occured: %{public}d", aStream.streamStatus.rawValue)     if !opened {         self.onOpened?(false)     }     self.onStopped?() I try to read the raw error code, in order to comply with the local network privacy changes as mentioned in https://developer.apple.com/forums/thread/661606 for example. However, without a way to read the current status, I rely on the return code of the stream callback Stream.Event.errorOccurred. Also really thankful if someone could point me to good documentation on this.
Posted
by sebroth.
Last updated
.
Post marked as solved
6 Replies
1.3k Views
Unfortunately My App won't run anymore because of a missing symbol:dyld: Symbol not found: _NEHotspotConfigurationErrorDomain Referenced from: /private/var/containers/Bundle/Application/905F594E-CBAC-43C6-8B9D-7EF29E3C3E6A/Runner.app/Frameworks/part1.framework/part1 Expected in: /System/Library/Frameworks/NetworkExtension.framework/NetworkExtension in /private/var/containers/Bundle/Application/905F594E-CBAC-43C6-8B9D-7EF29E3C3E6A/Runner.app/Frameworks/dashcam.framework/part1This is a new error and only started showing this morning when I tried compiling our iOS App with Xcode11 GM Seed.Our deployment target is 12.4.Has the symbol moved?
Posted
by sebroth.
Last updated
.
Post marked as solved
6 Replies
4.6k Views
My App is able to communicate with a range of IP cameras. The cameras identify themselves with a specific SSID pattern. The user will be able to connect using the standard iOS settings App and upon return to my App can then use the features of the camera.My viewer App ships with a few SDKs that support each camera manufacturer (at the moment 4). Some of the SDKs are not cheap to load and consume a lot of memory / CPU resources, so I will only load /unload the appropriate SDK upon determing the connected camera based on the SSID.Determining the SSID has been explained in this document:https://developer.apple.com/library/archive/qa/qa1942/_index.html... according to which I should use the CoreNetwork set of functions like CNCopyCurrentNetworkInfo.So, here is my code for detecting the current SSID: public static func fetchSSIDInfo() -&gt; String { var currentSSID = "" if let interfaces = CNCopySupportedInterfaces() { for i in 0..&lt;cfarraygetcount(interfaces) {&lt;br=""&gt; let interfaceName: UnsafeRawPointer = CFArrayGetValueAtIndex(interfaces, i) let rec = unsafeBitCast(interfaceName, to: AnyObject.self) let unsafeInterfaceData = CNCopyCurrentNetworkInfo("\(rec)" as CFString) if unsafeInterfaceData != nil { let interfaceData = unsafeInterfaceData! as NSDictionary currentSSID = interfaceData["SSID"] as! String print ("SSID INFO: actually read SSID from interface: \(currentSSID) ") } else { print ("SSID INFO: no interface data available!") } } } else { print ("SSID INFO: can not copy supported interfaces") } return currentSSID }The code will be called every 1 second during time of connection and then every 2-5 seconds if a device has been connected.Here is a sample output:SSID INFO: no interface data available! SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: can not copy supported interfaces SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: no interface data available! SSID INFO: no interface data available! SSID INFO: no interface data available! SSID INFO: no interface data available! SSID INFO: no interface data available! SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi Network SSID INFO: actually read SSID from interface: Sebastian's Wi-Fi NetworkYou can see the problem. Sometimes, the SSID is detected, sometimes it isn't. The function will be called once a second.This problem gets worse as soon as I connect a actual camera, then load the SDK, just to unload it a few seconds afterwards (based on the loss of correct SSID):SSID INFO: actually read SSID from interface: SOME DEVICE 75B SSID INFO: actually read SSID from interface: SOME DEVICE 75B SSID INFO: actually read SSID from interface: SOME DEVICE 75B SSID INFO: no interface data available! SSID INFO: actually read SSID from interface: SOME DEVICE 75B SSID INFO: actually read SSID from interface: SOME DEVICE 75B SSID INFO: actually read SSID from interface: SOME DEVICE 75B SSID INFO: actually read SSID from interface: SOME DEVICE 75BHappy to hear suggestions.
Posted
by sebroth.
Last updated
.
Post not yet marked as solved
0 Replies
313 Views
My usecase is to connect the iPad/iPhone to a WiFi camera (a car dash cam in this case) and then transfer files, watch a video stream etc.This used to work OK on iOS 10 (and still does work on iOS 10 on a iPad in the office).However, all iOS 11 devices (beta2 first, now beta 4, iPhone 5s or iPhone 7) can not connect to this class of devices anymore.I can see the devices SSID in the list of available networks, and tapping on it will briefly attempt a connection but not complete. The device, as it seems, does not receive the DHCP request even).In the SSID settings ,tapping "Forget Network" forgets it, and reselting it later will prompt for the password.On first attempt, entering the correct password &amp; confirming immediately message "Unable to connect", followed by a crash of the Settings App.Restarting settings App, then reconnecting (password again), seems to work, but my Apps can not connect to the device:2017-08-06 15:54:02.768070+0800 App[11827:2707747] [] nw_endpoint_flow_attach_protocols_block_invoke [55 192.168.1.254:80 in_progress socket-flow (satisfied)] Failed to attach application protocol CFNetworkConnectionThankful for any info.
Posted
by sebroth.
Last updated
.