Redirect to facebook app

After installing my application on the Facebook page, I want to send the user a URL with further instructions. I start the installation with http://facebook.com/add.php?api_key=app_api_key&page=page_id , which installs, but redirects the user to the Facebook page. It seems that at some point various forms of redirection are available:

  • After authorizing the callback url. I can no longer find this in the application settings.
  • The next parameter is for add.php. I can't get this to work.

I saw some applications that redirect during installation, so I believe this is possible. Maybe he is using the old Post-Authorize setting, which is no longer visible?

Any help or point would be greatly appreciated! I am also not tied to using add.php, if there is a Facebook Connect method that does this, I would use it instead (I look at profile.addtab, although this does not seem to work).

+3
source share
2 answers

You can set the redirect URL in the application properties. You can no longer install it from the developer’s control panel on Facebook, but you can still install it using the REST api.

The list of application properties is here: http://developers.facebook.com/docs/appproperties/

To set "post_authorize_redirect_url", you should use something like this:

https://api.facebook.com/method/admin.setAppProperties? access_token=CURRENTTOKEN& properties={'post_authorize_redirect_url':'http://mydomain.com/post_authorize_folder/'} 

I do not quite understand this, but I believe that the URL should point to a folder ending with a "/" character, and not a specific file.

The callback receives two parameters: set = 1 (true) fb_page_id = page id when your application is installed

+2
source

The first page that Canvas points to should have <script type = 'text / javascript'> top.location.href = 'REDIRECT-URL'; </script>
So when your application is open, it automatically redirects the REDIRECT URL

I'm not sure if you can avoid opening the application’s canvas page after installing the application.

+1
source

Source: https://habr.com/ru/post/1333637/


All Articles