简体   繁体   中英

iOS - How to detect a session timeout on UIWebView

I have a UIWebView displaying a website that has a timeout policy (idle for 1800 seconds). Since I use a custom login view to connect to the site, I want to call this same custom view after the website has issued the timeout alert.

How can I detect that such an alert has been issued to the webview, so I can call my code from there?

Thank you for your help.

如果网站在超时时重定向到特定页面,则可以查看该页面是否已加载到UIWebViewDelegate的webView:shouldStartLoadWithRequest:navigationType:方法中。

从UIKit的角度不知道如何解决这个问题,但是如果知道会话超时,则可以在其中一个控制器中创建一个NSTimer,以在定义的经过时间提醒您,并在应用程序每次调用您的网站时将其重置

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