I need a notification from the system when airport is connecting to an ap. Is there any possibility to do that with the SystemConfiguration framework? I have problems to understand the systemconfigurations api documentation.
I need a notification from the system when airport is connecting to an ap.
Share
You are on the right track with the SystemConfiguration network, which offers the SCNetworkReachability set of functions. You could try using
to set a callback which will be called when the reachability changes; and
to schedule the reachability check within the run loop
Or you might try using a reachability framework (both for MacOS and iOS) which is built on top of the SystemConfiguration framework to make things even easier (higher-level).
If you want to go the SystemConfiguration way, this is how you check for present reachability and install the callback to be notified of changes (source):
And this is a sample of the callback: