0

Sorry for asking this silly question.

How can we load default safari page when not connected to the internet, like the page below, in our application?

enter image description here

Thanks in advance

Chahal

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Chahal
  • 995
  • 2
  • 14
  • 24

2 Answers2

1

First check for an active Internet Connection here, then load local html file into the uiwebview here.

Community
  • 1
  • 1
Tarek Hallak
  • 18,422
  • 7
  • 59
  • 68
  • Hi null, Thanks for your response. I am checking the internet connection for my application. If iPhone is not connected, rather than showing a blank page using method [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]]; I was wondering, if there is a way we can load the above page(with image and text "Safari cannot open the page because your iPhone is not connected to the Internet"), yes we can do that using custom images, but I was wondering if there is any code/setting we can load that page. Thanks – Chahal Sep 09 '13 at 10:52
0

Did you mean : open a default page in the Safari application when taping on some button inside your application? If yes, then here is the code :

[[UIApplication sharedApplication] openURL:[YOUR_URL_HERE]]
helper
  • 115
  • 9
  • Hi Helper, Thanks for help. I was wondering, if there is a way we can load the above page within our application(with image and text "Safari cannot open the page because your iPhone is not connected to the Internet"), yes we can do that using custom images, but I was wondering if there is any code/setting we can load that page. Thanks – Chahal Sep 09 '13 at 10:53
  • Hi Chahal, I don't know if there is a programmatical way of doing what you are requesting, but I'm pretty sure it's a "bad idea" since the view presenting the message will not be the true safari application. – helper Sep 09 '13 at 13:08