Expo Info.plist setup for App Transport Security exception

I have a fetch i’m performing on a non https domain. The domain is pre-defined, so i just need to add it to the exception list in the plist, but can’t see how the plist stuff translates to JSON for Expo setup;

It’s something like this to allow the non-https domains in XML

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>localhost</key>
        <dict>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

Expo gives this to add plist config;

"infoPlist": {
...
}

Say for example i wanted to allow http://something.com - how would that translate to the json? I have tried several different setups, all to no avail.

What are some of the things you’ve tried that have not worked?

If I were to guess I’d guess the following:

{
  "infoPlist": {
    "NSAppTransportSecurity": {
      "NSExceptionDomains": {
        "something.com": {
          "NSTemporaryExceptionAllowsInsecureHTTPLoads": true
        }
      }
    }
  }
}

If that doesn’t work, you might try extracting the Info.plist from the .ipa file to see what is wrong with it and that might give you an idea of how to change the JSON to get it to work.

I had a quick look to see if I could see where the Info.plist is generated, but didn’t find it.

EDIT:

It looks like the key names have changed:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.