我正在为iOS和测试应用程序开发应用程序,我需要清除/重置所有facebook权限......怎么能这样做?
如果检查权限白色图表路径,我会看到此日志
[PF_FBRequestConnection startWithGraphPath:@"me/permissions"
completionHandler:^(PF_FBRequestConnection *connection, id result, NSError *error) {
NSLog(@"facebook_permission: %@",result);
}];
结果是
[6412:c07] facebook_permission: {
data = (
{
"create_note" = 1;
email = 1;
installed = 1;
"photo_upload" = 1;
"publish_actions" = 1;
"publish_stream" = 1;
"share_item" = 1;
"status_update" = 1;
"user_about_me" = 1;
"user_birthday" = 1;
"user_location" = 1;
"video_upload" = 1;
}
);
我想清除所有许可..这可能吗?
答案 0 :(得分:4)
是的,确实如此。这是一个例子。
[FBRequestConnection startWithGraphPath:@"/me/permissions"
parameters:nil HTTPMethod:@"delete"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error && result == true) {
// Revoking the permission worked
NSLog(@"Permission successfully revoked");
} else {
// There was an error, handle it
NSLog(@"here was an error");
// See https://developers.facebook.com/docs/ios/errors/
}
}];
例如,如果要删除特定权限只需更改路径,此处我将撤消publish__actions权限startWithgraphPath:@"/me/permissions/publish_actions"
Here,是拥有权限的列表。