Ios React Native Webview NSURErrorDomain 1022
我试图在web视图组件中显示自定义URL(它们不是例外域中的URL,它们是其他URL,我并不总是知道它们的域),但似乎无法修复Apple的错误1022:Ios React Native Webview NSURErrorDomain 1022,ios,react-native,Ios,React Native,我试图在web视图组件中显示自定义URL(它们不是例外域中的URL,它们是其他URL,我并不总是知道它们的域),但似乎无法修复Apple的错误1022:无法加载资源,因为应用程序传输安全策略要求使用安全连接 我的Info.plist文件包含以下内容: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <tru
无法加载资源,因为应用程序传输安全策略要求使用安全连接
我的Info.plist
文件包含以下内容:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>akamaihd.net</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>facebook.com</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>needl-app.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
NSAppTransportSecurity
NSAllowsArbitraryLoads
NSExceptionDomains
akamaihd.net
NSExceptionRequiresForwardSecretary
n包括多个域
facebook.com
NSExceptionRequiresForwardSecretary
n包括多个域
fbcdn.net
NSExceptionRequiresForwardSecretary
n包括多个域
needl-app.com
n包括多个域
NSTemporary ExceptionalLowsInSecureHttpLoads
我做错了什么?我也经历过同样的错误。除非在iOS 9中将不安全的网页明确添加到
NSExceptionDomains
,否则无法加载该网页
你可以考虑一下你的使用情况。
如果应用程序允许用户查看,请使用SFSafariViewController类
互联网上任何地方的网站
SFSafariViewController当前未随react native一起提供。但是您可以自己创建一个域密钥。尝试将域密钥替换为:
www.akamaihd.net
及
www.faceboook.com
这似乎解决了我的问题。此外,对于facebook,只要在您的网络视图中路由到,您就可以删除它