【发布时间】:2017-12-21 08:12:07
【问题描述】:
在我的应用程序中,我想显示 Twitter 用户的个人资料图片,但 Twitter 通过 HTTP 提供链接:
http://pbs.twimg.com/profile_images/843199968018157568/zHovYMDk_normal.jpg
我更新了我的 info.plist 以包含 Twitter 用于他们的个人资料图片的域:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>pbs.twimg.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
但是,我仍然无法加载图像。我也试过NSAllowsArbitraryLoads,但也没有用。
我哪里错了?
【问题讨论】:
-
将您的代码粘贴到您使用该网址的位置。您是否从控制台收到任何有关传输安全的消息?
标签: ios twitter react-native