ios facebook sdk撤销访问权限

时间:2012-05-31 12:00:01

标签: objective-c ios facebook-graph-api

我对iOS有一个静止

如何在Facebook图形api中撤销access_premission以使用户能够重新登录。

这是我的代码

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *string = [NSString stringWithFormat:@"https://graph.facebook.com/ID?access_token=%@",[defaults objectForKey:@"FBAccessTokenKey"]];
NSLog(@"string = %@",string);

ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:string]];
[request setRequestMethod:@"DELETE"];
[request startSynchronous];

[facebook logout];

也许我做错了什么。

当我尝试发布新的Facebook消息时,我仍然拥有已经自动调整的屏幕

谢谢!

1 个答案:

答案 0 :(得分:0)

使用最新的Facebook SDK非常简单:

FBRequest *request = [FBRequest requestForDeleteObject:@"me/permissions"];
[request startWithCompletionHandler: ^(FBRequestConnection *connection, NSDictionary* result, NSError *error) {}