In my app I want to display Twitter user's profile images, but Twitter provides the links via HTTP:
http://pbs.twimg.com/profile_images/843199968018157568/zHovYMDk_normal.jpg
I've updated my info.plist to include the domain Twitter uses for their profile images:
<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>
I'm still unable to load the images however. I've also tried NSAllowsArbitraryLoads
, but that didn't work either.
Where am I going wrong?
If you check the documentation you'll see that images links are returned with https links:
...
"profile_image_url": "http://pbs.twimg.com/profile_images/530814764687949824/npQQVkq8_normal.png",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/530814764687949824/npQQVkq8_normal.png",
...
So use the value from profile_image_url_https
and you should be fine.