Wizcorp / phonegap-facebook-plugin

The official plugin for Facebook in Apache Cordova/PhoneGap
Other
1.91k stars 2.01k forks source link

How to get a token that never expires? #1212

Open matthieu-D opened 8 years ago

matthieu-D commented 8 years ago

Hi, Someone knows how to modify the expiration time for a connection? I'm getting disconnected after the 5183979ms mark.

roysG commented 8 years ago

you can't get token that never expire, but you can check if token is active, and if it is not you can call token method.

facebookConnectPlugin.getAccessToken(function(token) { alert("Token: " + token); }, function(err) { alert("Could not get access token: " + err); });

matthieu-D commented 8 years ago

Cool. Thanks.

BojDom commented 8 years ago

Pass the token to an your server That use the php sdk for example, than you can convert it to a long-lived token that is valid for 60 days https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension