简体   繁体   中英

iPhone NSURLConnection pop-up for entering user/password requested?

I observed in a Hotel I am that when other apps trying to access the internet a pop-up appears that ask the iPhone user to enter the user id and password of the Hotel's Wireless LAN. I guess it is some kind of redirect on all requests to protect misuse of the WLAN.

I have an app and it does use the NSURLConnection but I am not getting the pop-up instead it goes via the regular data network of the carrier. I removed the SIM to see what happens then and then the connection fails with an error "The Internet connection appears to be offline".

I wonder whether this is because the NSURLConnection does not provide such a pop-up and this other apps (eg Safari, eg WhatsApp) use a different API. One the other hand I thought that might be what the documentation says is the "Authorization Challenge". I have implemented those delegate methods but they are not called.

If someone with some experience on this can help me.

在文档中搜索UIRequiresPersistentWiFi Info.plist键-需要权衡取舍(如果用户的手机处于飞行模式,则每次打开应用程序时,用户都会收到警报-似乎无法将其关闭)应该强迫它建立连接。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM