Hi
In the "CaptiveNetwork.h", the "CNCopyCurrentNetworkInfo" is marked as "API_TO_BE_DEPRECATED"
CFDictionaryRef __nullable
CNCopyCurrentNetworkInfo (CFStringRef interfaceName)
API_DEPRECATED_WITH_REPLACEMENT("[NEHotspotNetwork fetchCurrentWithCompletionHandler:]", ios(4.1, API_TO_BE_DEPRECATED), macCatalyst(14.0, API_TO_BE_DEPRECATED))
API_UNAVAILABLE(macos, tvos, watchos, visionos);
But in developer documents, it is marked as "DEPRECATED": https://developer.apple.com/documentation/systemconfiguration/cncopycurrentnetworkinfo
Before we use Xcode 16.2 to archive app, this interface still work on iOS 26 device. But after we changed to Xcode 26.2, this interface return nothing on iOS 26 and we need to use "NEHotspotNetwork" related interface.
My question is:
- Why there are difference between the documents and framework sdk
- how we can know that a interface marked "API_TO_BE_DEPRECATED" or "DEPRECATED", when will they not work totally. Is there a accurate timeline or standard for them? Some interface marked deprecated after 12.0 is still working Now. After knowing the accurate timeline we can plan the interfaces migration.
I’m not sure you actually need an answer to those specific questions. Rather, the lessons you should draw here are:
CNCopyCurrentNetworkInfohas been replaced by thefetchCurrent()routine.- If you’re using the former, it’s well past time for you to switch over to the latter. It’s been available since iOS 14, so there’s really no reason not downside to make the change.
- If the latter is causing problems, you need to investigate those as a separate issue. I’m happy to help with that.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"