Facebook api获得实时评论 [英] facebook api get live comment

查看:160
本文介绍了Facebook api获得实时评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处获得实时评论

我喜欢他们说的话

var source = new EventSource("https://streaming-graph.facebook.com/2025853151054872/live_comments?access_token=MY TOKEN HERE&fields=from{name,id},message");
source.onmessage = function(event) {
console.log(event);
  // Do something with event.message for example
};

这将给我401错误,正如他们提到的那样

this will give me 401 error and as they mentioned here at the end of page its mean

未授权

确保您的应用具有正确的权限,并且访问令牌有效.

Make sure your app has the right permissions and that the access token is valid.

所以我在此处

及其结果

 Metadata   {"sso":"chrome_custom_tab","auth_type":"rerequest"}
 Valid  True
 Data Access Expires    1560876206 (in about 3 months)
 Origin Mobile Web Faceweb
 Scopes email, publish_video, manage_pages, pages_show_list, publish_pages, public_profile

我不知道为什么会有错误,每件事都是正确的

i don't know why there is error and every thing its right

我也使用android库测试了相同的URL 同样,它给我错误

also i test same url with android library library and same its give me error

推荐答案

我发现解决方案似乎facebook需要更多权限及其

i found the solution seems facebook need more permission and its

user_videos 权限,但他们没有提及

user_videos permission but they doesn't mentioned that

这篇关于Facebook api获得实时评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆