简体   繁体   中英

Facebook OpenGraph - POSTing using the FB.api

This might be a beginners question, but I have to ask it nonetheless since I don't really understand this. I have successfully debugged my page and the user is authenticated to use the app. So the debugger is picking up all my meta og: tags properly. Running the below function allows me to a post a status update to my timeline which is 'A status update'. But that's not what I want, I want the meta og: tags to create a great looking page specific post which Open Graph is all about, but that doesn't happen, it's just a plain old boring status update with a link to my page. Why?

FB.api(
 '/me/[my namespace]:button',
 'post',
 { message: 'A status update' },
 callback function
});

Additionally, what am I actually supposed to put in the third parameter, what is the third parameter for? That is the {message: 'A status update'} parameter.

Finally, is this the way to post to timeline using opengraph and apps? I am not sure as I don't know what that stuff they have when I 'get code' on the developers page is. That curl stuff, what's that for? I can't have that on my page?

But that's not what I want, I want the meta og: tags to create a great looking page specific post which Open Graph is all about, but that doesn't happen, it's just a plain old boring status update with a link to my page. Why?

Because you're not giving the address of any Open Graph object with your action … there's no URL anywhere, so where do you think Facebook should pull the OG meta data from …?

Set your action up in a way so that it references some kind of OG object, and then give that object's URL when you're publishing the action.

The examples in the Open Graph documentation in the developer section should make pretty clear how it works.

https://developers.facebook.com/docs/opengraph/actions/#create

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM