图形 API 和实时更新
我的需要是每当“允许/安装”我的应用程序的用户更改某些内容(例如他们的签到)时,让 facebook 使用 POST 请求轮询我的服务器。
我已关注 http://developers.facebook.com/docs/api/realtime< 的页面/a> 非常彻底并已成功设置订阅。
当我向订阅图发出获取请求时,我得到以下响应。
{
"data": [
{
"object": "user",
"callback_url": "http://www.HIDDEN.com/FORSECURITY/callback.php",
"fields": [
"checkins",
"feed"
],
"active": true
}
]
}
这告诉我订阅已设置,并且当用户验证了我的应用程序并更改其提要/签入时,应将 POST 请求发送到 callback_url
。
问题是,事实并非如此。我已经谷歌搜索,解决了问题,又谷歌搜索了一些,重新做了所有的事情,但我似乎找不到答案。
我通过发布到它来测试我的callback.php 文件,它捕获了所有数据,我只是捕获了 $_POST 中的所有内容,以确保是否有任何东西我会捕获它。
我还添加了 if 语句,以便在访问文件时仅写入文件以及 !empty($_POST)
。
我试着签到,把所有东西都贴在墙上。它只是不轮询回调 PHP。
有人对此有什么想法吗?
更新
看起来 60 分钟后,它开始工作了。因此,所有内容可能需要一段时间才能激活。
My need is to have facebook poll my server using POST requests whenever a user that has "allowed / installed" my application changes something, e.g., their checkins.
I have followed the page at http://developers.facebook.com/docs/api/realtime very thoroughly and have successfully set up the subscription.
When I place a get request the subscriptions graph I get the below response.
{
"data": [
{
"object": "user",
"callback_url": "http://www.HIDDEN.com/FORSECURITY/callback.php",
"fields": [
"checkins",
"feed"
],
"active": true
}
]
}
Which tells me that the subscription is set up, and that when a user that has authenticated my app, changes their feed / checkins, that a POST request should be sent to the callback_url
.
The problem is, it does not. I have Googled, troubleshooted, Googled some more, redid everything and I just can't seem to find the answer.
I have tested my callback.php file by posting to it, and it captured all the data, I just capture everything in $_POST
to make sure if there is anything that I will capture it.
I've also added if statements to just write to a file if the file is accessed and !empty($_POST)
.
I tried checking in, making wall posts everything. It just does not poll the callback PHP.
Does anyone have an Idea about this?
UPDATE
It seems like after 60 minutes, it started working. So it probably takes a while for everything to get activated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论