[英]what is difference between login with gplus and login with google in firebase?
I am confused between login with GPlus and login with google account through firebase. 我在使用GPlus登录和通过Firebase使用Google帐户登录之间感到困惑。
Confusion 1: 困惑1:
If I use login with gplus there is on file called google-service.json need to insert in app folder but the same time I want to use the FCM that also gives a google-service.json. 如果我使用gplus登录,则需要在应用程序文件夹中插入名为google-service.json的文件,但与此同时,我想使用还提供google-service.json的FCM。 So I can't able to copy to file with same name in app folder.
因此,我无法复制到应用程序文件夹中具有相同名称的文件。 how to handle this?
如何处理呢?
Confusion 2: 困惑2:
If I am using firebase authentication and enable the google sign in. then which token I need to send to server to validate. 如果我正在使用Firebase身份验证并启用Google登录,则需要将哪个令牌发送到服务器进行验证。 The token which I get from
我从中获得的令牌
GoogleSignInAccount acct = result.getSignInAccount();
String t = acct.getIdToken();
or the token which I get from: 或我从中获得的令牌:
FirebaseUser user = mAuth.getCurrentUser();
user.getToken(true)
.addOnCompleteListener(new OnCompleteListener<GetTokenResult>() {
public void onComplete(@NonNull Task<GetTokenResult> task) {
if (task.isSuccessful()) {
String idToken = task.getResult().getToken();
// Send token to your backend via HTTPS
// ...
} else {
// Handle error -> task.getException();
}
}
});
There's a big difference between those 2 classes. 这两个类之间有很大的差异。 As you see in FirebaseUser class documentation there are some method that help you get informations and as you see in GoogleSignInAccount there are other methods.
正如您在FirebaseUser类文档中看到的那样,有一些方法可以帮助您获取信息,而您在GoogleSignInAccount中看到的还有其他方法。
Hope it helps. 希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.