Networking

RSS for tag

Explore the networking protocols and technologies used by the device to connect to Wi-Fi networks, Bluetooth devices, and cellular data services.

Networking Documentation

Post

Replies

Boosts

Views

Activity

How to prepare PDF for digital certificate on iOS
I'm looking for guidance on how to prepare a PDF for inserting a digital certificate on iOS without a commercial 3rd party tool. The idea is to... Set up a signature annotation with PDFKit, Set up/prepare the PDF with the required information (contact info, adbe.pkcs7.detached, the Adobe.PPKLite filter , info/annotation reference, the UTC time, etc.) Pad the content area with zeros (I believe it would 4096 Then compute the hash. I am following Adobe's Spec (Acrobat_DigitalSignatures_in_PDF) Would this be possible with parsing out and adding the data from a byte stream? Can I simply build the signature object on my own and place them into the PDF, or are there any other items I need to change. Are there any tools out there that can help me manipulate the data and/or get the document hash easily? For example the data would look something like this is... <</ByteRange [0 552215 560537 907] /ContactInfo (my contact info)/Contents < AREA OF ZERO PADDING FOR CERT INSET) 00>/Filter /Adobe.PPKLite/M (D:20240223095734Z)/Reason (Some reason)/Reference [<</Data 13 0 R/TransformMethod/FieldMDP/TransformParams 39 0 R/Type/SigRef>>]/SubFilter /adbe.pkcs7.detached/Type /Sig>> Thank you
0
0
570
Feb ’24
Detecting that a bluetooth device has been forgotten from the bluetooth setting
Hi, My app allows to connect to a bluetooth device. If the user has multiple devices he can connect all of them simultaneously, the app UI is presenting a list of all paired device. If the user open the phone bluetooth settings and forget one of the paired device, I would like to also remove it from the list of paired devices in displayed in my application. I was expecting CBCentralManager.retrievePeripherals(withIdentifiers:) to return nil if the device has been removed in the bluetooth setting but this function still return a device. Is there another solution to do that ? Thanks
0
0
418
Feb ’24
Content Filter iOS
Hi Community: I want to know (if someone knows) why content filters are only available for: Supervised devices Apps with Screen time, but only for children. Is that make any sense while in Mac is supervision is not needed? Why adults cannot decide to use a built in content filter instead of using screen time pre-filter by them selves? Are they no conscious about what are they doing? Are there any UX question to not open this powerful tool to improve an iOS user experience guided by third parties? Thanks in advance.
2
0
571
Feb ’24
Clear BLE service and characteristics cache
Hi, we're having trouble with a device that changes its services to do firmware updates and does not implement the Service Changed characteristic. I understand that the iPhone caches the services, is it possible to clear this cache, or is it known how long does it last? We unfortunately cannot reset the iPhone as I've seen suggested, as this is the users' phone I'm talking about. Thanks
0
1
365
Mar ’24
NEHotspotNetwork returning BSSID (MAC Address ) are not accurate
I'm using NEHotspotNetwork for getting the WiFi network information , ex - SSID , BSSID and Signal Strength. But the BSSID values are not accurate comparing to the Router MAC Address . The last segment value is different is always from NEHotspotNetwork. Is apple intentionally proving last value differently or do I need to use any other API for getting the MAC address of a router. Example : What I am getting using NEHotspotNetwork : c3:85:63:26:56:ef The actual Mac address of the Network : c3:85:63:26:56:3c
1
0
493
Mar ’24
iOS 17 Simcard Status
In order to get more accurate compass data it seems that iOS devices with a simcard installed can provide better results. To distinguish between data delivered I would like to retrieve a status telling me if there is a simcard available and connected to the mobile network or not. All recommendations are pointing to the deprecated CoreTelephony functions which are obsolete since I am working with iOS17 devices. Is there a way to check if the device uses a simcard or not?
1
0
879
Mar ’24
wifi & proxy settings have disappeared from all iOS phone simulators!
Seems bizarre but since updating to Sonoma (14.2), I've actually lost menu items in the iOS phone simulators. Basically there is no longer any Settings->wifi item in the simulators' menu at all, so I can't do what I've always done & set a manual proxy (in order to use Charles proxy). I've been doing this for years & we generally use about 4 or 5 simulators for testing with Xcode, and now suddenly there's no ability to set a manual proxy on any of them - they have all lost these menu items. Does anyone know what has gone one & how I fix this, please !!!! I can't find info about this via the usual googling. If it makes any difference I'm using Xcode 15.2, 16" MacBook 2019 with intel chipset.
0
0
459
Mar ’24
Inquiry Regarding NEHotspotNetwork fetchCurrent Method
I am reaching out regarding the usage of the fetchCurrent method within the NEHotspotNetwork framework. According to the documentation provided at [https://developer.apple.com/documentation/networkextension/nehotspotnetwork/3666511-fetchcurrent], it is mentioned that in order to utilize this method, the application needs to meet all four of the following conditions: The app is using the Core Location API and has the user’s authorization to access precise location. The app used the NEHotspotConfiguration API to configure the current Wi-Fi network. The app has active VPN configurations installed. The app has an active NEDNSSettingsManager configuration installed. However, upon reviewing the comments in the code for the fetchCurrent method, it states: "This method returns SSID, BSSID, and security type of the current Wi-Fi network when the requesting application meets one of the following 4 requirements -." Could you please clarify whether it is necessary to fulfill all four conditions or if meeting just one of the four requirements is sufficient to use the fetchCurrent method?
1
0
351
Mar ’24
Advanced UDP with Network.framework
I finally found a time to experiment with Network.framework and I find the experience very pleasant. The API looks well thought out and is a pleasure to work with. My app (on the App Store for around 13 years) uses UDP networking to create a mesh between multiple devices where each device acts as a server and client at the same time. It does that by creating one UDP socket on each device bound to a *:<port> and then uses that socket to sendmsg to other peers. That way all peers can communicate with each other using their well known <port>. This all works great and fine. To test the performance and verify the functionality I have multiple XCTestCase scenarios where I create multiple peers and simulate various communications and verify their correctness. Within the XCTestCase process that means creating multiple underlying sockets and then bind them to multiple local random <port>s. Works great. Now I'm trying to port this functionality to Network.framework. Let's assume two peers for now. Code simplified. Prepare NWParameter instances for both peers, plain UDP for now. // NOTE: params for peer 1 let p1 = NWParameters(dtls: nil, udp: .init()) p1.requiredLocalEndpoint = .hostPort(host: "0.0.0.0", port: 2222) p1.allowLocalEndpointReuse = true // NOTE: params for peer 2 let p2 = NWParameters(dtls: nil, udp: .init()) p2.requiredLocalEndpoint = .hostPort(host: "0.0.0.0", port: 3333) p2.allowLocalEndpointReuse = true Create NWListeners for each peer. // NOTE: listener for peer 1 - callbacks omitted for brevity let s1 = try NWListener(using: parameters) s1.start(queue: DispatchQueue.main) // NOTE: listener for peer 2 - callbacks omitted for brevity let s2 = try NWListener(using: parameters) s2.start(queue: DispatchQueue.main) The listeners start correctly and I can verify that I have two UDP ports open on my machine and bound to port 2222 and 3333. I can use netcat -u to send UDP packets to them and correctly see the appropriate NWConnection objects being created and all callbacks invoked. So far so good. Now in that XCTestCase, I want to exchange a packets between peer1 and peer2. So I will create appropriate NWConnection and send data. // NOTE: connection to port 3333 from port 2222 let c1 = NWConnection(host: "127.0.0.1", port: 3333, using: p1) c2.start(queue: DispatchQueue.main) // NOTE: wait for the c1 state .ready c2.send(content: ..., completion: ...) And now comes the problem. The connection transitions to .preparing state, with correct parameters, and then to .waiting state with Error 48. [L1 ready, local endpoint: <NULL>, parameters: udp, local: 0.0.0.0:2222, definite, attribution: developer, server, port: 3333, path satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, uses wifi, service: <NULL>] [L2 ready, local endpoint: <NULL>, parameters: udp, local: 0.0.0.0:3333, definite, attribution: developer, server, port: 2222, path satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, uses wifi, service: <NULL>] nw_socket_connect [C1:1] connectx(6 (guarded), [srcif=0, srcaddr=0.0.0.0:2222, dstaddr=127.0.0.1:3333], SAE_ASSOCID_ANY, 0, NULL, 0, NULL, SAE_CONNID_ANY) failed: [48: Address already in use] nw_socket_connect [C1:1] connectx failed (fd 6) [48: Address already in use] nw_socket_connect connectx failed [48: Address already in use] state: preparing connection: [C1 127.0.0.1:2222 udp, local: 0.0.0.0:2222, attribution: developer, path satisfied (Path is satisfied), interface: lo0] state: waiting(POSIXErrorCode(rawValue: 48): Address already in use) connection: [C1 127.0.0.1:3333 udp, local: 0.0.0.0:2222, attribution: developer, path satisfied (Path is satisfied), interface: lo0] I believe this happens because the connection c1 essentially tries to create under the hood a new socket or something instead of reusing the one prepared for s1. I can make the c1 work if I create the NWConnection without binding to the same localEndpoint as the listener s1. But in that case the packets sent via c1 use random outgoing port. What am I missing to make this scenario work in Network.framework ? P.S. I was able to make it work using the following trick: bind the s1 NWListener local endpoint to ::2222 (IPv6) connect the c1 NWConnection to 127.0.0.1:3333 (IPv4) That way packets on the wire are sent/received correctly. I would believe that this is a bug in the Network.framework. I can open a DTS if more information is needed.
8
0
1.5k
Mar ’24
Frequent sleep and wake events in the Tunnel Provider
Hi! We are investigating the power consumption of our VPN app on iOS. We noticed that while the VPN tunnel is started, we frequently experience sleep and wake events. Depending on the device it varies somewhere between 60 - 600 times during an overnight test where the device is just laying around and doing absolutely nothing. I looked into the system logs, and the wake reason is always this one: 2024-03-01 03:09:00.836588+0200 0x35e96 Default 0x0 50 7 wifid: (WiFiPolicy) [com.apple.WiFiPolicy:] System wake reason: SMC.OutboxNotEmpty smc.70070000 baseband I googled what OutboxNotEmpty means, but I only found several macOS-related topics. Interestingly, when I leave the same phone without a VPN running, I don't see the above log even once during an overnight test. I also tested a different VPN app and saw the above log in the system logs. This makes me think this is either some iOS feature I don't understand or some bug that causes frequent wakeups. I'd appreciate any feedback if this is a known issue or if we need to do something differently within our tunnel implementation.
3
1
686
Mar ’24