1

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.

PoloGV
  • 101
  • 2
  • 7

2 Answers2

1

If the website redirects to a particular page on timeout, you could watch for that page to be loaded in your UIWebViewDelegate's webView:shouldStartLoadWithRequest:navigationType: method.

Anomie
  • 92,546
  • 13
  • 126
  • 145
  • I ended up using the webViewDidFinishLoading delegate method. Here I check if the method was called due to a time out (I can check the timer from the website). – PoloGV Mar 07 '11 at 19:05
0

Don't know how to solve this from UIKit perspective but if your session time out is known you could create an NSTimer in one of your controllers to alert you when a defined elapsed time, resetting it each time the app calls your site.

Community
  • 1
  • 1
Luke Mcneice
  • 3,012
  • 4
  • 38
  • 50