For the past two days, I have been trying to figure out how to make use of the phonegap-facebook-plugin What I did so far:
- I created a new phonegap app (phonegap create app --id "com.example.test" --name"app")
- I cloned the repo and saved it into the app so now my app has a plugin folder that contains the phonegap-facebook-plugin with two platform examples in it (ios and adnroid).
- I downloaded the phonegap ios app from the app store, started phonegap serve inside the my sample app's www folder (the top www folder - the one you're supposed to be working on), and I can see it running on my phone.
I added the following code to the app's index.js:
onDeviceReady: function() {
app.receivedEvent('deviceready');
var fbLoginSuccess = function (userData) {
alert("UserInfo: " + JSON.stringify(userData));
}
facebookConnectPlugin.login(["public_profile"],
fbLoginSuccess,
function (error) { alert("" + error) }
);
},
I added this to my index.html:
<div class="event listening button" onclick="login();">Login with Facebook</div>
When I serve with phonegap, and open on my iphone with the phonegap app, I can see the button LOGIN WITH FACEBOOK. Clicking it doesn't do anything.
Could someone PLEASE create a SIMPLE walkthrough for the installation of this plugin?