I created a post to a Facebook Page and got the permalink_url successfully using the api as shown in my code below:
let postUrl = `https://graph.facebook.com/${pageId}/feed`;
let { data } = await axios.post(postUrl, urlParams);
let postId = data.id;
let accessToken = access_token;
let postLinkRequestUrl = `https://graph.facebook.com/v2.8/${postId}?fields=permalink_url&access_token=${accessToken}`;
let postLinkRequestResponse = await axios.get(postLinkRequestUrl);
let { permalink_url } = postLinkRequestResponse.data; //Perma Link gotten successfully for post to be rendered outside Facebook
Now, I'm trying to render the post outside Facebook using a ReactJS Library called react-facebook as below
<FacebookProvider appId={process.env.REACT_APP_FACEBOOK_APP_ID}>
<EmbeddedPost href={post.permaLink}
width="200"
onLoad={() => {
setLoaded(true);
}} />
</FacebookProvider>
And all I keep getting back in return is this error message
This Facebook post is no longer available. It may have been removed or the privacy settings of the post may have changed.
Which begs the question, how can I make the post public during the creation phase or what else can I do so I can render it outside Facebook even though it is within a specific Facebook Page.
Thanks in anticipation of your response.