There are lots of plugin available for integrating Facebook in PhoneGap, however it is not a simple process, a successful integration needs many configurations to be done in the app as a first step.
This article will help in implementing the configurations needed to integrate Facebook in PhoneGap Android App.
- Create a PhoneGap Android App.
- Create an App in Facebook.
- Generate a key hash for Facebook integration with android.
- Add generated key hash to Facebook App.
- Download a zip file of PhoneGap Facebook Connect plugin and extract.
- Browse to the project folder in command prompt and run
cordova -d plugin add <path to the extracted PhoneGap Facebook Connect folder> –variable APP_ID=”<Facebook App ID >” –variable APP_NAME=”<Facebook App Name>”
- Now we can use available API commands in our code like FB Login, FB Logout, FB Get Status, FB Show Dialog, FB Graph API etc