moosefetcher
moosefetcher

Reputation: 1901

Specifying 'share' text in a FB.ui share_open_graph call

I have been searching for an answer for the last day-and-a-half; I can't believe Facebook's documentation is so sparse. I have the Facebook SDK initialising in my html. I have a div with an id="fb-root". On a button click I call the following in js:

FB.ui({
        method: 'share_open_graph',
        action_type: 'og.likes',
        action_properties: JSON.stringify({
            object:'https://developers.facebook.com/docs/dialogs/',
        })
    }, function(response){});

This produces a pop up window that says 'X likes an article on...' followed by the web app page title. Does anyone know how to customise THAT piece of text so it says 'X scored Y points on...'?

I can't seem to find info on the action_type options for the share_open_graph method. Any pointers are very welcome.

EDIT

Well, having found the list of action_types. https://developers.facebook.com/docs/reference/opengraph

...I set up a custom action_type and associated object. How do I then set up the properties of my object? What are the properties we're supposed to use when we use the share_open_graph method? And WHY don't they tell us on developers.facebook?!

Facebook is telling me I need to publish my custom action to have it approved. The 'instructions' are here:

https://developers.facebook.com/docs/opengraph/using-actions/v2.0#publish

Does anyone fancy telling me what, exactly, that all means? How to I make an HTTP POST to a Graph API endpoint, for instance?

Upvotes: 0

Views: 5812

Answers (1)

Eddie O'Neil
Eddie O'Neil

Reputation: 318

Suggest starting with the doc on custom stories:

https://developers.facebook.com/docs/opengraph/creating-custom-stories

You would need to create a custom action [ex: "scored"] / object [ex: "points"], connect them as a story, and customize from there.

Upvotes: 1

Related Questions