我需要在Ionic v2应用中添加Google登录信息。
目前我无法使用Ionic Authentication service,因为它是not ready for v2 yet。
我还尝试了ng2-cordova-oauth插件,但我无法使用ionic serve
或Ionic View来测试身份验证,这对我来说是一个巨大的不便,因为我不再有一个简单的方法向客户展示应用程序。
所以...任何替代方案?
答案 0 :(得分:0)
Firebase用户身份验证是另一种选择,您可以使用少量代码实现Google身份验证
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);
}
});
&#13;
请参阅此处的文档firebase documentation