简体   繁体   中英

Multiple Objects in a Facebook Open Graph Story?

I am trying to do something like what Spotify does with posting the music that users are currently listening to to their activity log. When someone listens to a song on Spotify, it shows up as "User listened to {song name} by {artist name} on Spotify." All I can get is "User has listened to {song name}." How do I pass the artist name and where they listened to the song? Here is my code so far:

FB.api(
    'me/musicalfamilytree:is_listening_to','post', {
        song: "link to song",
        album: "link to album",
        musician: "link to musician",
        expires_in: "duration in seconds"
    }
);

In all of the pages I have the following meta tags (which I have debugged with Facebook's object debugger): App_id, url, type, title, site_name, musician.

I've found good documentation on these sites:

https://developers.facebook.com/docs/opengraph/music/ https://developers.facebook.com/docs/reference/opengraph/object-type/music.song/

To get posts like Spotify you'll need to use the builtin music.listens action, as documented here: http://developers.facebook.com/docs/reference/opengraph/action-type/music.listens

Your example would then look like

FB.api(
    'me/music.listens','post', {
        song: "link to song",
        expires_in: "duration in seconds"
    }
);

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