Php Ionic 5.9使用谷歌选项登录
您好,我想把谷歌登录方法的用户登录与他们的谷歌帐户 我有一个来自谷歌firebase的应用程序id,但我想使用带有restful php api的谷歌登录 一个朋友给了我这个,但这是给firebase db的,对吗?我使用MySqlPhp Ionic 5.9使用谷歌选项登录,php,angular,ionic-framework,Php,Angular,Ionic Framework,您好,我想把谷歌登录方法的用户登录与他们的谷歌帐户 我有一个来自谷歌firebase的应用程序id,但我想使用带有restful php api的谷歌登录 一个朋友给了我这个,但这是给firebase db的,对吗?我使用MySql async doGoogleLogin() { return new Promise(async (resolve) => { const googleRequest = { scopes: 'profile', webClientId:
async doGoogleLogin() {
return new Promise(async (resolve) => {
const googleRequest = {
scopes: 'profile',
webClientId: environment.googleId,
offline: true
};
const googleUser = await this.googlePlus.login(googleRequest);
if (googleUser) {
// this one you will get while you call this fun ok so you need to pass this data to your api ookk ?ok so this doesnt need to be here
// its a gllobal fun we made so we can use it anywhere in the appok i got it continue pleaseok
const credentials = {
provider: 'google',
email: googleUser.email,
name: googleUser.displayName,
id: googleUser.userId,
token: googleUser.accessToken,
avatar: googleUser.imageUrl
};
resolve(credentials);
}
});
}
我能举个例子吗