I am using GraphRequest from react-native-fbsdk
to post to FB from my app. Specifically, I am trying to post a link to an mp4 video that is hosted externally, so at a url like https://img.myapp.com/image_id.mp4
. Here is the code for my request:
return new Promise(function(resolve, reject) {
const post = new GraphRequest('/me/feed', {
httpMethod: 'GET',
version: 'v2.9',
...payload,
}, (err, result) => {
if (err) {
reject(err);
}
resolve();
});
new GraphRequestManager().addRequest(post).start();
});
And here is the payload
:
{
httpMethod: 'POST',
parameters: {
type: { string: 'article' },
message: { string: message || '' },
caption: { string: 'Powered by MyApp' },
link: { string: media.url },
ref: { string: uuid },
picture: { string: media.url },
source: { string: media.url },
properties: [
{ name: { string: 'type' }, text: { string: 'video.other' } },
],
}
My core issue is that I want to post an mp4 link to FB and see the video loop (as it is only a few seconds long). I am pretty sure that this properties
property is where I should be specifying type, height, width, and other properties that I would add a meta tag for elsewhere to pass along info about the video in the link. However,
with properties
written the way I have it I get this error: graph api Error: Unexpected value for parameter 'properties'. Request parameters need to be objects with a 'string' field.
Here is a screen shot of the properties
block in the Graph API - POST docs (https://developers.facebook.com/docs/graph-api/reference/v2.11/post):
I have tried as many different configurations for this object (or array?) as I can think of and they all return this error. Is there anyone out there that is familiar with posting an mp4 video using GraphRequest or can at least advise me on how to use the properties
parameter? Thanks in advance!