如何在 Google Plus 登录 Ionic3 中获取出生日期或性别?
How To Get BirthDate or Gender In Google Plus Login Ionic3?
如何在 Google Plus 登录 Ionic3 中获取出生日期或性别?
GPLogin(){
this.googlePlus.login({'scopes': 'https://www.googleapis.com/auth/plus.login'})
.then(res => {
console.log(res);
alert("success "+JSON.stringify(res));
})
.catch(err => {
console.error(err);
alert("error "+JSON.stringify(err));
});
}
你应该看看 google plus cordova 插件 documentation。
如果您搜索 scope
,您将找到您要查找的内容。您需要添加所需的 scopes
才能获取用户个人资料数据。
可以找到所有 google 范围的完整列表 here
在你的情况下应该是 Google People API, v1
。
https://www.googleapis.com/auth/user.birthday.read
= 查看您的完整出生日期。
但要注意与范围功能相关的known bugs。
如何在 Google Plus 登录 Ionic3 中获取出生日期或性别?
GPLogin(){
this.googlePlus.login({'scopes': 'https://www.googleapis.com/auth/plus.login'})
.then(res => {
console.log(res);
alert("success "+JSON.stringify(res));
})
.catch(err => {
console.error(err);
alert("error "+JSON.stringify(err));
});
}
你应该看看 google plus cordova 插件 documentation。
如果您搜索 scope
,您将找到您要查找的内容。您需要添加所需的 scopes
才能获取用户个人资料数据。
可以找到所有 google 范围的完整列表 here
在你的情况下应该是 Google People API, v1
。
https://www.googleapis.com/auth/user.birthday.read
= 查看您的完整出生日期。
但要注意与范围功能相关的known bugs。