dongleiwei2182 2010-08-19 17:32
浏览 30
已采纳

Facebook应用程序选项卡 - >与PHP的外部链接

I currently have an Application on the Facebook Tab, and am wondering if there is a way for me to deep link into an item on that app tab. Example:

User is in the application (which is searching books), finds a book they like, and wants to share it with a friend. They click to share it, and I can pull all the info, however I don't have a deep link so when it's emailed, facebooked, ect.. it sends the user directly to the page with it on it.

Is this possible on the Application Tab? I know on the canvas I could deep link fine... but looking for a way to do it on the App Tab.

Thank you for your thought and responses.

  • 写回答

4条回答 默认 最新

  • duanjue9296 2011-09-09 17:47
    关注

    Here's how we deep link to subpages within our app's Page Tab.

    When your application lives inside a Page Tab, Facebook will strip out all GET params except for app_data. It passes app_data inside the signed_request parameter of the POST data.

    More info in the docs: https://developers.facebook.com/docs/authentication/signed_request/

    So when we build links to subpages, it will look something like

    http://www.facebook.com/myfanpage?sk=app_XXXXXX&app_data=%2Fmainpage%2Fsubpage
    

    Then, in our index page code, we check for the app_data param. If it exists, then a simple 302 redirect does the trick.

    $request = parse_signed_request($_POST['signed_request']);
    if ($request['app_data'])
    {
        header('HTTP/1.1 302 Found');
        header('Location: {$request['app_data']}');
        exit;
    }
    

    Note: you can pass more than 1 param inside of app_data using a URL-encoded, JSON-array or something like that.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题