nraboy / ng-cordova-oauth

AngularJS oauth library for use with Apache Cordova projects
https://www.thepolyglotdeveloper.com
MIT License
456 stars 199 forks source link

Facebook - race condition issue #321

Closed Neithenn closed 7 years ago

Neithenn commented 7 years ago

Hi everyone, hope you can help me to figure this out.

Simple, I just installed in my Ionic v1 app ng-cordova-oauth, but when I try it out I get the error msg on my devise (android) 'web page is not available'.

This are the steps I followed: 1- start a tabs app 2-install ngCordova (last version 0.1.27) 3-install ng-cordova (last version 0.3) 4- add plugin InAppBrowser (1.6) 5- add all links on my index.html 6- create a new app on Facebook and add the redirect_uri = http://localhost/callback 7- I injected ngCordova to the module and also injected to my controller '$cordovaOauth' 8- I write down my login form and controller:

$cordovaOauth.facebook("1765611037082289", ["email", "profile"]).then(function(result) { $scope.user = result; }, function(error) { });

But nothing.. I cant even log in to facebook, the error popups first. I tried to change the redirect_uri to one of my own (code and facebook dashboard) but the same. I tried to downgrade the plugin InAppBrowser to 1.0 but still nothing. The weird thing is that I used this in an app like a year ago and works fine.. could be something about Ionic version?

Thank you.

clifzero commented 7 years ago

You're not alone and it's nice to know that I'm not along as well, I got the exact same error yesterday when I was testing my app yesterday, its almost as if you asked the question for me lol, and I followed the same steps you followd

Neithenn commented 7 years ago

ahaha! I still couldn't fix it, but I cloned this ng-cordova-auth example, tried it out and worked. So I keep working from that repository. Hope this answer helps you a bit.

clifzero commented 7 years ago

Oh thanks for that man, I'll check it out and let you know if it works out for me

clifzero commented 7 years ago

Thanks @Neithenn, really appreciate the link you provided, It works like a charm!!!

clifzero commented 7 years ago

I do have a question for you though. There's a link that we must use when testing the facebook apps, http://localhost/callback, what do we change this link to once app goes live?

Neithenn commented 7 years ago

It remains the same. Apps don't have domains so... You can try your app running 'ionic run android' (if you are using ionic) and check out how looks in your phone.

clifzero commented 7 years ago

Oh thanks, much appreciated man, atleast I get to cross that bridge WAAAAAY before I got there.