Setup FB on your phonegap application
Posted By : Deepak Rawat | 26-Jun-2015
Create Facebook app
If app is not registered with facebook and has App ID, You should create it
Create New app
And fill each section for app
Bundle ID - iOS bundle ID corresponds to app
iPhone App Store ID - App Store ID
iPAD App Store ID - iPad App Store ID if app in app store
After create app, Facebook App ID appears at top of dashboard page
Next set bundle identifier and configure your facebook application to support login from an iOS application
Select settings in Application dashboard.
Click add platform and select iOS.
Provide bundle identifier in the Bundle id field.
Enable single sign on
Click save changes.
You can set bundle identifier in Xcode in Project tab.
Configure an Xcode Project
Add SDK for iOS to project and configure .plist file
Add the SDK
Facebook SDK for iOS is framework that add to Xcode project.
Drag FBSDKCoreKit . framework to Frameworks in Project Navigator.
Select create groups for any added folders
Deselect copy items into destination group's folder.
SDK automatically loads it framework and resource dependencies
Now configure .plist for your project
Create a key called FacebookApp id with string value, and add app ID there
Create key called FacebookdisplayName with string value and add display name configured in App dashboard
Create array key called URL types with single array sub-item called URL schemes. Give this single item with App ID prefixed with fb
It used to confirm application with receive callback URL of web-based OAuth flow
Finished .plist look like this
Note: For phonegap application you need to install the FB plugin using “cordova plugin add https://github.com/Wizcorp/phonegap-facebook-plugin/” the Xcode configuration and the FB SDK will automatically get configured.