I'm trying to get notified when a user connects to a specific WiFi network, despite my app not being currently run. It's seeming to me that it's not possible, but there is one API that seemingly gets me almost there: CaptiveNetwork. Ideally, I'd like my app to be woken up when the user to connects to particular SSIDs so I can take action (sort of like significant location changes, for example).
I can register for a list of SSIDs with "CNSetSupportedSSIDs", but there doesn't seem to be any way to hook into an actual user connection. There is frustratingly little documentation on CaptiveNetwork (really, only one page of Apple's official docs, with no examples).
Can anyone confirm that there is no way to do this? How are you supposed to use CaptiveNetwork to do authentication anyways? Is the user supposed to know that your app is the only way the can connect to this specific network, and then launch it to authenticate? That's the only use-case I can think of for it...
Thanks!
There is a solution I use. Apple has some demonstration code for this: Reachability http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html which will help. I use it for all my connected Apps to handle the issue of having or losing network connectivity.
Looking in the header file there is are StartNotifier and stopNotifier methods. This seems like it does what you want.
I have not used CaptiveNetwork API.