>用户使用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); } }];
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。