How to get new FacebookSDKAccessToken before it has been expired?

Question

I have iPhone application with an functionality of Login with facebook including few other functionalities related to graph API. I receives facebook access token and save it to the server and server then makes further requests to graph API call from web end. As facebook access token expires after 60 days, I am getting access token expired error.

To solve this issue can i use FBSDKAccessToken.refreshCurrentAccessToken method to get new Access token ? I did not find any clear idea for FBSDKAccessToken.refreshCurrentAccessToken.

OR Is there any other way to get new access token by performing automatic login with facebook from our application.

Thanks.


Show source
| facebook   | swift   | ios   | facebook-graph-api   2017-08-17 16:08 1 Answers

Answers to How to get new FacebookSDKAccessToken before it has been expired? ( 1 )

  1. 2017-08-17 20:08

    Native mobile apps using Facebook's SDKs will get long-lived access tokens, good for about 60 days. These tokens will be refreshed once per day when the person using your app makes a request to Facebook's servers. If no requests are made, the token will expire after about 60 days and the person will have to go through the login flow again to get a new token.

    From the FB docs. ^

    It seems the user will have to go through the login process in the app once again.

Leave a reply to - How to get new FacebookSDKAccessToken before it has been expired?

◀ Go back