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

CBATTErrorDomain Code=14 "Peer removed pairing information"
Hi,I have been working with CoreBluetooth for a while now and I've never run into this error before. This error occurred when I tried connecting to my desired peripheral. I've pasted the error message below:Domain=CBATTErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information}I've tried to connect with the peripheral using a third-party app on the Android platform, and it works fine. However, third-party application on iOS isn't able to connect to this peripheral. It timeout when connecting on the iOS platform with the third-party app.I'm not sure what the source of this error is, or how to go about solving this error?Thanks!
9
0
8.9k
May ’20
Support of HTTPS keyword in PAC file
I've tried several functions for executing a proxy autoconfiguration script to determine the best proxy to use to retrieve a specified URL CFNetworkCopyProxiesForAutoConfigurationScript CFNetworkExecuteProxyAutoConfigurationURL CFNetworkExecuteProxyAutoConfigurationScript And they all seems to ignore HTTPS keyword in PAC file function FindProxyForURL(url, host) { 		return "HTTPS ...";		 } That seems to be only way to use HTTPS proxy. Can someone please confirm this?
3
0
933
Jul ’20
How to activate NEPacketTunnelProvider?
Looking over the SimpleTunnel code example, how is the subclassed NEPacketTunnelProvider being used and the startTunnel() function being called? I've looked over the documentation and watched the "What's New in Network Extension and VPN" WWDC15 video and I'm not sure how it's actually started. When I do a search for "PacketTunnelProvider" I don't see any references outside the file itself aside from the NSExtensionPrincipalClass entry in the associated Info.plist. Is creating this file and having it present in a system extension enough to "activate" the PacketTunnelProvider class and call startTunnel()? What else must be done? The SimpleTunnel example uses an App Extension since it's targeting iOS. Am I correct in thinking that for the macOS it should be a System Extension?
13
0
2k
Sep ’20
Filtering IPPROTO_ICMP and IPPROTO_RAW using NetworkExtension
Hi, I am trying to create an app that filters network events - whether to collect statistics, or to even block some specific flows. I see that using NEFilterDataProvider I am able to only filter UDP or TCP protocols (when filtering by .any, I see I only receive UDP/TCP). For example, I wish to see the flow of a simple ping 1.1.1.1. This of course makes the statistics partial (without ICMP packet/raw socket packets), or the flow block being bypass-able (even if with some effort), by using Raw sockets. Is there a way to add to the filtering also ICMP and RAW flows? Should I use a different provider for those?
12
0
1.6k
Oct ’20
Local Network Privacy FAQ
I regularly get asked questions about local network privacy. This is my attempt to collect together the answers for the benefit of all. Before you delve into the details, familiarise yourself with the basics by watching WWDC 2020 Session 10110 Support local network privacy in your app. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" Local Network Privacy FAQ With local network privacy, any app that wants to interact with devices on your network must ask for permission the first time that it attempts that access. Local network privacy is implemented on iOS, iPadOS, and the current visionOS beta. It’s not implemented on other platforms, including macOS and tvOS. Some common questions about local network privacy are: FAQ-1 What is a local network? FAQ-2 What operations require local network access? FAQ-3 What operations require the multicast entitlement? FAQ-4 Do I need the multicast entitlement? FAQ-5 I’ve been granted the multicast entitlement; how do I enable it? FAQ-6 Can App Clips access the local network? FAQ-7 How does local network privacy work with app extensions? FAQ-8 How do I explicitly trigger the local network privacy alert? FAQ-9 How do I tell whether I’ve been granted local network access? FAQ-10 How do I use the unsatisfied reason property? FAQ-11 Do I need a local network usage description property? FAQ-12 Can I test on the simulator? FAQ-13 Once my app has displayed the local network privacy alert, how can I reset its state so that it shows again? FAQ-14 How do I map my Multipeer Connectivity service type to an entry in the Bonjour services property? FAQ-15 My app presents the local network privacy alert unexpectedly. Is there a way to track down the cause? FAQ-16 On a small fraction of devices my app fails to present the local network privacy alert. What’s going on? FAQ-17 Why does local network privacy get confused when I install two variants of my app? FAQ-18 Can my app trigger the local network privacy alert when the device is on WWAN? Revision History 2023-10-31 Fixed a bug in the top-level FAQ that mistakenly removed some recent changes. Added FAQ-18. 2023-10-19 Added a preamble to clarify that local network privacy is only relevant on specific platforms. 2023-09-14 Added FAQ-17. 2023-08-29 Added FAQ-16. 2023-03-13 Added connecting a UDP socket to FAQ-2. 2022-10-04 Added screen shots to FAQ-11. 2022-09-22 Fixed the pointer from FAQ-9 to FAQ-10. 2022-09-19 Updated FAQ-3 to cover iOS 16 changes. Made other minor editorial changes. 2020-11-12 Made a minor tweak to FAQ-9. 2020-10-17 Added FAQ-15. Added a second suggestion to FAQ-13. 2020-10-16 First posted.
0
0
15k
Oct ’20
Local Network Privacy FAQ-15
This post is part of the Local Network Privacy FAQ - https://developer.apple.com/forums/thread/663858. My app presents the local network privacy alert unexpectedly. Is there a way to track down the cause? If the alert is correlated with something you do in your app then you can step through your code to see what triggers it. However, in some cases this won’t help. For example, some third-party libraries automatically run code in your app that triggers the local network privacy alert. One option here is to start removing any third-party libraries from your app until you figure out which one is triggering it, and then raise this issue with the library’s vendor. If you get completely stuck then start a new thread here on DevForums - https://developer.apple.com/forums/ and I’ll try to help out there. Make sure to tag your thread with one of the standard networking tags (Bonjour, CFNetwork, or Network). Back to the FAQ - https://developer.apple.com/forums/thread/663858
1
0
2.7k
Oct ’20
NWConnection how to force ipv4 ?
 I have the following code to force the connectivity over cellular and it works perfectly 	 let tcpOptions = NWProtocolTCP.Options()     tcpOptions.connectionTimeout = 5     var tlsOptions: NWProtocolTLS.Options?     var port = 80     if (url.scheme!.starts(with:"https")) {       port = 443       tlsOptions = .init()     }     /*force network connection to cellular only*/     let params = NWParameters(tls: tlsOptions , tcp: tcpOptions)     params.requiredInterfaceType = .cellular     params.prohibitExpensivePaths = false     params.prohibitedInterfaceTypes = [.wifi]     /* create network connection */     connection = NWConnection(host: NWEndpoint.Host(url.host!), port: NWEndpoint.Port(rawValue: UInt16(port))!, using: params) Now I'm looking to force the connection to use ipv4 (even if the phone has an ipv6 available) because the targeted server has a broken ipv6 support and I don't have control over it (it belongs to a mobile operator) Any idea? E
10
0
2.8k
Nov ’20
Bluetooth ANCS don't send ringing alarm clock and countdown timer
Hello everyone, sorry for my ignorance about it, with ANCS I managed to get all the notifications except the alarm that rings and the timer expired, where am I wrong? do they travel on other channels like gatt? if yes can someone help me understand how to receive these 2 information? the alarm goes off and the timer expired? Thanks in advance to everyone who will help me, Marco.
1
0
1.2k
Dec ’20
Bonjour for discovering a specific device's ip
Hi, I'm new to swift programming and right now writing an app for esp8266-controlled lamp device. My lamp is broadcasting it's own IP through bonjour. So all I want is to discover any lamps in my network (http.tcp) and to read name and value. Is there any example of such implementation? All I found so far is old or a lit bit complicated for such simple question. Thanks in advance!
26
0
11k
Feb ’21
When "Family Control" will be available for AppStore and AdHoc distribution?
Hello! Does anybody know release date of "Family Control" capability for Distribution? iOS 15 was released, but "Family Control" is still available only for Development Distribution: We can't create Distribution provision profile for testing via TestFlight right now. Furthermore we can't proof that Content Filter Providers will be work on authorized Family Control devices without any restrictions and additional setup (see Content Filter Providers with Family Control app)
6
0
3.1k
Sep ’21
URLSession.uploadTask withFile When can file be deleted
Since I am uploading in the background, I need to save the request body off in a file. The documentation says this gets copied to a temporary storage area and uploaded from there. When can I delete the temporary file I generated? Deleting it just after the call to session.uploadTask(with: request, fromFile: filePath) seems to be a race condition where I will occasionally get a sharing violation deleting the file. Do I have to keep my temporary file around until DidCompleteWithError or DidReceiveData is called? I ask because I'm uploading an existing photo, so I have to generate a multi-part form file with the photo embedded, then iOS makes a copy of that file. This results in having the photo in storage on the device three times. We are uploading photos from an Event so there will be several hundred, so Im worried about device storage running out. Todd
5
0
737
Dec ’21
PDFKit Crash Problem
Recently, our app crash monitor detect a lot of PDFKit crash problem at iOS 15.3: MACH_Exception EXC_BREAKPOINT EXC_ARM_BREAKPOINT fault_address:0x00000001809a52d8 Thread 67 name: PDFKit.PDFTilePool.workQueue 0 CoreFoundation _CFRetain (in CoreFoundation) 1 CoreGraphics _CGColorRetain (in CoreGraphics) 2 PDFKit -[PDFPage _drawWithBox:inContext:withRotation:isThumbnail:withAnnotations:withBookmark:withDelegate:] (in PDFKit) 3 PDFKit -[PDFPage drawWithBox:inContext:isThumbnail:] (in PDFKit) 4 PDFKit -[PDFView drawPage:toContext:] (in PDFKit) 5 PDFKit -[PDFTilePool _renderTileForRequest:] (in PDFKit) 6 libdispatch.dylib __dispatch_call_block_and_release (in libdispatch.dylib) 7 libdispatch.dylib __dispatch_client_callout (in libdispatch.dylib) 8 libdispatch.dylib __dispatch_lane_serial_drain (in libdispatch.dylib) 9 libdispatch.dylib __dispatch_lane_invoke (in libdispatch.dylib) 10 libdispatch.dylib __dispatch_workloop_worker_thread (in libdispatch.dylib) 11 libsystem_pthread.dylib __pthread_wqthread (in libsystem_pthread.dylib) 12 libsystem_pthread.dylib _start_wqthread (in libsystem_pthread.dylib) It crash at the thread: PDFKit.PDFTilePool.workQueue Anyone got the same problem? Is there any solutions for this problem?
6
3
1.8k
Mar ’22
iOS HTTP Proxy Settings Ineffective
My issue: I go through Settings>Wi-fi>The i button next to my network name>Configure Proxy>Manual. When entering my proxy's hostname, port and authentication, everything seems fine. It allows me to save the info and gives me no error prompts. However, the proxy does not actually work. The same one works perfectly when using chrome extensions to connect to it. I am 100% sure I am entering the information correctly. Questions: Does anyone else experience this issue? If so, do you know of why? If so, do you know a workaround? Device Info: iPhone Xs on iOS 15.4.1 (this issue has persisted since I first tried on 14.8, and was not fixed by installing the update.) Network Info: IP and DNS are on automatic configuration
6
1
5.4k
May ’22
Network Extension Resources
General: DevForums tag: Network Extension Network Extension framework documentation Network Extension and VPN Glossary DevForums post Debugging a Network Extension Provider DevForums post Exporting a Developer ID Network Extension DevForums post Network Extension vs ad hoc techniques on macOS DevForums post Extra-ordinary Networking DevForums post Wi-Fi management: Wi-Fi Fundamentals DevForums post TN3111 iOS Wi-Fi API overview technote How to modernize your captive network developer news post iOS Network Signal Strength DevForums post See also Networking Resources. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
1.9k
Jun ’22
How to use PDFPageOverlayViewProvider?
I'm trying to use PDFPageOverlayViewProvider by copying the code provided in the "What's new in PDFKit" WWDC22 session here: https://developer.apple.com/videos/play/wwdc2022/10089/ I've copied the method implementations and set my pdfView's pageOverlayViewProvider property to the view where I implemented the protocol. However, when I try to run my app, the pdfView(_ view: PDFView, overlayViewFor page: PDFPage) method is never getting called. Has anyone been able to get this working successfully?
5
1
2.7k
Jun ’22
tvOS libquic.dylib not found
When debugging a tvOS application that calls Data(contentsOf: URL) I get an error: nw_protocol_get_quic_image_block_invoke dlopen libquic failed: dlopen(/usr/lib/libquic.dylib, 0x0005): tried: [...a number of folders it tried to find the file in...]. I found similar problems here (https://developer.apple.com/forums/thread/693245), but it is not equal, nor does it have a solution. Any suggestions on how to fix this? I also tried to copy a libquic.tbd file present in other simulators to one of the paths it looks for (a suggestion somewhere on StackOverflow), but it does not help unfortunately.
11
0
2.4k
Jul ’22
Start An NEPacketTunnelProvider Fail
My App is a VPN APP, use [com.apple.networkextension.packet-tunnel] extension app to provider a VPN service. A problem puzzled me for a long time: Sometimes the VPN doesn't start successfully, until the user restart the iOS System or reinstall my APP. The detail is : The user use the app normally for many times, and suddenly can't start the vpn service, the APP log show API "startVPNTunnelWithOptions" call success, and return success. but the VPN extension status(NEVPNStatus) change from Disconnect to Connecting and then nothing happen, the VPN process not started, and not any log of the VPN extension created, my VPN log is start from the init function of the class inherit from PacketTunnelProvider, so can see that the vpn process not started. My NETunnelProviderProtocol is : NETunnelProviderProtocol *tunnel = [[NETunnelProviderProtocol alloc] init]; tunnel.providerBundleIdentifier = kTunBundleId; tunnel.serverAddress = @""; tunnel.disconnectOnSleep = NO; [self.providerManager setEnabled:YES]; [self.providerManager setProtocolConfiguration:tunnel]; self.providerManager.localizedDescription = kAppName; very simple, because my app use openvpn3 to provide the vpn service,so no need to set the serverAddress. Because when this problem happened, I can't get any useful log (because APP can't get the iOS system log), so this is a really trouble for me. Could any body help !
5
0
1.2k
Aug ’22
iOS 16 CTCarrier deprecation
For iOS 16.X, CTCarrier will be deprecated. https://developer.apple.com/documentation/coretelephony/ctcarrier ①Could someone tell me why CTCarrier will be deprecated? ②What will be the correct way, going forward, to receive information regarding carrier information such as mobileCountryCode, mobileNetworkCode?
32
7
18k
Sep ’22