Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inviting Facebook friends to custom uri

I wonder if it's possible to use FB.ui to invite friends to a custom page of my web application, but not to it's index.

Apprequests method doesn't seem to have any parameters as customizable uri

  FB.ui({method: 'apprequests',
    message: 'yay!',
  });

In case if it's impossible to achieve with FB.ui, I would be glad to accept any other options. Thanks in advance.

like image 721
Kourindou Hime Avatar asked Nov 03 '22 08:11

Kourindou Hime


1 Answers

By default, the invite will always send the user to the default canvas URL for your application. What you should do is detect this URL on the Index page, and then redirect them where you actually want them to go.

The way to do this is to look for the request_ids in the URL ($_GET) and then do a API call to /$request_id to verify it. Then you can redirect the user to any page you want (either JavaScript redirect, or PHP header redirect).

like image 132
Niraj Shah Avatar answered Dec 17 '22 13:12

Niraj Shah