Ashley, here is a cut and paste of my Phonegap Facebook login. My code is an adjustment based off of the following website. http://blog.geniuspods.com/2013/10/15/h ... -phonegap/ You do need the 'in app browser' installed for Phonegap in order to utilize this and the domain and web addresses in the Facebook developer app settings need to be set to http://localhost. url_S in this example of course is set to "http://localhost/" while the state variable is user defined.
Acts.prototype.Phonegap_Login = function (url_S,state)
{//if(FB_API["Instance"].uid != this.uid){return;}
if (check_app_Type("Phonegap_Login","PhoneGap") == false) {FB_API["Runtime"].trigger(cr.plugins_.Facebook2_1.prototype.cnds.Con_Phonegap_Login_Fail, FB_API["Instance"]);return;}
ios_url = window.open("https://www.facebook.com/dialog/oauth?client_id="+FB_Properties["App ID"]+"&auth_type=rerequest&scope="+FB_API["scope"]+"&state="+state+"&response_type=token&redirect_uri="+url_S, '_blank', 'location=no,toolbar=no');
ios_url.addEventListener('loadstart', function(e)
{ var url = e.url;
var fburl = url.indexOf("facebook.com/login");
var err = url.indexOf("error");
if (err >= 0 && fburl < 0)
{console.log(url);ios_url.close();
//fbRuntime.trigger(cr.plugins_.Facebook3.prototype.cnds.fail_ios_logged, fbInst);
}
var n = url.indexOf("#access_token=");
if (n >= 1){
var tokensplit = url.split("#");
var token_two = tokensplit[1].split("&");
var accessToken1 = token_two[0].split("=");
User["User AccessToken"] = accessToken1[1];
console.log('InAppBrowser: loadstart event has fired with url: ' + User["User AccessToken"]);
Fetch_User("me",User["User AccessToken"],function(FU_Status)
{if (FU_Status == "success") {FB_API["Runtime"].trigger(cr.plugins_.Facebook2_1.prototype.cnds.CON_USER_SUCCESS, FB_API["Instance"]);}
else{FB_API["Runtime"].trigger(cr.plugins_.Facebook2_1.prototype.cnds.CON_USER_FAIL, FB_API["Instance"]);}
});ios_url.close();FB_API["Runtime"].trigger(cr.plugins_.Facebook2_1.prototype.cnds.CON_USER_LOGIN, FB_API["Instance"]);
}});
};