首页 文章

Ionic 2谷歌

提问于
浏览
0

在IONIC2中使用谷歌登录有什么实际的例子吗?我在这里很新 . 我所看到的只有Ionic 1 .

据我所知,离子1上有这些例子:

https://ionicthemes.com/tutorials/about/google-plus-login-with-ionic-framework#step1

github.com/EddyVerbruggen/cordova-plugin-googleplus

和Ionic2中oAuth2的一个例子,这是我在整个世界中发现的最糟糕的事情 . 但是要使用这个例子,我必然会使用他们的“注册”:

http://blog.ionic.io/ionic-2-and-auth0/

1 回答

  • 0

    你可以使用firebase . 你可以用几行代码实现谷歌认证 .

    var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
    ref.authWithOAuthPopup("google", function(error, authData) {
      if (error) {
        console.log("Login Failed!", error);
      } else {
        console.log("Authenticated successfully with payload:", authData);
      }
    });
    

    请在这里查看文档firebase documentation

相关问题