通过 API 删除 Facebook 应用程序
我有一个网络应用程序,它将应用程序添加到用户配置文件中,并请求扩展权限。
当用户从我的网络应用程序请求这样做时,我似乎找不到是否有办法使用脚本从用户配置文件中删除应用程序。我知道他们可以在登录 Facebook 时删除该应用程序,但我想知道是否可以通过 API 调用删除该应用程序。感谢您的任何帮助。
I have a web app that adds an application to a users profile, and requests extended permissions.
I can't seem to find if there is a way to use a script to remove the application from the users profile when they request to do so from my web app. I know they can remove the app when logged into Facebook, but I want to know if I can remove the app with an API call. Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用 HTTP DELETE 请求:
来自 http://developers.facebook。 com/docs/reference/api/user/#permissions:
您可以通过使用用户 access_token 向 PROFILE_ID/permissions 发出 HTTP DELETE 请求来代表用户取消对应用程序的授权或撤销特定的扩展权限那个应用程序。
You can use a HTTP DELETE request with:
From http://developers.facebook.com/docs/reference/api/user/#permissions:
You can de-authorize an application or revoke a specific extended permissions on behalf of a user by issuing an HTTP DELETE request to PROFILE_ID/permissions with a user access_token for that app.
接受的答案已经超过 3 年了,现在已经过时了。
来自:https://developers.facebook.com/docs/ graph-api/reference/user/permissions/#Deleting
请注意,排除
{permission-name}
将撤销所有权限。The accepted answer is over 3 years old and is now outdated.
From: https://developers.facebook.com/docs/graph-api/reference/user/permissions/#Deleting
Note that excluding
{permission-name}
will revoke all permissions.这是从用户配置文件中删除应用程序的javascript方式(Fb js sdk api调用):
https://stackoverflow.com/a/7741978/246435
This is the javascript way (Fb js sdk api call) to remove the application from the user profile:
https://stackoverflow.com/a/7741978/246435
更新:正如其他人提到的,Facebook 现在有了这个 API。不幸的是,我认为没有办法改变已接受的答案来给予信任。
来自: https://developers.facebook.com/docs/ graph-api/reference/user/permissions/#Deleting
请注意,排除 {permission-name} 将撤销所有权限。
UPDATED: As others have mentioned, Facebook now has this API. I don't think there is a way to change the accepted answer to give credit unfortunately.
From: https://developers.facebook.com/docs/graph-api/reference/user/permissions/#Deleting
Note that excluding {permission-name} will revoke all permissions.
如果有人感兴趣的话,我有一个 PHP 示例(2017 年使用 Graph v5):
所以你必须使用:
而不是使用 v4 中的
FacebookRequest
类。I have a PHP example if anyone is interested (with Graph v5 in 2017):
So you would have to use:
Instead of using the
FacebookRequest
class in v4.