微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么我的 gmail 登录不能通过 firebase 工作

如何解决为什么我的 gmail 登录不能通过 firebase 工作

我对编码一无所知,并且一直在学习

我似乎无法通过谷歌登录,即使我确实在 firebase 上显示为活动状态

谁能看到我是否遗漏了什么?

//Relate to google login
   private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
       try {
           GoogleSignInAccount account = completedTask.getResult(ApiException.class);
           if (account != null) {
               String id = account.getId();
               String fname = "" + account.getGivenname();
               String lname = "" + account.getFamilyName();

               // if we do not get the picture of user then we will use default profile picture

               String pic_url;
               if (account.getPhotoUrl() != null) {
                   pic_url = account.getPhotoUrl().toString();
               } else {
                   pic_url = "null";
               }


               if (fname.equals("") || fname.equals("null"))
                   fname = getResources().getString(R.string.app_name);

               if (lname.equals("") || lname.equals("null"))
                   lname = "User";

               Change_Url_to_base64(id,fname,lname,pic_url,"gmail");


           }
       } catch (ApiException e) {
           Log.w("Error message","signInResult:Failed code=" + e.getStatusCode());
       }

   }


   public void Change_Url_to_base64(final String user_id,final String f_name,final String l_name,String picture,final String singnup_type) {

       Functions.show_loader(this,false,true);
       Log.d(Variables.tag,picture);

       if (picture.equalsIgnoreCase("null")) {
           Call_Api_For_Signup(user_id,f_name,l_name,picture,singnup_type);
       } else {
           Glide.with(this)
                   .asBitmap()
                   .load(picture)
                   .into(new CustomTarget<Bitmap>() {
                       @Override
                       public void onResourceReady(@NonNull Bitmap resource,@Nullable Transition<? super Bitmap> transition) {
                           String image_base64 = Functions.bitmap_to_base64(Login_A.this,resource);
                           Call_Api_For_Signup(user_id,image_base64,singnup_type);
                       }

                       @Override
                       public void onLoadCleared(@Nullable Drawable placeholder) {
                       }
                   });
       }
   }

我只是纠正这部分,因为网站一直告诉我它主要是代码,我需要添加更多细节,即使我不知道还有什么要问或添加

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。