0

I'm trying to implement Facebook login and I found my access token expiring after an hour. Now I simply refresh the token when the app is loaded and the currentToken is not nil.

if FBSDKAccessToken.currentAccessToken() != nil {
        FBSDKAccessToken.refreshCurrentAccessToken(nil)
        let storyboard = UIStoryboard(name: "TabBar", bundle: nil)
        let tabBarController = storyboard.instantiateInitialViewController()
        self.presentViewController(tabBarController!, animated: true, completion: nil)
    }

Now I realize that users aren't going to be using my app every hour so I want to have their Facebook login work even if the app is closed for something like a day or a week. I will have their facebookID stored in the keychain so I can use that to check if there's a currently logged in facebook user. However, I don't currently see a way I can change the expiration date of the access token.

  • access token shouldn't expire in an hour. – Shubhank Jul 20 '16 at 03:50
  • I misread, it says it expires after a month. But I'm still having issues where the token magically becomes nil. Should I be saving the token? Not sure why it disappears sometimes. –  Jul 20 '16 at 04:01
  • Possible duplicate of [Generate "never-expire" access token for Facebook Page](http://stackoverflow.com/questions/17426018/generate-never-expire-access-token-for-facebook-page) – jo3birdtalk Jul 20 '16 at 04:10

0 Answers0