Talk:Attachment (Streams)

From Facebook Developer Wiki

Jump to: navigation, search

Contents

[edit] What is actually optional?

Which fields are actually optional? Attachments don't seem to show up unless 'name' is present, even if it's empty.

That sounds like a bug. Could you file one please? Thanks, Pete -- 563683308 17:24, 9 November 2009 (PST)

[edit] Open link in a new window (target="_blank")

It looks like there is no way to make a <a> tag link open in a new window using Facebook.streamPublish()

For example, it'd be great to have this as an option in the parameters.

var attachment = {'media':[{'type':'image','src':'www.example.com','href':'www.example.com', target}]};

Correct, there isn't a way to do this. You can submit a feature request if you'd like. Thanks, Pete -- 563683308 11:30, 16 October 2009 (PDT)

PROSCRATINATION RUNNING CIRCLES IN MY HEAD

Any news on this? I have links that doesnt work if you simply click on them, you have to right click/open in new window. I know this but a common user will propably think that the app doesnt work or the link is to a virus or something...

[edit] Video attachments

I'm trying to attach a video to a stream but when I click on the preview image it is replaced by an expanded area without the video. I'm using this setup in the developer feed tool:

{"video":{ "video_src":"http://games.bigfishgames.com/en_kitten-sanctuary/en_kitten-sanctuary.flv", "preview_img":"http://games.bigfishgames.com/en_kitten-sanctuary/kitten-sanctuary_subfeature.jpg", "video_type":"video/x-flv", "video_title":"Video test"}}

(User:561111979)

Simone, are you using the Feed Template Console -- http://developers.facebook.com/tools.php?feed -- here? For the streams, you no longer need to create templates, so you don't need to use the console right now. You format the attachment and pass it in stream.publish (there's a code sample that includes a video -- hopefully that will help you). Remember that right now, the only users to whose streams you can publish are users that are listed as developers of your application. Let me know if this works. Thanks, Pete (563683308 10:05, 3 May 2009 (PDT))

[edit] href on images

It says that the href property on an image media attachment is optional, but it isn't. I get an error along the lines of "href invalid for image" if I omit the href property, or set it to "".

This is a known issue that we're working on fixing. Thanks for reporting it! Pete (563683308 14:15, 29 April 2009 (PDT))

[edit] Image url appears to be length limited

Experiments show the API starts failing at around 256 characters. Please confirm as this has been a major (undocumented) headache for us.

This sounds like a bug; the limit shouldn't be that small. Please file a bug and provide URLs to images that both work and don't. Thanks, Pete (563683308 15:27, 20 May 2009 (PDT))


[edit] Flash media attachment seems to be ignored

Using the facebooker gem my flash media attachments doesnt seem to be recognized as flash attachment, instead its just saved as "own key/value pairs". Have a look at [1] - thanks johannes 20090603

[edit] Adding links with alternate text to the "name"

Under the old API, using Feed Templates, it was possible to put links into the equivalent of the "name" field with alternate link text (like, actual HTML links). Attachments seem to operate differently: you can have an HREF for the entire "name", and you can include bare URLs which get auto-linkified (although the first such URL cuts off the rest of the "name" from using the default link href). Is the functionality from Feed Templates gone for good? Under the new API is there no way to have A-type links in a published story's "name"?

At this time, this is how attachments work. You can still use templates and feed.publishUserAction at this time. Pete (563683308 17:27, 11 June 2009 (PDT))

[edit] Max length for attachment fields

What are the maximum lengths for the various attachment fields, specifically name, caption and description?

I'll give some guidelines in the main article. Pete (563683308 16:24, 3 August 2009 (PDT))

[edit] Attachment type "link"

When attempting to render attachments in a wallpost viewer I wrote for my application, I came across attachments of the type "link" that appeared to be "photo" or "image" attachments. This seemed a bit odd to me, so I figured I'd point it out. Can we safely assume that all "link" type media elements in attachments are photos? These media attachments do appear to have src and href elements, like an image type should, they just don't appear to be labeled right.

For the record, I got these types when viewing the "attachment" array returned by querying the stream table with FQL. --1641273433 12:34, 15 July 2009 (PDT)

I'm trying to attach an .avi file to a published stream on facebook walls, but every time I click on the play button, an empty expanded area appears and nothing happen. I tried with a flv file and it's working, so is it possible to read directly avi files ?

Are you specifying the correct MIME type? The video type defaults to "application/x-shockwave-flash". Pete (563683308 11:41, 3 August 2009 (PDT))

[edit] Examples needed

Can someone add some more basic examples to the main article? Specifically, I am trying to figure out if I can use any of the fields to generate a line of text that contains links (that are shown NOT as a url) and if I can design the post in a way that there is an image that takes the entire width on top, and all the text is underneath it like I have seen in other apps.

[edit] Examples for text attachments

Any example for text attachments ?


[edit] FlashVars

Including a 'flashvars' field in the media array happens to work fine - ie, the resulting flash element gets a flashvars param element inside it - but this isn't documented. Anyone know if this was an intentional omission?

- could you be a little more specific about how you implemented this? did you just use a url encoded string (foo=bar&bim=bap) or as a hash? 500195373 17:03, 2 November 2009 (PST)

[edit] video Media Type: video_link & video_title

When using the Video Media Type, the "video_link" parameter does not appear to work.

In the example provided, the video link is suppose to take you to: http://icanhascheezburger.com, but when you click on the video, it just takes you to the you tube page.

Also the "video_title" parameter does not do anything, the example has "kitty" set as the title, but this does not show up on the wall, when you post using the sample code.

[edit] Image Sizes

The image sizes are all over the map in terms of what you can use and what will happen with them...

Attachment Image Playground

[edit] using video attachment type for an flv video.

I second the post at the top on trying to use video attachment type with an FLV video.

What happens is the preview frame with the play button is displayed correctly, but when clicked, the playing area explands, and the adobe plugin loads, but there's no video, the area is just white.

I wonder if the domain where the video comes from needs to be whitelisted with facebook? If so, it would be nice to add that information to the wiki.

Hmm, this sounds like a bug. Could you file one, please, so we can track? Thanks, Pete -- 563683308 13:45, 12 October 2009 (PDT)
Ok, filed it as http://bugs.developers.facebook.com/show_bug.cgi?id=7108

[edit] Image Sizes

The image sizes are all over the map in terms of what you can use and what will happen with them...

So I built a utility to let you make any layout you want and see it in action:

Attachment Image Playground

[edit] Using FBML in description like in feed-templates

It would be absolutely wonderful if we could use some fbml and html in the description. :-) Eg.: it's not possible to render friend names as links or set some text bold...

[edit] Non-english characters

When I try to publish texts that contain german characters (äüö and ß) they are simply left out. HTML entitities don't work either. Can it be done?

  • The same with italian è, é, ì, ò, à and ù, html entities in place of real letters are useless anyway.--565413697 06:06, 16 October 2009 (PDT)
Please file a bug so we can fix this. Thanks! Pete -- 563683308 11:30, 16 October 2009 (PDT)

[edit] Internazionalization

There's a way to make attachment text value (description, name, caption etc etc) ready for translation??? A sort of fb:intl. If there's away who can post an example?

[edit] video_width & wideo_height

On share partner document, there are two parameters video_width & wideo_height. Those parameters should be included in Publisher and Attachment Stream API, too.

[edit] {*actor*} token in caption not working when used in posting to other user's wall

Function used: Facebook.streamPublish (FBJS)

When the function is used with target_id=null, the (*actor*} token works well in caption. (Which means a linked name appears in the post)

However when target_id is set, the (*actor*} token in caption turns out appearing as a string like this: <a href="http://abc.abc.com">Some Name</a>

(Which means showing the actual html codes instead of a linked name)


Is it a bug or what?

Sounds like a bug. Please file one so we can investigate. Thanks, Pete -- 563683308 14:26, 24 October 2009 (PDT)
Bug reported here: Bug 7266 Please vote it up! --Konr Ness 12:04, 27 October 2009 (PDT)

[edit] Missing play button on preview image of flash-type attachment

There is a play button on preview image of video attachment. But on flash attachment, this button is missing. My users don't know they can click on the preview image to play the flash content. Currently, we have to draw a button on the static preview image. But it's expensive to draw (by code) on the image upload by user. It'd better if we have a way to display the play button overlay on preview image (like video attachment).

Hi, This sounds like a bug. Please file one so we can investigate. Thanks, Pete -- 563683308 11:46, 26 October 2009 (PDT)

[edit] Is it possible to use a pid to reference an image?

In my app, I upload photos to the user's photo album and therefore also would like to use this to include in the attachment.

What is the 'properties' array actually intended for? An example would be great. Is it used to insert individual links into your post (e.g. around specific words)?

It further contextualizes your post. See the second example in stream.publish for ideas. Pete -- 563683308 09:50, 30 October 2009 (PDT)
Pete, can you answer the first question about using the pid to reference an image? When I use a pid the publish succeeds but no images are visible in the post as it appears on facebook.com. Thanks - Richard -- 549683637 15:52, 19 November 2009 (PST)
To answer my own question, stream_publish supports Facebook image urls & doesn't require the pid - unlike FBML. -- 549683637 16:37, 19 November 2009 (PST)

[edit] Line breaks in descriptions?

I'm having trouble getting line breaks in description text. \n, break tags, no luck so far. Is it possible to add line breaks in the text? 584291795 07:12, 11 November 2009 (PST)

It's not possible at this time. The field is plain text only. Pete -- 563683308 08:34, 11 November 2009 (PST)
reference