英文:
React Native iOS simulator network images not loading
问题
我有一个用React Native创建的应用程序。图像资产和react-native-vector-icons加载正确。但是网络图像无法加载。图像是从aws获取的带有签名的URL。这些链接在安卓上工作正常。
尝试了这个修复方法 - https://github.com/facebook/react-native/issues/29279#issuecomment-658244428
我认为不需要补丁修复 https://github.com/facebook/react-native/issues/29279#issuecomment-657284028 因为我的 react-native
版本是 0.70.1
应用程序信息
"react-native": "0.70.1"
Xcode 版本 13.2.1 (13C100)
英文:
I have a react native app created. Image assets and react-native-vector-icons are loading correctly. But network images are not loading. Images are being fetched from aws as signed url. Those links are working correctly on android.
Tried this fix - https://github.com/facebook/react-native/issues/29279#issuecomment-658244428
I don't think the patch fix is required https://github.com/facebook/react-native/issues/29279#issuecomment-657284028 as my react-native
version is 0.70.1
App Information
"react-native": "0.70.1"
Xcode Version 13.2.1 (13C100)
答案1
得分: 1
好的,以下是翻译好的部分:
"ok. the URL you shared is http and iOS does not all http request. to allow http request in iOS please add this to info.plist file"
"好的。您分享的URL是http协议,而iOS不允许所有的http请求。要在iOS中允许http请求,请将以下内容添加到 info.plist 文件中:"
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
"for more details please see this question and answer"
英文:
ok. the URL you shared is http and iOS does not all http request. to allow http request in iOS please add this to info.plist file
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论