2013-05-19 214 views
0

嗨我已經在我的Android應用程序中使用Facebook登錄。當我在我的設備中構建並運行它時,它工作正常。Facebook的登錄不工作

現在我上傳應用程序到playstore併發布它進行beta測試。但不是Facebook登錄不起作用。我想這個會議並沒有被打開。我刪除了應用程序,然後從eclipse重新安裝。那麼它的工作很好。我無法調試,因爲我不知道如何調試已簽名的發佈版本。或者我猜它不可能。反正任何類似的問題發生在你身上? 任何解決辦法?或者如何調試?

我使用Facebook登錄按鈕和其他代碼低於

private void onSessionStateChange(Session session, SessionState state, Exception exception) { 
     if (state.isOpened()) { 
      if(!PreferenceHelper.getString(this, "logged_in_status").equals("YES")){ 
       Log.i("sdf", "Logged in..."); 
       this.progress.setVisibility(View.VISIBLE); 
       Request.executeMeRequestAsync(session, new Request.GraphUserCallback() { 

         // callback after Graph API response with user object 
         @Override 
         public void onCompleted(GraphUser user, Response response) { 
          userInfo = user; 
          userId = user.getId(); 
         user_name = user.getName(); 

         Handler looper = new Handler(Looper.getMainLooper()); 
         looper.post(new Runnable() { 
           @Override 
          public void run() { 
            new DownloadFile().execute("http://graph.facebook.com/"+userId+"/picture?type=large"); 
           } 
          }); 
         try { 
          emailText = user.getInnerJSONObject().getString("email"); 
         } catch (JSONException e) { 
          // TODO Auto-generated catch block 
          e.printStackTrace(); 
         } 

          Log.w("myConsultant", user.getId() + " " + user.getName() + " " + user.getInnerJSONObject()); 
         } 
        }); 
      } 
      else{ 
       this.shareFacebook.setVisibility(View.VISIBLE); 
      } 

     } else if (state.isClosed()) { 
      PreferenceHelper.setString(this, "logged_in_status", "NO"); 
      PreferenceHelper.setString(this, "facebook_user_id", ""); 
      PreferenceHelper.setString(this, "user_id",""); 
      PreferenceHelper.setString(this, "user_name", ""); 
      Intent a = new Intent(this,MainMenuActivity.class); 
      startActivity(a); 
      overridePendingTransition (R.anim.right_slide_in, R.anim.left_slide_out); 
      Log.i("sdf", "Logged out..."); 
     } 
    } 
    private Session.StatusCallback callback = new Session.StatusCallback() { 
     @Override 
     public void call(Session session, SessionState state, Exception exception) { 
      onSessionStateChange(session, state, exception); 
     } 
    }; 

感謝和問候,

+0

請發佈相關代碼請 – OMGtechy

+0

@JoshuaGerrard新增 –

+0

當您嘗試在發佈版本上登錄時會發生什麼?此外,你是否初始化所有變量(在調試模式下,編譯器有時會爲你做這件事,但並不總是在發佈中)。 – OMGtechy

回答