删除Facebook发布的消息

时间:2012-03-15 05:29:31

标签: java android facebook facebook-graph-api comments

  

可能重复:
  Delete a Facebook posted messages by using the Facebook GRAPH API? (For Android)

我想删除Facebook帖子消息。

http://developers.facebook.com/docs/reference/api/post/ ----->删除部分。

  private void deleteStatus() {      
                try {         
       String id = "100003613093757_108952429235193"; // I put another ID  
       Bundle param = new Bundle();         
       param.putString("method", "delete");         
       BasicInfo.FacebookInstance.request(id, param, "POST");     
       } catch (Exception ex) {        
          ex.printStackTrace();    
      } 
    } 

我的代码出了什么问题?

1 个答案:

答案 0 :(得分:0)

HTTP方法是请求的第三个参数(https://developers.facebook.com/docs/reference/androidsdk/request/)。所以你想要DELETE你写的POST,你可以从bundle中删除该方法。这应该有效:

private void deleteStatus() {      
                try {         
       String id = "100003613093757_108952429235193"; // I put another ID  
       Bundle param = new Bundle();         
       BasicInfo.FacebookInstance.request(id, param, "DELETE");     
       } catch (Exception ex) {        
          ex.printStackTrace();    
      } 
    }

private void deleteStatus() { try { String id = "100003613093757_108952429235193"; // I put another ID Bundle param = new Bundle(); BasicInfo.FacebookInstance.request(id, param, "DELETE"); } catch (Exception ex) { ex.printStackTrace(); } }

如果这样做不适合你,你能否分享你得到的错误?