My app is in development mode. I'm using publish_video permission to publish video on user's timeline. Which as a developer I can publish on my timeline only. But I'm getting 100 error saying no permission to publish video
I tried to generate access token with permission "publish_video" and send it in the api to publich video. But still geeting the same error
When a user clicks on FB share button, The following code executed to get permission from the user.
FB.login(function(response) {
if (response.authResponse) {
var accesstoken = response.authResponse.accessToken;
Here I call my method and send access token
} else {
alert('User cancelled login or did not fully authorize.');
}
}, {scope: 'publish_video'});
return false;
};
window.fbAsyncInit = function() {
FB.init({
appId: 'APPID',
cookie: true, // This is important, it's not enabled by default
version: 'v2.2'
});
};
My app is in development mode. I'm using publish_video permission to publish video on user's timeline. Which as a developer I can publish on my timeline only. But I'm getting 100 error saying no permission to publish video I tried to generate access token with permission "publish_video" and send it in the api to publich video. But still geeting the same error
When a user clicks on FB share button, The following code executed to get permission from the user. FB.login(function(response) { if (response.authResponse) { var accesstoken = response.authResponse.accessToken; Here I call my method and send access token } else { alert('User cancelled login or did not fully authorize.'); } }, {scope: 'publish_video'}); return false; }; window.fbAsyncInit = function() { FB.init({ appId: 'APPID', cookie: true, // This is important, it's not enabled by default version: 'v2.2' }); };
(function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));
Share video method in the controller require_once DIR . '/../../vendor/autoload.php'; $fb = new Facebook\Facebook([ 'app_id' => 'APPID', 'app_secret' => 'APP SECRET', 'default_graph_version' => 'v2.3', ]); $accesstoken = $this->input->post('accesstoken'); $data = [ 'title' => 'My Foo Video', 'description' => 'This video is full of foo and bar action.', ]; $accessToken = $accesstoken; $path = $this->input->post('link'); try { $response = $fb->uploadVideo('me', $path, $data, $accessToken); } catch(Facebook\Exceptions\FacebookResponseException $e) { echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(Facebook\Exceptions\FacebookSDKException $e) { echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } $graphNode = $response->getGraphNode(); echo 'Video ID: ' . $graphNode['id']; exit;