Cameron As Andrew suggested you can use <resource-file> that will copy the config.plist from your plugin into the the XCode project. Then end user will need to edit config.plist to add their API key
If you want more automation cordova-cli/plugman can handle CLI Variables [1]. For example: cordova plugin add com.client.sdk.feature --variable CLIENT_API_KEY=BKJBKU*T*^*%&^42 or plugman install --platform ios --project ~/mysuperApp --plugin com.client.sdk.feature --variable CLIENT_API_KEY=BKJBKU*T*^*%&^42 This way when the user installs the plugin at the same time they can specify any required configuration settings for plugin. the values of the variables are stored in Cordova's config.xml Then you have two options: 1. Read the contents of config.xml (thru cordova's apis) 2. Use cordova cli hooks [2] to populate config.plist with the values of config.xml during cordova build 3. Cordova is currently working on plugin level hooks [3], but it not cooked yet :-) [1]: http://cordova.apache.org/docs/en/3.4.0/plugin_ref_spec.md.html#Plugin%20Specification#Variables [2]: https://github.com/apache/cordova-cli/blob/master/templates/hooks-README.md [3]: https://issues.apache.org/jira/browse/CB-6481 hope this helps --Carlos On Tue, Apr 22, 2014 at 10:28 PM, Andrew Grieve <[email protected]>wrote: > If it's just a matter of copying a file there, I think you can use > <resource-file> (see > > http://cordova.apache.org/docs/en/3.4.0/plugin_ref_spec.md.html#Plugin%20Specification > ) > > On Tue, Apr 22, 2014 at 9:31 PM, Cameron Barrie <[email protected]> > wrote: > > Hey folks, > > I'm an iOS/Android developer and am currently wrapping a 3rd party > Native SDK(iOS && Android) in a Cordova plugin for a client. > > > > I'll use iOS as my examples here, but the same principles apply to the > Android build. > > The SDK assumes that there is a file called config.plist, when the SDK > is instantiated it loads up it's API keys, and a variety of style > elements(colors etc) for use by the SDK. > > > > I'd like to find a way to generate this file from the config.xml and/or > the plugin.xml, but I cannot seem to find an interface to do this within > the Cordova eco-system? The config-file element in the plugin.xml only > appears to work on certain files(or I'm missing something pretty simple). > > > > Any advise anyone can provide would be great, otherwise, the devs > integrating the plugin will need to open the native projects and edit these > files, which isn't ideal. > > > > And please before anyone asks, no I am not the author of the SDK, and > no, there is no programatic way to set any of these variables(which I agree > is stupid, alas that's how it's been designed). > > > > Thanks in advance, > > Cameron > > > -- Carlos Santana <[email protected]>
