Swift 3 on not accept http?

Asked

Viewed 72 times

0

I read that after 2017 Apple no longer accepts http in Swift + Xcode.

How to access a domain, using a webview that still has http. Example, in the post method of my page contains an http, the webview needs to access this url, but when I try to access it, the Xcode says it blocked the access.

I am using version 10 of Xcode, and this in info.plist no longer has the option to make the release.

  • 1

    Have you tried this solution? https://answall.com/questions/91156/webview-em-ios-n%C3%A3o-est%C3%A1-accessing-some-sites/91170#91170

  • Thanks Rafael, it worked. If I publish my app in the Apple Store, you can block by this http setting that I just made?

  • 1

    It is possible. If you are accessing a specific url via HTTP, it is recommended to limit insecure access only to that url or domain using Nsexceptiondomains

1 answer

1

You need to set the Nsallowsarbitraryloads key as YES in the Nsapptransportsecurity dictionary in your file. plist.

Open your . plist -> click + on the root -> Add the following line: NSAppTransportSecurity, as soon as you add click on + dp App Transport Security Settings (is the same one we just added) and add this daughter line: NSAllowsArbitraryLoads. leave it as YES.

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.