强制性Wifi弹出:单击链接以打开Safari [英] Captive Wifi Popup: Click a link to open Safari

查看:1142
本文介绍了强制性Wifi弹出:单击链接以打开Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在网络上遇到iOS设备问题(ipads,iphone等):连接到SSID后,iphone / ipad会立即打开强制网络助手(CNA) - 它就像一个缩小版的浏览器导航按钮等 - 显示我们的欢迎页面(准备好让用户在网络中验证他的MAC以给他上网)。这个CNA是iOS的一个功能,它会自动发生。

We are having an issue on our network with iOS devices (ipads, iphones etc): After connecting to the SSID, the iphone / ipad immediately opens the Captive Network Assistant (CNA) - it is like a scaled-down browser without navigation buttons etc - that displays our welcome page (ready for the user to authenticate his MAC in the network to give him internet). This CNA is a functin of iOS, and happens automatically.

我在这个论坛上四处寻找如何通过点击链接让用户打开他的Safari浏览器(在CNA),因此将他从CNA送到Safari(这是我更喜欢他的地方)。

I was looking around on this forum how to make the user open his Safari browser by clicking a link (while in the CNA), thus sending him away from the CNA and into Safari (which is where I would prefer him to be).

我搜索的短语如:如何设置一个在safari中打开的链接,但我得到的结果是关于使用phonegap进行此类操作的人...

一位用户谈到使用
window.open(myURL,'_ system` )
但我不知道这是否解决了我的问题。

I searched phrases such as: "How to set a link to open in safari", but I get results about people using phonegap to do such a thing...
One user talked about using window.open(myURL, '_system') but I don't know if that is solving my issue.

基本上我的计划是:
- 有我的欢迎页面(用户连接到我的SSID后显示的页面)检测用户设备具有哪种类型的浏览器。我的欢迎页面托管在我的控制器的Walled Garden中的一个站点,因此每个设备都可以看到欢迎页面(无论他们是否具有完全的互联网访问权限)。
- 如果用户有iOS设备,CNA浏览器会自动打开。我的控制器检测到设备有一个CNA浏览器并加载一个带有消息的简单页面(如):点击这里开始导航
- 在接下来的几秒钟内(当用户消化消息时),我的控制器给用户的MAC完全上网
- 当用户在CNA浏览器中点击该链接时,CNA关闭然后打开Safari,并强制Safari打开目的地欢迎页面(我希望我的用户在哪里) ,取决于他所连接的天线。)

Basically my plan is to: - Have my Welcome Page (the page displayed after the user connected to my SSID) detect what type of browser the user's device has. My Welcome Page is hosted at a site which is in the Walled Garden of my controller, so every device can see that Welcome page (whether they have full internet access or not). - If the user has an iOS device, the CNA browser opens automatically. My controller detects the device has a CNA browser and loads a simple page with the message (like): "click here to start to navigate" - During the next few seconds (while the user is digesting the message), my controller gives the user's MAC full internet access - When the user clicks that link in the CNA browser, the CNA closes and then opens Safari, and also forces Safari to open the destination Welcome Page (where I want my user to be, depending on the antenna to which he connected).

我真的希望一切都有意义......

I really hope that all makes sense...

我在这个论坛中找到了关于CNA浏览器的链接:
在iOS 7中绕过Apple Captive Network Assistant登录

I found this link about the CNA browser in this forum: Bypasses Apple Captive Network Assistant Login in iOS 7

但它说明了用户从一开始就打开Safari(禁用CNA功能), 希望用户打开Safari(而不是直接转到他的应用程序之一) S)。我更喜欢用户必须点击继续,这会使Safari打开并看到我的欢迎页面。

But it talks having the user open Safari right from the start (disabling the CNA function), "hoping" that the user opens Safari (rather then going directly to one of his apps). I prefer that the user has to "click to continue", which makes Safari open and he sees my Welcome Page.

推荐答案

编辑:此解决方案在iOS 10.3之后无效。不确定这是一个功能还是一个错误: https://forums.developer.apple.com/ thread / 75498

EDIT : this solution doesn't work after iOS 10.3. Not sure if that's a feature or a bug : https://forums.developer.apple.com/thread/75498

EDIT2 :显然它在iOS 11上再次运行

EDIT2 : Apparently it works again on iOS 11

如果您可以控制强制门户网站服务器,那么有一种简单的方法可以做到这一点。

There is a simple way to do that, if you have control over the captive portal server.

当连接到wifi网络时,iOS设备会向一堆预定义的网址发送GET请求( http://www.apple.com /library/test/success.html ,...),查看是否存在Internet连接(wispr请求)。 iOS设备需要答案< HTML>< HEAD>< TITLE>成功< / TITLE>< / HEAD>< BODY>成功< / BODY>< / HTML> 。如果请求成功,但答案不同(例如您的强制门户页面),则会触发CNA打开。

When connecting to a wifi network, iOS devices send a GET request to a bunch of predefined urls (http://www.apple.com/library/test/success.html, ...) , to see if there is Internet connectivity (wispr requests). The iOS device expects the answer <HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>. If the request succeeds, but the answer is different (for example your captive portal page), it triggers the CNA to open.

在此阶段,CNA认为您没有连接,并会在顶部显示取消按钮。无论你做什么,每个链接都将在CNA内打开,而不是在Safari窗口中打开。完成CNA后,您可以让用户完成登录过程。为了查看登录过程是否完成以及最终建立连接,iOS设备现在将发送另一个wispr请求。这种情况每40秒发生一次,或者每当发出HTTP请求时(在CNA中导航)。

At this stage, the CNA thinks you are not connected and will show a Cancel button at the top. Every link will open inside the CNA and not in a Safari window, no matter what you do. The CNA is done so that you can get your user through the log-in process. In order to see if the log-in process is done and connection is finally established, the iOS device will now and then send another wispr request. This happens every 40 seconds, or whenever an HTTP request is emitted (navigation within the CNA).

当您的服务器最终回答成功对于一个wispr请求,CNA将标记为已连接,顶部的按钮将变为完成。在此阶段,任何指向外部网址的链接都将关闭CNA并在Safari中打开:)

When your server finally answers Success to a wispr request, the CNA will mark as connected, the button at the top will change into Done. At this stage, any link to an external url will close the CNA and open in Safari :)

总而言之,您可以通过以下连接步骤实现您想要的效果:

So to summarize, you can achieve what you want with the following connection steps :


  1. 服务器使用您的CNA页面回答初始wispr请求。

  2. 页面在CNA中打开。在该页面中,有一些JavaScript会立即触发CNA中的导航,例如:< script> window.location.reload(true)< / script> 这将触发iOS设备立即发送另一个wispr请求

  3. 服务器使用< HTML>< HEAD>< TITLE>成功< / TITLE>回答第二个wispr请求;< / HEAD>< BODY>成功< / BODY>< / HTML> ,这将触发CNA标记为已连接

  4. 拥有您的CNA页面显示指向外部网址的链接

  1. server answers initial wispr request with your CNA page.
  2. the page opens in CNA. In that page, have some JavaScript that immediately triggers navigation within the CNA, for example : <script>window.location.reload(true)</script> this will trigger the iOS device to immediately send another wispr request
  3. server answers this second wispr request with <HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>, this will trigger the CNA to mark as connected
  4. have your CNA page to show a link to an external url

这篇关于强制性Wifi弹出:单击链接以打开Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆