简体   繁体   English

如何从Android应用程序中删除Facebook帖子?

[英]How can I delete a Facebook post from my Android app?

如何使用Facebook Android SDK从我的Android应用程序中删除Facebook帖子?

You can delete a Post if your application created the post. 如果您的应用程序创建了帖子,您可以删除帖子。 Quoting from Post documentation 引用Post文档

You can delete a post as long as your application created the post. 只要您的应用程序创建了帖子,您就可以删除帖子。 You delete a post by issuing an HTTP DELETE request to the POST_ID object with publish_stream permission. 您通过使用publish_stream权限向POST_ID对象发出HTTP DELETE请求来删除帖子。

If the delete is successful, you will get Boolean return about the success. 如果删除成功,您将获得有关成功的Boolean返回。 And as you want to perform the same on Android you will be required to use Request method and pass HttpMethod as DELETE to delete the post 并且由于您希望在Android上执行相同的操作,您将需要使用Request method并将HttpMethod作为DELETE传递以删除帖子

According to Facebook's official documentation, the default HttpMethod is "GET" 根据Facebook的官方文档,默认的HttpMethod是“GET”

package com.facebook public final class HttpMethod extends Enum package com.facebook public final class HttpMethod扩展了Enum

Change it to POST or DELETE to post new status or delete them. 将其更改为POST或DELETE以发布新状态或删除它们。

Refer https://developers.facebook.com/docs/reference/android/3.0/HttpMethod#DELETE 请参阅https://developers.facebook.com/docs/reference/android/3.0/HttpMethod#DELETE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM