Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add facebook plugin in cordova using cli

I am using cordova 3.3.0 cli.I found the documentation for manual installation which is for eclipse /xcode project. There is documantation for phonegap build also which we does in config.xml.I just want to install Facebook plugin to my cordova project which i am building through cordova CLI

Update : I came over from the problem.Thanks to Kal for his Help. I wrote a complete tutorial for it . My Tutorial for facebook plugin

like image 770
Ashisha Nautiyal Avatar asked Jan 14 '14 07:01

Ashisha Nautiyal


Video Answer


1 Answers

Actually, CLI works you just need to add the APP_ID and APP_NAME variables to your command. Something like this:

C:\myProject>cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin --variable APP_ID=your_facebook_app_id --variable APP_NAME=your_facebook_app_name

I got it installed this way but not sure if the app is functional or not. Something to test.

update:

I had an issue with phonegap build giving me the error One of your plugins requires a parameter: APP_ID, APP_NAME. That was because I didn't add those variables to the config.xml file.

This solved it

<gap:plugin name="com.phonegap.plugins.facebookconnect">
 <param name="APP_ID" value="your_facebook_app_id" />
 <param name="APP_NAME" value="your_facebook_app_name" />
</gap:plugin>`

Everything works fine now! I hope this help someone.

update 2:

Please remember to modify the plugin.xml file under root/plugins/com.phonegap.plugins.facebookconnect/plugin.xml

<preference name="APP_ID" />
<preference name="APP_NAME" />
like image 112
Kal Avatar answered Sep 23 '22 14:09

Kal