I have created a plugin that requires NSURLSessionDataTask to access an HTTP API address. The error message is as follows.
Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., NSErrorFailingURLStringKey=http://api.xxxx.xxxx, NSErrorFailingURLKey=http://api.xxxx.xxxx, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <5B2CEC4E-09E1-4E72-9A0F-6F102A2DF6C8>.<3>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <5B2CEC4E-09E1-4E72-9A0F-6F102A2DF6C8>.<3>, NSUnderlyingError=0x600003948780 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}}
Requesting an HTTPS address is not a problem. Is there any way I can request the HTTP protocol?
I added
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
in the plugin’s info.plist file is invalid