comparison default/assets/vendors/theme-widgets/vendor/mute/facebook/example/debugging-access-tokens.php @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
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);