ios – 检查用户是否已修改Facebook的App权限

我正在使用Facebook创建新用户或登录Parse.

>用户使用Facebook登录登录应用程序
>用户提示接受权限.
>用户接受应用程序请求的所有权限.

4.用户删除了应用程序的权限(从Facebook删除应用程序)

我想知道我们检查用户是否已更改Facebook中应用程序的授权状态的方式是什么.

我该如何检查?我们怎么知道它不再连接?

FBSDKAccessToken.currentAccessToken();不能完成这项工作,因为它只能检查设备中是否存在令牌.

I.E.:用户进入Facebook应用程序设置并从列表中删除应用程序.

p.s.:请帮助推荐这个问题,因为很难找到解决方案.谢谢!!

谢谢

解决方法

Handling an Invalidated Session

We cannot know if the cached Facebook session is valid until we
attempt to make a request to the API. A session can become invalidated
if a user changes their password or revokes the application’s
privileges. When this happens,the user needs to be logged out. We can
identify an invalid session error within a FBSDKGraphRequest
completion handler and automatically log the user out.

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil];
    [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,id result,NSError *error) {
        if (!error) {
            // handle successful response
        } else if ([[error userInfo][@"error"][@"type"] isEqualToString: @"OAuthException"]) { // Since the request failed,we can check if it was due to an invalid session
            NSLog(@"The facebook session was invalidated");
            [PFFacebookUtils unlinkUserInBackground:[PFUser currentUser]];
        } else {
            NSLog(@"Some other error: %@",error);
        }
    }];

资料来源:Integrate Login with Facebook

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...