1

I just want to load this url in a webview. It works fine when I run the same code on simulator and it load properly in simulator. I get error when I run the code on Real device Iphone. I have checked many example nothing worked out. Thanks in advance.

This is console log

2018-06-04 17:30:34.473925+0530 flex[750:187780] libMobileGestalt MobileGestaltSupport.m:153: pid 750 (flex) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
2018-06-04 17:30:34.474042+0530 flex[750:187780] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>)
Error is:The request timed out.

This is my code

import UIKit

class ViewController: UIViewController, UIWebViewDelegate{

  @IBOutlet weak var webViews: UIWebView!

  override func viewDidLoad() {
    super.viewDidLoad()

      webViews.delegate = self


    let url = NSURL (string: "http://myServerIP/FEXIGRA%20II/FEXIGRA%20II.html");
    let requestObj = NSURLRequest(url: url! as URL);

    do {
      try webViews.loadRequest(requestObj as URLRequest)
    } catch  {
      print(error.localizedDescription)
    }


  }



  func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
    print("Error is:\(error.localizedDescription)")

  }

}

1 Answers1

0

Did you add this to info.plist file?

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
EmreSURK
  • 419
  • 3
  • 13