Timeline Action Layout - No Attachment displayed

为君一笑 提交于 2019-12-22 04:46:06

问题


I am trying to post a Action to the Facebook Timeline using the JS API

FB.api('/me/application:action_type' + '?opject_type='+document.location.href,'post',
      function(response) {
          if (!response || response.error) {
              alert("error");
          } else {
              alert("success");
          }
      });

Posting works quite well and the API returns no error. A new activity appears at the Timeline but only as a small text within the "recent activities" box which looks like this:

What could be the problem if the action is not displayed like in the Attachment Preview of the Action Type Settings? Which look like this:

I have linked all the properties from the Object Type and tested my Object URL with the Facebook Debugging Tool and it looks like all the attributes can be parsed correctly by the Facebook scraper.

I also defined a aggregation layout for the action type. So what can be the reason that no Attachment is displayed?


回答1:


You can see a single action attachment layout on your timeline by setting "Shown on timeline" instead of "Allowed on timeline", but by default you will never see a single action on the timeline. You will see the single action attachment in the ticker (and maybe in the news stream). If the user doesn't change the display mode You will only see aggregations on a timeline




回答2:


I also reported this issue as a bug to facebook. Their reply was that this behavior is by design and the attachment layout only appears in the activity log or when multiple activities have been posted to a users timeline.




回答3:


Have you set the object parameters on your web page? For instance:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# app: http://ogp.me/ns/fb/app#">

<meta property="fb:app_id" content="123" />
<meta property="og:type" content="app:action" />
<meta property="og:url" content="http://www.example.com/" />
<meta property="og:url" content="http://www.example.com/" />
<meta property="og:title" content="Testing Title" />
<meta property="og:description" content="testing Description" />
<meta property="og:image" content="http.example.com/image.jpg" />

You will need to get the correct code off the Facebook Developers website but it is essential that you create your object in order for Facebook to get the parameters from your webpage.

You can test it by simply going into aggregations->preview->add-action, and in event, just paste the webpage. You will see instantly if it works.



来源:https://stackoverflow.com/questions/8823118/timeline-action-layout-no-attachment-displayed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!