How to check WiFi is pass through web page login?

2019-01-15 10:34发布

I need to check WiFi is pass through web page login or not, but I don't know how to do.

So I need someone can help me or explain how to wifi via web page login. thanks.

1条回答
一夜七次
2楼-- · 2019-01-15 10:54

On Android: You can implement your own RedirectHandler and then use it in an HttpClient to hit a website that should never be redirected. If you get redirected then this access point is likely a walled garden (no access to the internet, without further steps). After that you are unlikely to be able to simply log in for the user programmatically, since the user could be anywhere and may need to pay to use the internet: hotel, airplane, coffee shop. Instead the best course of action is to inform the user with a dialog that they will need to perform additional steps to reach the internet using the Wi-Fi access point they are currently connected to and then allow them to easily open the web browser to a website that will trigger the redirect such as www.google.com. I know this solution works because I've implemented it myself before.

On iPhone this probably isn't necessary since the iPhone already detects walled garden Wi-Fi access points as soon as the user connects to them and shows the browser. If the user fails to connect to the internet the iPhone disconnects the user from the Wi-Fi access point.

查看更多
登录 后发表回答