user798596
user798596

Reputation:

Redirect user to a specific URL after he Likes the page?

Is it possible with the Facebook OpenGraph's and API's to redirect user to a specific URL after he Likes a certain page?

Upvotes: 0

Views: 889

Answers (1)

Nitzan Volman
Nitzan Volman

Reputation: 1829

It's possible.

rather than using a like social widget (which is the common way to like a page), you should implement your own button or link, which calls a Graph API method to like the page, then in use the api callback to navigate the user to a different url.

You can use facebook javascript SDK to call a Graph API method.

in this example:

FB.api(pageId +  '/likes', 'post' ,function(response) {
    //redirect the user to a page;
});

using "post" in the second parameter will like, using "delete" in the second param will "unlike"

Upvotes: 1

Related Questions