Вопрос

I have searched the web and all my books and references but I'm not finding what I am looking for.

Because of the type of app built I need to restrict access to the UIWebView "stuff" if the user has Safari restricted.

Is there a way to check is safari has been restricted on the iPhone and if so examples...sites, references?? I'd like to be able to check and give an alert for those users and for others users just load the pages. Everything is working for me BUT I don't know how to check if it's been restricted.

Thanks in advance.

Это было полезно?

Решение

The best I've found is to use the following:

BOOL safariAvailable = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"http://test"]];

In iOS 6.0 it seems that apple changed this behavior (which worked in 5.x) :(

Only way I've found is to actually try to open the URL, and then watch for resignActive notification on your application delegate. If you fail to get it shortly after calling, then it's likely safari isn't present. Ugh.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top