Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios React Native Webview NSURErrorDomain 1022_Ios_React Native - Fatal编程技术网

Ios React Native Webview NSURErrorDomain 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

我试图在web视图组件中显示自定义URL(它们不是例外域中的URL,它们是其他URL,我并不总是知道它们的域),但似乎无法修复Apple的错误1022:
无法加载资源,因为应用程序传输安全策略要求使用安全连接

我的
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,只要在您的网络视图中路由到,您就可以删除它