在我们的 android 应用程序中,我们提供了在 Facebook 页面上安排和发布帖子的功能。我们还提供了删除预定帖子的功能。
对于上述功能,我们已经通过 App Review 获得了所需的权限( publish_pages、manage_pages )。
所有功能都可以在我们的 Android 和 iOS 平台上完美运行。但在过去的几周里,我们在删除 Android 平台上的日程安排帖子时遇到了错误。当我们在 Android 平台上检查此功能有什么问题时,我们得到了以下错误。
错误:
{Response: responseCode: 403, graphObject: null, error: {HttpStatus: 403, errorCode: 200, subErrorCode: -1, errorType: OAuthException, errorMessage: (#200) The permission(s) pages_manage_engagement are not available. It could because either they are deprecated or need to be approved by App Review.}}
基于上述错误,我们检查了 Facebook 平台上的文档,它说“ pages_manage_engagement ”权限用于“创建、编辑和删除 您的页面 发布的评论”。我们没有提供与页面评论相关的任何功能。
重要的是 删除预定帖子时出现上述错误 .我们已经获得了 publish_pages 的许可。我附上了它的图像。
Facebook 登录和分享依赖
implementation 'com.facebook.android:facebook-login:5.8.0'
implementation 'com.facebook.android:facebook-share:5.8.0'
所以我要求您检查并验证上述问题。让我知道进一步的过程和解决方案。
谢谢你。
最佳答案
Below peace of code I am using for delete posts.
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/" + "post_id",
null,
HttpMethod.DELETE,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
这里我直接传一个 post_id 删除预定的帖子。它在 Graph API v7.0 之前完美运行。
但是在弃用
publish_pages
之后, manage_pages
权限,它不起作用。Solution
我已追加 page_id 之前 post_id 像这样
“PAGE_ID”+“_”+“POST_ID”
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/" + "page_id" + "_" + "post_id",
null,
HttpMethod.DELETE,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
它就像一个魅力。
关于android - 删除预定的 Facebook 页面帖子 : pages_manage_engagement are not available 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64643614/