Вопрос

I'm just getting started with Facebbook API/OpenGraph and RestFB.

I created a custom object and action type on Facebook.

However, I don't quite get the concept of how RestFB works with publishing an action with an object.

I'm able to publish an action (complete) like this:

FacebookType publishMessageResponse =
facebookClient.publish("me/myapp:complete", Post.class, 
Parameter.with("mycustomobject", "http://samples.ogp.me/xxxxxxxxxxxxx"),

What I don't understand is how to create an object with all necessary parameters and pass it into the publishMessage. In this case I just linked to the sample object that was provided by Facebook for illustration.

Это было полезно?

Решение

What I don't understand is how to create an object with all necessary parameters and pass it into the publishMessage.

Open Graph objects are basically just URLs.

You put all the necessary info into the HTML that this URL delivers, into the Open Graph meta elements. (See OG docs for this.)

Then, when publishing your action on an object, you just give that object’s URL, and Facebook will fetch the data from there. (Unless you have some additional custom properties, for which you can also give the values while publishing the action).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top