2013-07-04 116 views
1

我的應用程序發佈了到Facebook的Feed故事,直到昨天。com.facebook.FacebookException:無法構造請求主體

現在停止工作,並在回調發送此錯誤:

「com.facebook.FacebookException:無法構建請求體」

這來自:

response.getError(); 

奇怪的來自Facebook的示例應用程序停止工作,現在正在報告相同的錯誤,我確定我沒有更改任何內容。

這裏的示例應用程序的功能:

private void publishStory() { 
    Session session = Session.getActiveSession(); 

    if (session != null){ 

     // Check for publish permissions  
     List<String> permissions = session.getPermissions(); 
     if (!isSubsetOf(PERMISSIONS, permissions)) { 
      pendingPublishReauthorization = true; 
      Session.NewPermissionsRequest newPermissionsRequest = new Session 
        .NewPermissionsRequest(this, PERMISSIONS); 
     session.requestNewPublishPermissions(newPermissionsRequest); 
      return; 
     } 

     Bundle postParams = new Bundle(); 
     postParams.putString("name", "Facebook SDK for Android"); 
     postParams.putString("caption", "Build great social apps and get more installs."); 
     postParams.putString("description", "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps."); 
     postParams.putString("link", "https://developers.facebook.com/android"); 
     postParams.putString("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"); 

     Request.Callback callback= new Request.Callback() { 
      public void onCompleted(Response response) { 
       FacebookRequestError error = response.getError(); 
       if (error != null) { 
         Toast.makeText(getApplicationContext(), 
          error.getErrorMessage(), 
          Toast.LENGTH_SHORT).show(); 
         return; 
       } 


       JSONObject graphResponse = response 
              .getGraphObject() 
              .getInnerJSONObject(); 
       String postId = null; 
       try { 
        postId = graphResponse.getString("id"); 
       } catch (JSONException e) { 
        Log.i("publishStory", 
         "JSON error "+ e.getMessage()); 
       } 

       Toast.makeText(getApplicationContext(), postId,Toast.LENGTH_LONG).show(); 
      } 
     }; 

     Request request = new Request(session, "me/feed", postParams, 
           HttpMethod.POST, callback); 

     RequestAsyncTask task = new RequestAsyncTask(request); 
     task.execute(); 
    } 

} 

誰能幫助請! 預先感謝您。

回答

1

現在的作品......我在晚上關掉我的電腦和Eclipse,現在重新啓動

我想這是在編譯器中的一些bug。

相關問題