dounielong7728 2012-01-18 23:40
浏览 56
已采纳

使用静态HTML应用程序获取getSignedRequest()?

I have an app called static HTML (https://apps.facebook.com/static_html_plus/?ref=ts) installed on a page of mine..

I want to be able to access getSignedRequest() to pass data through the URL in facebook using app_data.. (I want to be able to pass an item id to activate a JS item in the iframe.. in essence allowing me to link to an expanded JS feature in the page)

The issue is that i am recieving NULL from getSignedRequest(); I am not sure if the app I am using (mentioned above : static HTML) is stopping the information from getting passed through to my iframe. If you are unfamiliar with this app, it allows you to put HTML/CSS/JS to embed an iframe.

On the hunch that it is the app that is stopping the propagation of the facebook data to my iframe, I have attempted to follow SEVERAL tutorials, both video and written that try to create a facebook iframe by creating a custom app.. none have worked, and i have not been successful in even adding a BASIC TAB to any of my pages..

I am about to give up on this facebook thing as every tutorial I have found has a completely different looking interface or set of instructions then what is ACTUALLY available on the facebook developers page..

Does anyone have a CLEAR UP-TO-DATE, non-facebook written walk-through, or atleast know if my use of the static HTML app is what is causing me to recieve null in my getSignedRequest()?

Here is my php code in the iframe i embed in the static HTML app, incase you think the error is in there somewhere.

require 'facebook.php';

//facebook signed app_data
$app_id = "xxxxxx";
$app_secret = "xxxxxxxxxxx";
$facebook = new Facebook(array(
    'appId' => $app_id,
    'secret' => $app_secret,
    'cookie' => true
));

// Get contents of signed request

$signed_request = $facebook->getSignedRequest();

Any help would be nice. I have wasted 2 nights on this crap.

  • 写回答

1条回答 默认 最新

  • doq1969 2012-01-18 23:58
    关注

    .html files cannot accept HTTP POSTs unless the web-server is configured to accept this verb. However, the only way to get at the post parameters is with server-side code and cannot be done clientside.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥15 键盘指令混乱情况下的启动盘系统重装