Im trying to include facebook login to my phonegap application. I have used the https://github.com/Wizcorp/phonegap-facebook-plugin.git plugin for this. Im getting the error like this when i try to test the login in my phone:
"given url is not allowed by the application configuration one or more of the given urls isnot allowed by the apps settings. to use this url you must add a valid native platform in your apps settings"
Code:
$("#fbbtn-login").click(function(){
facebookConnectPlugin.getLoginStatus(function(data){
console.log(data);
if(data.status == "connected"){
//alert('Already logged in');
apiTest();
}else{
// goto login
}
},function(e){ console.log(e);});
facebookConnectPlugin.login(["public_profile"], function(data){
console.log(data);
console.log('login success');
//alert(JSON.stringify(data));
}, function(e){
console.log(e);
});
//var facebook_email;
var apiTest = function () {
//alert("email");
facebookConnectPlugin.api( "me/?fields=id,email",
function (response) {
alert(JSON.stringify(response));
// localStorage.setItem('facebook_email', response.email);
//alert(facebook_email);
// localStorage.setItem("facebook_flag","1");
//alert(facebook_flag);
// window.location="getting-started.html";
//alert("after navigation");
},
function (response) {
//alert(JSON.stringify(response));
});
}
});