Extending Access Token Validity after Offline Access Deprecation
Facebook's deprecation of the offline_access permission has created uncertainty regarding the acquisition of long-lived access tokens.
Specifically, the documentation suggests that server-side OAuth-generated tokens will possess extended validity. However, this does not appear to be the case.
Addressing the Issue
The provided response presents two solutions:
Solution 1: Official Facebook PHP SDK Update (August 14th, 2012)
An updated version of the official Facebook PHP SDK includes a method named setExtendedAccessToken. Calling this method will create a new access token with a 60-day expiration period.
Solution 2: Custom Function
A custom function can be added to the base_facebook.php file in the Facebook class. This function, getExtendedAccessToken, retrieves a refreshed access token with a 60-day validity.
Additional Notes
The above is the detailed content of How Can I Extend Facebook Access Token Validity After Offline Access Deprecation?. For more information, please follow other related articles on the PHP Chinese website!