views:

38

answers:

0

When I connect hotspot using Wi-Fi Networks in iPhone settings, iPhone automatically pop up the log in page to enter the ID/PW. I think the setting using a browser. In a browser, is it using the below code from NSURLConnectionDelegate?

  • (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace;
  • (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
  • (void)connection:(NSURLConnection *)connection didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

How can I intercept the event?

Furthermore, I would like to connect a web page in hotspot after connecting to it by programmatically using the below code.

  • // it is a private API from associate = dlsym(libHandle, "Apple80211Associate") in
  • int ret = associate(airportHandle, network, key);

After making a connection to hotspot, when I try to connect to a web page, always an error happens, "The Internet connection appears to be offline.". but definitely connected.

What secrets are in connecting a hotspot in iPhone? It is very strange.

If someone knows it, please let me know. Thanks.