I'm making a very simple site where users can do a silly little test, and share the result to facebook. After visitor shares they should be redirected to another page on the site.
I've gotten it working using the feed dialodbut it seems like Share dialog is recommended and somehow maybe better?
So:
- How are Share dialog and Feed dialog different?
- Which one should I use for what purpose?
- Is it possible to redirect the user to a new page after successful share with the Share dialog? It says that the ID of response data is ”Only available if the user is logged into your app using Facebook and has granted publish_actions. If present, this is the ID of the published Open Graph story.”
Here is the code I'm using (Feed Dialog). What we share will depend on the the results of the test the user did.
function share_prompt(){
FB.ui(
{
method: 'feed',
name: fbName,
link: fbLink,
picture: fbPictureUrl,
caption: fbCaption,
description: fbDescription,
message: fbMessage
},
function(response) {
if (response && response.post_id) {
//alert('Post was published.');
alert('redirect to a page-->');
window.location.href = "http://ift.tt/1BTThGW";
} else {
alert('User didin't share the story, we'll do something else);
}
}
); //FB.ui
}
Aucun commentaire:
Enregistrer un commentaire