javascript Facebook 活动提要未列出活动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8551433/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 03:47:07  来源:igfitidea点击:

Facebook Activity Feed not listing activity

javascriptfacebookandroid-activityfacebook-social-plugins

提问by Dave Cameron

Any April Wine fans out there???? I am the webmaster for their website and I am desperately trying to find a solution to this problem.

有四月葡萄酒迷吗????我是他们网站的网站管理员,我正在拼命寻找解决此问题的方法。

I want to ADD the Facebook Social plugin "Activity Feed" to the band's website.

我想将 Facebook 社交插件“Activity Feed”添加到乐队的网站。

I used the code generator (https://developers.facebook.com/docs/reference/plugins/activity/) for the social pluggin, and embedded the code into my website's source code.

我使用代码生成器 (https://developers.facebook.com/docs/reference/plugins/activity/) 作为社交插件,并将代码嵌入到我网站的源代码中。

Here is the code I place in the BODY section of my HTML code:

这是我放在 HTML 代码的 BODY 部分中的代码:

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

I then paste this code into the desired area on my website:

然后我将此代码粘贴到我网站上所需的区域:

<div class="fb-activity" data-site="www.facebook.com/groups/2379953649/" data-width="587" data-height="350" data-header="true" data-colorscheme="dark" data-border-color="orange" data-recommendations="false"></div>

The activity box does appear on my page, but it will not list the activity of my Facebook Group.

活动框确实出现在我的页面上,但它不会列出我的 Facebook 群组的活动。

All it reads is:

它的全部内容是:

"No recent activity to display. Put some Like buttons on your website to engage your users. Details can be found here."

“没有最近的活动可显示。在您的网站上放置一些喜欢按钮以吸引您的用户。可以在此处找到详细信息。”

There is activity on my facebook group, so I am completely stumped as to why it will not pick up on this activity and list it in the Activity Feed box that I embedded.

我的 facebook 群组上有活动,所以我完全不明白为什么它不会接受此活动并将其列在我嵌入的“活动源”框中。

Any HELP would be GREATLY appreciated. I have tried to read up on this, but cannot find any documentation that will help me.

任何帮助将不胜感激。我试图阅读此内容,但找不到任何可以帮助我的文档。

Dave

戴夫

回答by Peachy

Not sure if you are still struggling with this issue or not - but perhaps this will help... I think perhaps the activity feed isn't exactly what you think it is. It seems that it isn't a feed of all the activity on the band's facebook page, rather, it is all the facebook activity generated from the domain. So, if you don't have a way for users to interact with facebook from your site than it won't generate any data.

不确定您是否仍在为这个问题苦苦挣扎 - 但这也许会有所帮助...我认为活动源可能与您认为的不一样。似乎它不是乐队 facebook 页面上所有活动的提要,而是从域中生成的所有 facebook 活动。因此,如果您没有办法让用户从您的网站与 Facebook 进行交互,那么它就不会生成任何数据。

EDIT

编辑

Perhaps the facebook like box would work better:

也许像 facebook 这样的盒子会更好用:

http://developers.facebook.com/docs/reference/plugins/like-box/

http://developers.facebook.com/docs/reference/plugins/like-box/

回答by Jorge Omar Vázquez

I'm having the same issue as you. I'm using the iframe version of the activity plugin , and it seems that I'm obtaining the same response.

我和你有同样的问题。我正在使用活动插件的 iframe 版本,似乎我获得了相同的响应。

My research pointed me to the facebook fan page permissions, may you please check the permissions of the fan page (or group page).

我的研究指出了facebook粉丝页面的权限,请您检查粉丝页面(或群组页面)的权限。

Here's the link that I found.

这是我找到的链接。

Facebook Social Plugin Not Working

Facebook 社交插件不起作用

If that is not the case, the other work around that I'm working, is to create a very simple facebook web application, and using the new javascript api, I will just pull the posts from the graph. The downside of this, is that the user will need to log in, though, I don't know if there's an easy way out to work with the graph without login, since it beats the purpose of using the plugin that doesn't needs the log in.

如果情况并非如此,我正在处理的另一项工作是创建一个非常简单的 Facebook 网络应用程序,并使用新的 javascript api,我将只从图表中提取帖子。这样做的缺点是用户需要登录,但我不知道是否有一种简单的方法可以在不登录的情况下使用图形,因为它超出了使用不需要的插件的目的登录。

    <html>
  <head>
    <title>Activity Feed Test</title>
    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
  </head>
  <body>
    <div id="fb-root"></div>
    <script type="text/javascript">
      FB.init({
        appId: here-you-put-your-app-id,
        status: true,
        cookie: true,
        oauth: true
      });
      FB.login(function(response){
      FB.api('/your-fan-page-facebook-entity-here/posts', {limit: 20}, function(response) {
          console.log(response);
      });
      });
    </script>
  </body>
</html>

Hope that it helps. (In the console log, you will find the response from the activity, I just need the posts )

希望它有帮助。(在控制台日志中,您会找到活动的响应,我只需要帖子)

回答by Relaxing In Cyprus

I've noticed with the activity box that if you are using a Facebook ID with admin privileges for the site, which is quite likely, then it won't display anything. The first thing to try is just set up the Activity widgit, then view it using a non-admin FB profile.

我在活动框中注意到,如果您使用具有站点管理员权限的 Facebook ID(很可能),则它不会显示任何内容。首先要尝试设置活动widgit,然后使用非管理员FB 配置文件查看它。

回答by Mohit Kumar

Its like, I have also observed such cases... but I think the activity feed will only work properly if there is ample traffic that shares and likes your articles.

就像,我也观察到了这样的情况……但我认为只有当有足够的流量分享和喜欢你的文章时,活动源才能正常工作。

回答by Hook Hogan

I'm having similar problems, although I'm trying to get it to display any activity not just a specific page's activity. Anyways, one thing that I have discovered is that for the 'data-site' tag you need to use a domain (ex. www.facebook.com), using 'www.facebook.com/groups/2379953649/' doesn't seem to work because it is giving more info than just the domain, subdomains (ex. graph.facebook.com) will also work, but the domain needs to have facebook activity, ie. a link has been shared from that site on facebook, etc.

我遇到了类似的问题,尽管我试图让它显示任何活动,而不仅仅是特定页面的活动。无论如何,我发现的一件事是,对于“数据站点”标签,您需要使用域(例如 www.facebook.com),而使用“www.facebook.com/groups/2379953649/”则不需要似乎可以工作,因为它提供的信息不仅仅是域,子域(例如 graph.facebook.com)也可以工作,但域需要有 facebook 活动,即。已在 facebook 等网站上分享了该网站的链接。

Sorry for the wordy answer, hope it helps, and if anyone notices that anything I have stated is incorrect please correct me.

抱歉回答太冗长,希望对您有所帮助,如果有人注意到我所说的任何内容不正确,请纠正我。