Add a plugin with variables

MissCoder87 picture MissCoder87 · Aug 28, 2014 · Viewed 7.5k times · Source

How do you add an plugin not using the <vs:feature /> sections. I need to add some plugins that when you add them they ask for variables. If i use cordova plugin add, how do I then reference the plugin in the application?

This is driving me crazy, seems a proper over site and makes the whole thing unusable.

I keep getting the error:

Error   17  Variable(s) missing: APP_ID, APP_NAME   F:\Development\sdfsdfsd\sdfdsfi\EXEC    1   1   sdfsdfsd
Error   18  The command ""C:\Users\Tom.AD\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" prepare --platform Android --configuration Release --projectDir . --projectName "sdffds" --language "en-US"" exited with code 8.  C:\Users\Tom.AD\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets   182 5   sdfdsff

I've tried adding the following in the config.xml

 <preference name="APP_ID" value="ssssss" />
  <preference name="APP_NAME" value="ssssss" />

And

<vs:feature>
      https://github.com/Wizcorp/phonegap-facebook-plugin.git
      <preference name="APP_ID" value="sssss" />
      <preference name="APP_NAME" value="ssss" />
    </vs:feature>

And

<vs:feature>
      https://github.com/Wizcorp/phonegap-facebook-plugin.git
      <params name="APP_ID" value="ssssss" />
      <params name="APP_NAME" value="sssss" />
    </vs:feature

Answer

Dawson Loudon picture Dawson Loudon · Aug 28, 2014

The documentation for this plugin covers this here: https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/android/README.md

Here is their example:

cordova -d plugin add /Users/your/path/here/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myApplication"