Red2678 Red2678 - 2 months ago 35x
iOS Question

Add entry to iOS .plist file via Cordova config.xml

First let me preface that I am somewhat new to the Cordova CLI. Anyway, here is my question:

I need to preform the following steps programmatically via Cordova.

  1. In the project .plist add a new row

  2. Enter the following values in the new row:

  3. Key: GDLibraryMode Type:String (default) Value:GDEnterpriseSimulation

I think I need to do this in the config.xml file in my project's root (or maybe the one in the "platforms" folder).

Can someone explain to me how to add the entry via the config.xml so that the above entry is added at compile-time.

I am using Cordova 3.3.1-0.42 (I know it is not the latest). I have already made my project and all is fine, I just need to add this entry added to the pList.

Thanks so much!



I don't think you can do this via straight config.xml modification. At least, I didn't see any mention of this in the docs:

I think you have to create a plugin, because they can insert plist entries:

See the 'config-file element' section. Here's a guess as to what the relevant section of the plugin.xml will look like:

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

Then you can install the plugin: cordova plugin add <your plugin name or file location>