Reputation: 129
I have a problem in loading in my web view This is my code:
NSString *urlString = @"https://www.google.com.eg";
// NSString *urlString = @"http://fatima.ibtdi.work";
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[_fatimaView loadRequest:urlRequest];}
It works on Google but doesn't work on the another link.
Upvotes: 4
Views: 5018
Reputation: 3395
You have to add
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
in your info.plist
because your link "http://fatima.ibtdi.work" is not secured by SSL, so you have to add NSAppTransportSecurity
in your info.plist
file. IOS manage the link if the link is secured with SSL certificates else it block transportation from device to web.
Hope this helps you.
Upvotes: 2
Reputation: 8322
Add this to your plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Upvotes: 4
Reputation: 457
Looks like you need to add some App Transport Security Settings to your Info plist try this
Any HTTP loading in a web view will require adding the domain to these settings.
Upvotes: 3