Facebook $facebook->getSignedRequest();和signed_request错误
我正在使用 getSignedRequest();和signed_request来检查访问者是否喜欢该页面。
当我转到“页面”选项卡时,它会在 iframe 中显示一个外部网站 getSignedRequest();和signed_request正确提取信息并将其显示在我的index.php页面上。但是一旦我喜欢(或不喜欢该页面)甚至执行 window.location.reload(); -或者当我离开index.php页面并再次返回时,getSignedRequest();并且signed_request不会触发。当我导航到 index.php 并手动刷新浏览器时, getSignedRequest();和signed_request火,一切都很好。
有谁知道我可能做错了什么?为什么 getSignedRequest();和signed_request只触发一次?
这是有问题的页面:
http://www.facebook.com/pages/RT/367570243261944?sk=app_327979357253049
我已经尝试过这两种方法:
$signed_request = $facebook->getSignedRequest();
也
if (isset($_REQUEST['signed_request'])) {
$encoded_sig = null;
$payload = null;
list($encoded_sig, $payload) = explode('.', $_REQUEST['signed_request'], 2);
$sig = base64_decode(strtr($encoded_sig, '-_', '+/'));
$signed_request = json_decode(base64_decode(strtr($payload, '-_', '+/'), true),true);
} else {
echo "ERROR";
}
谢谢!
I am using getSignedRequest(); and signed_request to check wether or not a visitor likes the page.
When i go to my Page Tab, that shows an external website in the iframe, getSignedRequest(); and signed_request pulls the information correctly and shows it on my index.php page. But once i like (or dislike the page) and even do a window.location.reload(); - or when i navigate away from the index.php page and back to it again, getSignedRequest(); and signed_request do not fire. When i navigate to my index.php and do a manual refresh of my browser, getSignedRequest(); and signed_request fire and everything is fine.
Does anyone know what i might be doing wrong? Why does getSignedRequest(); and signed_request only fire once?
Here's the Page in question:
http://www.facebook.com/pages/RT/367570243261944?sk=app_327979357253049
I have tried both of these methods:
$signed_request = $facebook->getSignedRequest();
and also
if (isset($_REQUEST['signed_request'])) {
$encoded_sig = null;
$payload = null;
list($encoded_sig, $payload) = explode('.', $_REQUEST['signed_request'], 2);
$sig = base64_decode(strtr($encoded_sig, '-_', '+/'));
$signed_request = json_decode(base64_decode(strtr($payload, '-_', '+/'), true),true);
} else {
echo "ERROR";
}
Thank You!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论