Search code examples
iosfacebookfacebook-graph-apifacebook-ios-sdk

FaceBook logging out when getting error on a request


So I am using the Facebook iOS SDK and I get this very annoying thing where I am getting logged out when a request to the open graph fails. How do I prevent this from happening? Here's how I am posting it:

 [_facebook requestWithGraphPath:graphPath
                              andParams:params 
                          andHttpMethod:@"POST" 
                            andDelegate:nil];

Solution

  • Fb SDK is a complete mess, but what you could do:

    • set your object to be a delegate
    • implement protocol methods that catches error
      • in that methods check if you're still logged in
      • if not - login, or do whatever you want (present error alert/start another request/etc)