为什么我的 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 (将#修改为@)