networking - Detect a captive portal on iOS -
so i'm able detect whether or not user has basic internet connection fine using apple's reachability class. however, when try detect whether or not connected wi-fi network utilizes captive portal, networkstatusreachableviawifi
, makes sense. however, returned if user using wifi connection.
i need able detect both no internet connection , captive portal situation, no internet.
are there reliable api's can accomplish task? based off article, http://blog.erratasec.com/2010/09/apples-secret-wispr-request.html#.vxkmrjmriy5, apple pings internal address when connect wifi check captive portal. i'd prefer avoid pinging outside networks, if must, know how ping same apple address , use response tell if user has captive portal up?
edit: i've come across nsurlconnectiondelegate
, method connection:willsendrequestforauthenticationchallenge:
. think method may able need, can send basic request www.google.com , make myself delegate, , if method gets hit need do. think able call cancelauthenticanchallenge:
has ever used method before detect captive portal? how did work?
Comments
Post a Comment