Search code examples
iosionic-frameworkapp-transport-security

Ionic & iOS - App Transport Security Settings


The issue I am having relates to the PhoneGap Facebook plugin, basically I log the user in with Facebook to my app and on the next page I want to hit the image URL I retrieved from the Facebook login and display the image on the page.

I get the following error:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

I can get rid of the error by editing the .plist file in Xcode after building the application for iOS by removing:

<key>graph.facebook.com</key>
        <dict/>

My questions is - Is there a way to edit the phonegap-facebook-plugin files so I don't have to do this on each new build? Basically by building the iOS app with:

ionic build ios

Adds the key back into the .plist file.

Alternatively, is there another way around this? I was hoping to move away from storing the image in our own database...


Solution

  • Look at the Cordova whitelist plugin. You can then specify what origin to use in config.xml