Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
571 views
in Technique[技术] by (71.8m points)

redirect on facebook app install

Upon install of my app on a Facebook Page, I'd like to send the user to an URL with further instructions. I'm starting 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 itself. It seems like various forms of redirect were available at some point:

  • Post-authorize callback URL. I can no longer find that in App settings.
  • The next parameter for add.php. I can't seem to get this to work

I have seen some apps that do redirect upon install, so I believe this is possible. Maybe it's using an old Post-authorize setting that's no longer visible?

Any help or point would be greatly appreciated! I'm also not attached to using add.php, if there's a Facebook Connect method that does this I'd use that instead (I'm looking at profile.addtab though that doesn't seem to work either).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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

To set the "post_authorize_redirect_url" you would 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 am not completely clear on this, but I believe the url needs to point to a folder, terminated with "/" rather than a specific file.

The callback gets two parameters: installed = 1 (true) fb_page_id = the page id when your app was installed


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...