App Transport Security has blocked a cleartext HTTP resource

后端 未结 6 681
不思量自难忘°
不思量自难忘° 2020-12-01 13:15

I am using Socket.IO library in swift and I keep getting this error:

App Transport Security has blocked a cleartext HTTP (http://) resource

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 13:37

    Another way to solve this, which I found more convenient, is to disable App Transport Security by default using the NSAllowsArbitraryLoads key. So any domains you do not include in the NSExceptionDomains dictionary (or if you don't include NSExceptionDomains at all) will not be subject to App Transport Security.

提交回复
热议问题