相关疑难解决方法(0)

firebase auth - 获取当前的提供者 javascript

我试图找出我的用户使用的提供商,但我不知道如何!我使用的语言是 vanilla javascript。
有一个非常相似的问题:
Firebase Auth - get provider ID
但这仅适用于 swift 3 ...

javascript firebase firebase-authentication

6
推荐指数
3
解决办法
1617
查看次数

Firebase会返回多个ID,这是唯一的ID?

我是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)

android firebase firebase-authentication

4
推荐指数
1
解决办法
2350
查看次数