在我的应用程序中,我遇到了一些问题。我希望有人能帮我解决这个问题。 所以故事是,当用户使用他的 Facebook 帐户登录我的应用程序时,我正在使用他的 Facebook 登录信息在我的数据库中创建一个帐户。
现在当用户从我的应用程序(最终从数据库)中删除他的帐户时,他的帐户仍然列在 facebook 的使用 facebook 登录安装我的应用程序的用户列表中。 因此,当他从我的数据库中删除帐户时,我也希望用户的帐户也从 facebook 中删除。 为了解决这个问题,我搜索并发现我可以让用户从 facebook iOS sdk 撤销权限。我不知道这是否会解决我的问题,但我想我会试一试。
现在,当我使用以下代码撤销用户访问权限时:-
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/permissions/public_profile"
parameters:nil
HTTPMethod:@"DELETE"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
NSLog(@"DELETE-public_profile == %@",result);
}];
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/permissions/email"
parameters:nil
HTTPMethod:@"DELETE"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
NSLog(@"DELETE-Email == %@",result);
}];
public_profile 的访问权限未被撤销。
甚至可以删除此权限吗?
如果不是,那么我应该如何尝试解决从 Facebook 列表中删除帐户的基本问题。
最佳答案
就 FBSDK 图而言,基本上,只需将 @"me/permissions/public_profile"替换为对我有用的 @"me/permissions"即可。
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/permissions" parameters:nil
HTTPMethod:@"DELETE"] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// ...
}];
这将删除所有权限,并应完全撤销访问权限并将用户与应用分离
此外,是否尝试在他们的网站上使用 FB 图形 API 时查看调用此删除的效果?:
https://developers.facebook.com/docs/facebook-login/permissions/v2.4
即:
Revoking Login
You can also let people completely de-authorize an app, or revoke login, by making a call to this Graph API endpoint:
DELETE /{user-id}/permissions
This request must be made with a valid user access token or an app access token for the current app. If the request is successful, your app receives a response of true. If the call is successful, any user access token for the person will be invalidated and they will have to log in again. Because you're de-authorizing your app, they will also have to grant access to your app as if they were logging in for the first time.
关于ios - 我可以撤销 facebook iOS sdk 的 public_profile 权限吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32027212/