24
votes

Acknowledging a similar question in the link below does anyone know how to add the information to the config.xml file in Cordova?

ITSAppUsesNonExemptEncryption export compliance while internal testing?

I need to have a true value in the plist:

ITSAppUsesNonExemptEncryption ITSEncryptionExportComplianceCode [ Key Value ]

Does anyone know the correct syntax to add this information?

9
The screenshot in the post you linked to has the syntax. <key>ITSAppUsesNonExemptEncryption</key> <false/>Mike Becatti

9 Answers

18
votes

I had to modify Andrej's answer a bit, this worked for me:

  <platform name="ios">
    ...
    <config-file target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption" mode="add">
      <false/>
    </config-file>
    ...
  </platform>
13
votes

I have create a simple empty plugin to set this ITSAppUsesNonExemptEncryption to false.

Simply add the following to your config.xml

<plugin name="cordova-ios-plugin-no-export-compliance" spec="0.0.5" />

or run

cordova plugin add cordova-ios-plugin-no-export-compliance

If you need to set it to true you can fork the plugin and change the plugin.xml file accordingly then add the plugin from the forked repository.

See the plugin on NPM for more info.

12
votes

As of 2/7/2019, the correct way to do this is to add this snippet to your <platform name="ios"> section:

<edit-config file="*-Info.plist" mode="add" target="ITSAppUsesNonExemptEncryption">
    <false/>
</edit-config>
3
votes

Note that the plugin mentioned will not work in phonegap build. The solution to make this work in phonegap build is outlined in this stackoverflow question and in this github issue: Use

<gap:config-file platform="ios" parent="ITSAppUsesNonExemptEncryption" mode="add">
  <false/>
</gap:config-file>

in your config.xml.

Note that you MUST explicitly set platform="ios" as an attribute, even if you already have a platform block. Note that you MUST use the gap: namespace.

The following WILL NOT work as per 2016-04-08:

<platform name="ios">
  <gap:config-file parent="ITSAppUsesNonExemptEncryption" mode="add">
    <false/>
  </gap:config-file>
</platform>

Neither will this one work:

<config-file platform="ios" parent="ITSAppUsesNonExemptEncryption" mode="add">
  <false/>
</config-file>
2
votes

The correct answer is actually:

<config-file platform="ios" target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption">
    <false/>
</config-file>

Taken from Add hint that this won't work in phonegap build

1
votes

November 2019, next is working for me:

<platform name="ios">
...
    <config-file parent="ITSAppUsesNonExemptEncryption" target="*-Info.plist">
        <false />
    </config-file>

NOTE: DON'T FORGET TO REMOVE platforms/ios folder and build again with ionic cordova prepare ios. Without that plist file may stay unchanged.

1
votes

If you want to append that config in the *-Info.plist file, you need to use config-file in this way:

<platform name="ios">
    <config-file parent="ITSAppUsesNonExemptEncryption" target="*-Info.plist">
        <false />
    </config-file>
    ....
</platform>

The edit-config is to modify an existing config, and that config doesn't exist by default.

0
votes

I can across this issue using ionic.

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.48
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v7.1.0
Xcode version: Xcode 8.2.1 Build version 8C1002

After more research than expected I learned that plugins have the ability to update the config. To that end I just added the plugin "cordova-plugin-ios-non-exempt-encryption" to my package.json, rebuilt and it works!

-1
votes

This works for me (Actually I needed to put false, instead of true).

  <platform name="ios">
    ...
    <config-file target="*-Info.plist" parent="CFBundleURLTypes" mode="add">
      <array>
          <dict>
              <key>ITSAppUsesNonExemptEncryption</key>
              <false/>
          </dict>
      </array>
    </config-file>
    ...
  </platform>

I am using cordova 6.3.0 engineios@~4.2.0.

I hope I helped :)