Trouble with Facebook oauth get requests


#1

I have followed the oauth-phonegap/cordova read me found here: https://github.com/oauth-io/oauth-phonegap and gotten it to successfully return an access token. When I call a get request on the the result as described in that read me and in the .get request here: https://oauth.io/docs/api, nothing happens. Can anyone help or point me in the right direction? My code is in a function on the scope in angular/ionic.

My code is:
$scope.fbLogin = function(){

	OAuth.initialize('8MM1IzKx4mPk_ikOvaTCIZ3OWoM');
	OAuth.popup("facebook", function(e,r) {

	    if (e){
	    	alert('error: ' + e.message);
	    }

	    else {

				  r.get("/me").done(function(res){
				  	alert('here2');
				  	$scope.userName=res.name;
				  })
			}
	});
    // the access_token is available via r.access_token
    // but the http functions automagically wrap the jquery calls

	};

#2

resolved. Jquery was loading in the wrong order.


#3

Hi,

I get “OAuth is not defined” when I follow the steps in https://github.com/oauth-io/oauth-phonegap.

Did you get that problem too?


#4

I actually ended up not being to get OAuth to work at all with ionic, ended up using an in app pop-up to write the flow, which I found advice on in a separate thread in this forum.


#5

Apologies on not including the link, did a quick search but couldn’t locate it atm