我试图找出我的用户使用的提供商,但我不知道如何!我使用的语言是 vanilla javascript。
有一个非常相似的问题:
Firebase Auth - get provider ID
但这仅适用于 swift 3 ...
我是Firebase的新用户,我正在尝试将Firebase Auth api连接到我的应用程序中,我已经关注了来自官方网站的更新文档的文档,所有工作都正常.
我已经成功完成了SignIn,在我的仪表板中,我登录后获得了所有用户.
我的问题是我对从Firebase返回的各种ID感到困惑
代码如下:
for (UserInfo profile : user.getProviderData()) {
// Id of the provider (ex: google.com)
String providerId = profile.getProviderId();
//if Id of the provider is firebase it means we have successfully get back data after saving in firebbase hence we continue to app
if(providerId.equals("firebase")) {
// UID specific to the provider
Other.SavePref(this, "LoginToken", profile.getUid());
// Name, email address, and profile photo Url
String name = profile.getDisplayName();
String email = profile.getEmail();
Uri photoUrl = profile.getPhotoUrl(); …Run Code Online (Sandbox Code Playgroud)