-
-
Save EloneSampaio/1fc368427a440de25047bd7a6fb63365 to your computer and use it in GitHub Desktop.
Auth with Firebase 3.x and Cordova/Ionic using ngCordova oauth.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$cordovaOauth.facebook("your_client_id", ["email"]) | |
.then(function (result) { | |
var credentials = firebase.auth.FacebookAuthProvider.credential(result.access_token); | |
return firebase.auth().signInWithCredential(credentials); | |
}) | |
.then(function (firebaseUser) { | |
console.log("Signed in as:", firebaseUser.uid); | |
}) | |
.catch(function (error) { | |
console.error("Authentication failed:", error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment