如何从回调URL中的Facebook图形API读取实时通知?
如何从回调URL中的Facebook图形API读取实时通知。以下是我的回调网址中的代码。但我没有收到任何通知。如何从回调URL中的Facebook图形API读取实时通知?
if (Request.HttpMethod == "GET" && Request.QueryString["hub.challenge"] != null)
{
Response.Clear();
Response.Write(Request.QueryString["hub.challenge"].ToString());
Response.End();
}
else if (Request.HttpMethod == "POST")
{
StreamReader reader = new StreamReader(Request.InputStream);
string jsonString = reader.ReadToEnd();
}
您是否按照文档https://developers.facebook.com/docs/graph-api/real-time-updates/#subscribing中描述的方式创建了订阅?
检查您现有的订阅这样的:这里所描述
GET /{app-id}/subscriptions
为:https://developers.facebook.com/docs/graph-api/reference/app/subscriptions/#read
您是否实施了一些日志记录GET和POST请求,让你知道,如果请求发生?
是的,我创建了订阅。 – user3240168
我更新了我的答案 – Tobi
嗨Tobi。我已经成功创建了一个回调URl。服务器会将通知发布到我的回调网址。但我没有收到任何通知。 – user3240168
正如下面的评论对话所证明的那样,我认为这个问题还不清楚,我建议暂时搁置。 – halfer