Repository navigation
fix(ios): use only public APIs on iOS - #195
Merged
Merged
Conversation
SCNetworkInterface, SCNetworkService, SCPreferences and SCDynamicStore are API_UNAVAILABLE(ios) in the iOS SDK; App Store review rejects apps that import them. On iOS: - drop the SystemConfiguration interface metadata (friendly name, DHCP hints); apple-system-configuration-extra is now macOS-only - read DNS resolvers through libresolv (res_ninit / res_getservers) - return default IPv6 address flags: the iOS SDK has no SIOCGIFAFLAG_IN6, and libc >= 0.2.190 defines in6_ifreq for macOS only (E0425 on iOS) - link SystemConfiguration.framework on macOS only
Owner
|
Thanks! Switching to public APIs on iOS makes sense, and the metadata limitations are an acceptable trade-off for App Store compatibility. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On iOS, netdev calls SystemConfiguration functions that the iOS SDK marks
API_UNAVAILABLE(ios, tvos, watchos):SCNetworkInterfaceCopyAll,SCNetworkServiceCopyAll,SCPreferencesCreate,SCDynamicStoreCreate,SCDynamicStoreCopyValue(fromos/ios/sc.rsandos/ios/dns.rs, behind the defaultapple-system-configuration-extrafeature). App Store review rejects apps that import them, so apps that get netdev through iroh/netwatch cannot ship there.It also stopped building for iOS with libc >= 0.2.190:
libc::in6_ifreqis macOS-only now (the iOS SDK has nonetinet6/in6_var.h), soos/darwin/ipv6_addr_flags.rsfails with E0425 onaarch64-apple-ios.Changes, iOS only (macOS unchanged):
apple-system-configuration-extrahas no effect on iOS;os/ios/sc.rsis removed, so iOS loses interface friendly names and DHCP hints (no public replacement I know of)res_ninit+res_getservers) instead ofSCDynamicStoreSIOCGIFAFLAG_IN6is not in the iOS SDK)SystemConfiguration.frameworkandobjc2-system-configuration/objc2-core-foundationare macOS-onlyTested:
cargo teston macOScargo clippyforaarch64-apple-iosandaarch64-apple-ios-simwith--all-featuresand--no-default-featuresdefault_interfaceexample in the iOS 27 simulator: default interface, gateway and DNS servers ([fe80::1, 192.168.1.1]) as expected_SC*symbols (nm -u)If you'd rather keep the iOS SystemConfiguration code for apps outside the App Store, I can move it behind a separate, non-default feature instead of removing it.