dsdeeaquu38538545 2012-12-01 19:56 采纳率: 100%
浏览 42
已采纳

Facebook canvas PHP SDK getLoginUrl

i am runnig a site with PHP-SDK connection to the Facebook. I can figure out, what is wrong:

  1. New user comes to the mysite url and uses a button to log in using facebook.
  2. Facebook asks for permisions. User accepts.
  3. All i sok.

But:

  1. New user comes to the Facebok Canvas application and uses a button to log in using facebook (I do not use the Javascript and donť want to.).
  2. Nothing happens, it seems that facebook calls the url (getLoginUrl) but it doesn't show the page, where user can allow the permission.

I use:

  $params = array(
              'canvas' => 1,
              'fbconnect' => 0,
              'scope' => 'user_about_me, email, publish_stream, read_stream',
              'redirect_uri' => http:/my_domain.com,
              'display' => 'page'
            );
   $loginUrl = $facebook->getLoginUrl($params);

I tried to use:

             'redirect_uri' => 'http://apps.facebook.com/app_namespace/',

But it doesn't work, either. Anybody any ideas?

Thanks a lot...

EDITED: I tried to use javascript: top.location.href = ... it works, but only if I use as redirect_uri - htttp://domain.com, so the user is no longer in facebook canvas application :( I think it is possible that I use it wrong way...

  • 写回答

1条回答 默认 最新

  • drxp993551 2012-12-01 20:26
    关注

    If you set the redirect uri to the canvas URL you can get the user's Access Token with

    $facebook->getSignedRequest();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line