-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Facebook PHP SDK version #46
Comments
I think with this SDK can provide for example $fb = new Facebook\Facebook([
'app_id' => 'app id',
'app_secret' => 'app secret',
'default_graph_version' => 'v2.5',
]);
if(isset($_SESSION['token'])){
$id = $_POST['pageid'];
$message = $_POST['message'];
$h = $_POST['hour'];
$m = $_POST['minutes'];
$s = $_POST['seconds'];
$d = $_POST['date'];
$month = $_POST['month'];
$y = $_POST['year'];
//More handy to connect graph with get method
$res = $fb->get('/me/accounts', $_SESSION['token']);
$res = $res->getDecodedBody();
foreach($res['data'] as $page){
if($page['id'] == $id){
$accesstoken = $page['access_token'];
break;
}
}
$time = strtotime($month . '-' . $d . '-' . $y . ' ' . $h . ':' . $m . ':' . $s);
$data = array(
'message' => $message,
'scheduled_publish_time' => $time,
'published' => 'false'
);
//More handy to post status or scheduling with post method
$res = $fb->post($id . '/feed/', $data, $accesstoken);
} |
If update to v5 is a BC breaking, how to add $social = Yii::$app->getModule('social');
$social->fbGet('/me/accounts', $_SESSION['token']); or $social = Yii::$app->getModule('social');
$data = [
'message' => $message,
'scheduled_publish_time' => $time,
'published' => 'false'
];
$social->fbPost($id . '/feed/', $data, $accesstoken); |
Get updated release v1.3.2 where the extension has been modified to use Facebook SDK 5.0. Refer updated docs & demos. |
Coolllll, thank you !!! 👍 |
Actualy Facebook PHP SDK is v5
The text was updated successfully, but these errors were encountered: