如何重置iOS应用中的所有Facebook的权限?(How to reset all Faceboo

2019-10-17 23:20发布

我正在开发适用于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;
    }
);

我想清除所有权限..这是可能的?

Answer 1:

是的。 下面是一个例子。

[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"

这里 ,是与许可名单。



文章来源: How to reset all Facebook Permission in an iOS app?