0
|
1 <?php
|
|
2
|
|
3 /**
|
|
4 * Shows how to exchange a short lived access token to a long one.
|
|
5 *
|
|
6 * @author Xavier Barbosa
|
|
7 * @since 13 February, 2013
|
|
8 * @link https://developers.facebook.com/docs/howtos/login/extending-tokens/
|
|
9 **/
|
|
10
|
|
11 use Mute\Facebook\App;
|
|
12
|
|
13 /**
|
|
14 * Default params
|
|
15 **/
|
|
16
|
|
17 $app_id = "YOUR_APP_ID";
|
|
18 $app_secret = "YOUR_APP_SECRET";
|
|
19 $access_token = 'YOUR_PREVIOUS_TOKEN';
|
|
20
|
|
21 /**
|
|
22 * The process
|
|
23 **/
|
|
24
|
|
25 $app = new App($app_id, $app_secret);
|
|
26 $new_access_token = $app->getOAuth()->exchangeAccessToken($access_token);
|