System Configuration

RSS for tag

System Configuration allows applications to access a device’s network configuration settings and determine the reachability of the device.

Posts under System Configuration tag

23 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Global IPV6 DNS setting missing on machine with multiple Interface
We have Mac OS VM which has two network interfaces and both are active. In our application we need “State:/Network/Global/IPv6” to do some task but on this machine it seems to be missing, however if we disable one of the interface then the same setting seems to be available and our code works fine. Please find the attached screenshots of working & non-working details:
0
0
19
8h
Keychain Update Prompt Missing After Password Change on macOS 15.0.1
I've encountered an issue with the keychain on macOS 15.0.1. When an admin account changes the password for a non-admin local account, the system should prompt to unlock the login keychain at the next login, giving the user an opportunity to update the keychain password. However, when I attempted to change a local account password using an admin account through system configuration on macOS 15.0.1, the system did not show such a prompt. Instead, it directly created a new login keychain. In the keychain directory, I could see that the old keychain had been renamed to login_rename_X.keychain-db. Additionally, this operation caused the Touch ID and passwords saved in the keychain to be cleared. Does anyone know how to handle this issue so that the local account is prompted to update the keychain password during login?
1
0
181
2w
Apple Time Machine Sequoia 15.0.1
I have two time machines one is a western digital and the other is a Q Nap that ever since I upgraded to Sequoia, I cannot use. It’s an NAS device and Macke says that I have to contact the manufacturer of the product. They’re too old for me to contact them. My MacBook is new and it was working up until I had upgraded to Sequoia so I’m just trying to find out if that is a software glitch or an OS glitch. It is happening on both Max that I have so this is begging me the question that it’s an iOS update causation. It just sits and spins at the Time Machine preparing to back up and that is all that it does the first time it backed up probably until 25% and now it’s just doing this preparing to back up. I also have tried to wipe out the shares on both NAS machines and deleted the the files within the share to set it up again, and it still does not work.
2
0
234
3w
Fetch workgroup / active directory domain name programatically in Obj-C / Swift
Previously, I used to have the below code to get workgroup / domain name of the active directory service provider. SCDynamicStoreRef storeRef = SCDynamicStoreCreate(NULL, (CFStringRef)@"GetWorkgroup", NULL, NULL); CFPropertyListRef global = SCDynamicStoreCopyValue (storeRef,CFSTR("State:/Network/Global/SMB")); id workgroup = [(__bridge NSDictionary *)global valueForKey:@"Workgroup"]; On few Macs (probably starting from Sonoma), the workgroup property is not set. What is the alternative to get this information programatically?
1
0
170
Oct ’24
API to fetch dhcpv6 information
I am trying to fetch DHCP server identifiers of the current network. For IPv4 I am able to get this information using SCDynamicStoreCopyDHCPInfo and then using DHCPInfoGetOptionData fetching option 54. I am trying to do the same thing for IPv6, in my scutil I do see DHCPv6 present. Is there any API present which fetches this information for v6 DHCP servers, or do I have to get this direct from scutil?
5
0
291
Sep ’24
Simulator unable to connect to localhost, working fine when opened directly in laptop
I am trying to connect to localhost:8081 from simulator, but it is unable to connect with following logs: info 12:07:49.167248+0530 com.apple.WebKit.Networking nw_resolver_host_resolve_callback [C8.1] flags=0x40000003 ifindex=0 error=NoSuchRecord(-65554) hostname=localhost. addr=IN6ADDR_ANY ttl=60 info 12:07:49.167310+0530 com.apple.WebKit.Networking nw_resolver_host_resolve_callback [C8.1] flags=0x40000002 ifindex=0 error=NoSuchRecord(-65554) hostname=localhost. addr=INADDR_ANY ttl=108002 Macos 14.6.1 iOS simulator version 17.5 Som observations localhost:8081 does not load on simulator but 0.0.0.0:8081 loads fine, also 127.0.0.0:8081 loads fine on simulator. My laptop is a managed device with network filter Switching network sometimes fixes the issue. Restarting laptop sometimes fixes the issue. localhost:8081 opens find on laptop, but not on simulator. Contents of my laptop's /etc/hosts: ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost
9
0
819
Oct ’24
Connecting to EAP-PEAP Networks via NEHotspotConfigurationManager
I need to programatically connect to a Enterprise Network with security type EAP-PEAP. NEHotspotEAPSettings *eapSettings = [[NEHotspotEAPSettings alloc] init]; eapSettings.username = username; eapSettings.password = password; eapSettings.supportedEAPTypes = [NSArray arrayWithObjects:[NSNumber numberWithInteger:NEHotspotConfigurationEAPTypeEAPPEAP], nil]; //Inner authentication eapSettings.ttlsInnerAuthenticationType = NEHotspotConfigurationEAPTTLSInnerAuthenticationMSCHAPv2; eapSettings.outerIdentity = @""; //Server name of the network eapSettings.trustedServerNames = @[@"servername"]; if (@available(iOS 11.0, *)) { // Create Hotspot Configuration NEHotspotConfiguration *configuration = [[NEHotspotConfiguration alloc] initWithSSID:ssid eapSettings:eapSettings]; NSLog(@"WIFIManager, NEHotspotConfiguration initialized"); [[NEHotspotConfigurationManager sharedManager] applyConfiguration:configuration completionHandler:^(NSError * _Nullable error) { NSLog(@"WIFIManager, NEHotspotConfiguration Configured"); if (error != nil) { NSLog(@"WIFIManager, NEHotspotConfiguration Error: %@", error); if (error.code == NEHotspotConfigurationErrorAlreadyAssociated) { resolve(@(YES)); } else { reject(@"connection_error", @"Failed to connect to Wi-Fi", error); } } else { resolve(@(YES)); NSLog(@"WIFIManager, NEHotspotConfiguration Success"); } }]; }else { reject(@"ios_error", @"Not supported in iOS<11.0", nil); } } This is the code I have tried to connect to the network. It is always giving a true-negative result. As the documentation states, does NEHotspotConfigurationManager supports EAP-PEAP with MSCHAPv2 inner authentication? If it does, is it the correct way of implementing it? Is there any other way to connect to EAP-PEAP networks using Swift or Objective C?
2
0
413
Jul ’24
ld: symbol(s) not found for architecture arm64
I'm attempting to determine whether there is a currently logged on user via the SCDynamicStoreCopyConsoleUser function. My code look something along the lines of: #include &lt;SystemConfiguration/SystemConfiguration.h&gt; bool isUserLoggedOn() { CFStringRef name = SCDynamicStoreCopyConsoleUser(NULL, NULL, NULL); if (name != NULL) { CFRelease(name); return true; } return false; } I am getting the following error output on compilation: Undefined symbols for architecture arm64: "_CFRelease", referenced from: isUserLoggedOn() in UserInfo.cpp.o "_SCDynamicStoreCopyConsoleUser", referenced from: isUserLoggedOn() in UserInfo.cpp.o ld: symbol(s) not found for architecture arm64
4
0
543
Jul ’24
Ios18 bug on “Help apple improve search”
hey guyss…. Im currently using ios18 developer beta 2 on my iphoen 12…Idk if u guys noticed it or not.. but when i turn off the toggle for “Help improve apple search” (settings->search->help improve apple search) it again turns on without my knowledge seconds aftr i close the page. Ive tried restarting my iphone & many more.. nothing seems to work.. im kindoff a more private guy i usually turn off apple analytics.. usage diagnostics and i always make sure data is stored only on my local storage.. and this bug kinda piss me off 😕. i’ve given u the link below to check it out. Peace. https://youtube.com/shorts/YfVDCA-Dfrs?si=qLcl0mWL-Jm9iJFz
1
1
629
Jul ’24
How to Restrict App from Moving to Background and Prompt User for Exit Confirmation?
Hello Apple Developer Forum, I'm working on an iOS app and need to implement a feature where the app asks the user for confirmation before moving to the background. Specifically, when the user tries to send the app to the background, I want to display an alert asking "Are you sure you want to exit?" and based on their response, either allow the app to move to the background or prevent it from doing so. Could anyone provide a solution or guidance on how to achieve this? Thanks.
2
0
437
Jul ’24
How to detect that WiFi has no internet connection?
In some cases the user connects to a WiFi network that doesn't have internet access. The OS itself is able to display a warning in System Settings: However, in my app NWPathMonitor reports that the WiFi path is satisfied. How could I detect that the internet access is not working while WiFi is connected? I could try to connect to my own servers and report failures to the user, but that takes a long time to receive the timeout error. I cannot reduce the timeout, because maybe the user is on a very slow network and long loading time might be expected. But iOS can detect that there is not internet within a few seconds and display a warning, so I wonder how does Apple implement it in System Settings and if there is something I can implement in my app.
2
0
520
Jul ’24
iOS18 Contacts bug report
Dear developers, I am experiencing a bug with Contacts on my iPhone13 since downloading the beta. Some names in the listing of contacts do not correspond with their card once opened in the Contacts app. The option to share contacts in 3rd party apps has disappeared. Noticed specifically in WhatsApp where my contacts are no longer synced and no longer show against numbers. Best regards
1
0
475
Jul ’24
NEHotspotConfigurationManager removeConfiguration not working consistent
Hey, I'm currently developing an app that uses NEHotspotConfigurationManager to connect to and disconnect from a WiFi network based on user actions. I'm using the following code to connect and disconnect: Connect let configuration = NEHotspotConfiguration(ssid: ssid, passphrase: password, isWEP: false) configuration.joinOnce = true NEHotspotConfigurationManager.shared.apply(configuration) { (error) in if let error = error { print("Error connecting to WiFi network: \(error.localizedDescription)") } else { self.lastSSID = ssid } } Disconnect NEHotspotConfigurationManager.shared.removeConfiguration(forSSID: self.lastSSID) The issue I'm encountering is that the app successfully connects to the WiFi network and disconnects properly the first time. However, after connecting again, the second disconnect attempt fails to disconnect from the WiFi network. I found a similar bug report from 2020 that mentioned this issue. The suggested workaround involved setting joinOnce = false, which is not suitable for my app's requirements.
2
0
581
Jun ’24
Wi-Fi SSID information missing from System Configuration Framework since macOS 14.4
I have a small application (already published to the Mac App Store) to monitor, and notify the user of some important state changes about thier computer. To display Wi-Fi informations, I listening on the "State:/Network/Interface/.*/AirPort" events of the System Configuration framework. Before 14.4, the returned dictionary had an "SSID_STR" property which was contained the connected network name, but from 14.4, if "SSID_STR" are presents, it's will be always an empty string (""). My first idea was to put "NSLocationUsageDescription" into the Info.plist (and enable Location under App Sandbox in the Signing & Capabilities section) and try to request permission with the Core Locations requestWhenInUseAuthorization call, but even if i had the correct permission (.authorizedAlways), this will did not came to success. There are any workaround or entitlement available to get back the access to this information?
2
0
587
Jun ’24
How to disable/disconnect ethernet adapter USB type using Network Framework API for Mac
I have tried networksetup -setnetworkserviceenabled "USB 10/100/1000 LAN" on networksetup -setnetworkserviceenabled "USB 10/100/1000 LAN" off and same with ifconfig cmd sudo ifconfig down sudo ifconfig up I am able to bounces the interfaces with these commands but the network connectivity is not restored properly for USB 10/100/1000 LAN interface May I know is there any other way we can achieve this programmatically using network framework API available for Mac
4
0
524
May ’24
API to parse DHCP option 121 returned from DHCPInfoGetOptionData
I am trying to fetch static routes added on my mac machine by DHCP server. I am able to get DHCP info using SCDynamicStoreCopyDHCPInfo and then get DHCP options using DHCPInfoGetOptionData. However, I could not find any API that can help me parse the raw data returned by DHCPInfoGetOptionData. Since macOS is parsing and adding these static routes and also displaying them in AdditionalRoutes of service, is there any API available to developers to parse this raw data into destination, mask and gateway?
1
0
790
Apr ’24
Network Name (local domain Name) of a Mac (Mac-OS)
I want to get the network-name (domain-name) on my Mac-Machine. Where iin the Settings does this domain name gets configured. I refer to this page which talks about computer name and host name, I could find where my hostname is present (Settings-&amp;gt;General-&amp;gt;Sharing-&amp;gt;local host name) but not anything related to the network-name (local -domain) . Even try to fetch this info using the linux api to getdomainname, api call succeeded but it returns Nothing. #include &amp;lt;iostream&amp;gt; #include &amp;lt;unistd.h&amp;gt; #include &amp;lt;limits.h&amp;gt; #include &amp;lt;cstring&amp;gt; int main() { char domainname[255]; // Get the domain name if (getdomainname(domainname, 255) != 0) { std::cout &amp;lt;&amp;lt; "Error getting domain name" &amp;lt;&amp;lt; std::endl; return 1; } std::cout &amp;lt;&amp;lt; "Domain name: " &amp;lt;&amp;lt; domainname &amp;lt;&amp;lt; std::endl; return 0; } Output Domain name: I even came across Search-Domains, Does it have anything to do with the network-name (domain name of the machine)?
5
0
923
Apr ’24
Challenges Detecting Active Interfaces and IPv4 Changes on macOS with SystemConfiguration Framework
I am encountering an issue while using the SystemConfiguration framework to detect IPv4 address changes and active interfaces on macOS. Specifically, I'm facing difficulties when the interface switches from one network to another. When connected to a network with a Captive Portal enabled, I'm unable to retrieve the active interface using the stored key State:/Network/Global/IPv4. The output I receive is: No such key However, when I attempt to retrieve interface information using scutil --nwi, the output is as follows: IPv4 network interface information No IPv4 states found REACH : flags 0x00000000 (Not Reachable) IPv6 network interface information No IPv6 states found REACH : flags 0x00000000 (Not Reachable) Network interfaces: en0 Despite this output, the interface en0 is active and has a valid IPv4 address: when checking through ifconfig: en0:flags=8b63&lt;UP,BROADCAST,SMART,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST&gt; mtu 1500 options=6460&lt;TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM&gt; ether bc:d0:74:07:2a:33 inet6 fe80::412:ec:40df:4211%en0 prefixlen 64 secured scopeid 0x12 inet 10.42.0.5 netmask 0xffffff00 broadcast 10.42.0.255 nd6 options=201&lt;PERFORMNUD,DAD&gt; media: autoselect status: active It's evident that the interface is active and has a valid IPv4 address, but the retrieval methods using SystemConfiguration framework are not providing the expected output. I'm seeking assistance in resolving this discrepancy and accurately detecting active interfaces on macOS. Any insights or suggestions would be greatly appreciated. Thank you.
1
0
716
Mar ’24