Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova Facebook plugin : missing variables APP_ID, APP_NAME

When I do :

cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin.git

I get the error :

Error: Variable(s) missing: APP_ID, APP_NAME

Where do I have to configure these variables ?

like image 788
Cherif Avatar asked Mar 12 '14 15:03

Cherif


2 Answers

Look at the bottom of the README.md file on that github repository. You'll see it gives you instructions for installing the plugin and including the variables:

plugman install --platform [PLATFORM] --project [TARGET-PATH] --plugin [PLUGIN-PATH] --variable APP_ID="[APP_ID]" --variable APP_NAME="[APP_NAME]"

where
    [PLATFORM] = ios or android
    [TARGET-PATH] = path to folder containing your phonegap project
    [PLUGIN-PATH] = path to folder containing this plugin
    [APP_ID] = Your APP_ID as registered on Facebook

The Cordova CLI uses Plugman behind the scenes, so you can use it to inject variable names like this:

cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="my-app-id" --variable APP_NAME="my-app-name"
like image 170
MBillau Avatar answered Nov 15 '22 21:11

MBillau


Edit the following lines in plugins\com.phonegap.plugins.facebookconnect\plugins.xml:

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

To:

<param name="APP_ID" value="123456789" />
<param name="APP_NAME" value="Cordova" />
like image 32
henkie14 Avatar answered Nov 15 '22 21:11

henkie14