I am trying to post a video to a facebook user's timeline by following Video Creation Graph API end point documentation. Before posting to Graph API, I sign in a user using FB.login(). I ask the user to grant public_profile, email, and user_videos permissions to my facebook application. A user signs in successfully and an access token is returned. I also receive user_videos,email,public_profile in grantedScopes section in the FB.login() callback response.
However, when I make an FB.api() request to post a video to user timeline, I see this error:
window.FB.api(
`${authResponse.userID}/videos`,
'POST',
{
file_url: <video-url>,
access_token: authResponse.accessToken,
},
(response) => {
console.log(response)
}
)
{
"error": {
"message": "(#100) No permission to publish the video",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "whatever"
}
}
A few things to note are:
Application review warning on login dialog:
When the Facebook login dialog is displayed to the user, a warning is displayed on top:
Submit APP-NAME for Login Review Some of the permissions below have not been approved for use by Facebook. Submit for review now or learn more.
I am using Test Version of my application to develop this feature. Moreover, I am using the admin user of the facebook application to test this integration. I don't understand why above warning is displayed. Do I really need to submit my application for review while I am in the process of integrating this feature?
Disallowed posting to facebook
Another warning: This doesn't let the app post to Facebook is displayed on the login dialog. As far as I know, the user_videos permission should let my application post videos to a user's timeline. But the displayed warning is contradictory to my assumption. Do I need to ask some additional permissions before I can post videos to user timeline?
HTTPS errors because of development on localhost
I see errors related to non-availability of an HTTPS domain in my browser developer console when integrating application on localhost.
The method FB.getLoginStatus can no longer be called from http pages.
The method FB.login can no longer be called from http pages.
The method FB.api can no longer be called from http pages.
Do I need to implement https for my local development setup before I can carry out this integration?
Posting to graph-video.facebook.com
I am confused with the Video Publishing documentation. It says that I need to make a POST request to https://graph-video.facebook.com instead of https://graph.facebook.com in order to publish a video. The same documentation also mentions that, "Publishing on Users is not supported". This is contradictory to Video Creation documentation.
What exactly should I do in order to be able to post a video to facebook user timeline using FB.api or any other method?