如何以编程方式删除尚未被您的应用程序 post 编辑的 facebook post?

How to delete facebook post programmatically that has not been posted by your application?

如何删除未被您的应用程序 post 编辑的 Facebook post?

  1. 使用图表 API - 根据文档

/* 调用 API */
new GraphRequest( AccessToken.getCurrentAccessToken(), "/{post-id}", null, HttpMethod.DELETE, new GraphRequest.Callback() { public void onCompleted(GraphResponse response) { /* handle the result */ } } ).executeAsync();

以上代码无效。

给出错误:-

{
  "error": {
    "message": "(#200) This post wasn't created by the application",
    "type": "OAuthException",
    "code": 200,
  }
}
  1. 或者还有其他方法吗?

根据 Graph API reference:

An app can delete any post it published, or a page-management app can delete a Post published to a Page that the app manages.

所以这取决于你在做什么。