I would like to post a flash item to my wall from my iPhone app.
The swf is displayed on my wall, but unfortunalty I didn't found how to pass it a custom variable, like songUrl.
Do you have an idea ?
Thanks
The only way you can pass parameters to your SWF which is embedded in a Facebook Wall post is to embed values in the parameter of your SWF.
Assuming you're using Facebook Connect to publish to the Wall, the URL to your SWF must include any custom variables you'd like to pass to it, e.g.
http://...myflashfile.swf?myvar1=foo&myvar2=bar
Now in your Actionscript code (assuming you've got a Flex project), you'll do
FlexGlobals.topLevelApplication.parameters.myvar1
to get the value of myvar1.
References:
http://www.permadi.com/tutorial/flashQueryString/ (for Flash)
http://www.permadi.com/tutorial/flashQueryString/indexAs3.html (for Actionscript/Flex)
Related
I can use Facebook Graph API to share a link successfully. The link being shared has a og:video tag pointing to the swf. The swf is embedded correctly (i.e. i can click play button) on the user's profile feed. However, the swf is not embedded (i.e. no play button) on the user's news feed.
Is this expected? I would like the swf to be embedded correctly on both the news feed and the user's profile feed.
Thanks.
FYI - Adding the og:image tag on the link being shared fixed this.
I have been reading about using Open Graph (OG) meta tags to improve the way facebook works with your website. I have read two tutorials that say to create an application and use the application ID. But I am not developing an application, all I have is a business page... Can I just the page ID?
Can anybody also point out any good, simple resources around the using OG in my website?
Thanks
The sharer.php method (which is deprecated) allows you to post without an application. The feed/post method appears to require an app_id, though it's possible that there's some way around that. On the bright side, there's nothing complex about creating an application, so, if that's what you must do, I'd say just do it :)
Here is an example of how it works *with an app using the feed/post method (you'll need to click the "Post to feed" link at the top (yes I know it doesn't look like a link!).
and Here is the same exact example only using Sharer (notice that this time it's pointing at a slightly different url (drawImageForFB2.php instead of drawImageForFB4.php).
I use a php to render the tags based on the vidId that I collect but that's neither here nor there... you could just as easily have this as a static HTML page.
The innards of the OG tag are just about identical and the app_id tag in the OG is entirely optional as it pertains to the second example).
Oh, and addthis does it using the dialog api which looks like this
https://www.facebook.com/dialog/feed?redirect_uri=http://s7.addthis.com/static/postshare/c00.html&app_id=140586622674265&link=http://support.addthis.com/customer/portal/articles/381222-optimize-facebook-sharing#.UQ8bBJM9KQk.facebook&name=Optimize%20Facebook%20Sharing&description=
There are three ways to post a swf to facebook, in the first two I can control the size of the swf, but can't figure out how to do it with the feed dialog. Is there a way to do it?
Adding og:video:width and og:video:height tags to page and either entering url in status or going to old share url, can post swf up to 398x398.
With API posting to /me/feed adding width and height parameters can post a swf up to 398x398.
Using feed dialog (https://developers.facebook.com/docs/reference/dialogs/feed/) it seems there is no way to control the size, the swf always displays 398x224.
I would really like to use the feed dialog but be able to control the size.
3) Should be possible using the same og:video:width and og:video:height tags on the link you're sharing.
When attaching an SWF to an open graph page, the correct way to control the size of the SWF is by specifying the og:video:width and og:video:height open graph tags: https://developers.facebook.com/docs/opengraphprotocol/#audiovideo
These sizes will be respected when posting this page in a status update, or when specifying it via the 'link' property when invoking the Feed Dialog or making Graph API posts to /me/feed.
Never did find a way to control the size for a swf posted via the feed dialog, so I opened bug:
https://developers.facebook.com/bugs/308822549198711
I need to post a swf on user wall and it is able to play inside the wall.
I searched the solution for few days and understand that I need to apply a facebook video embed whitelist request in order to do it. However the old request form link doesnt work (http://www.facebook.com/help/contact.php?show_form=video_embed_whitelist).
Anyone can help?
If you try writing something in the Facebook pop-up that comes up and then publish it to feed, the video would play there on the wall itself when the thumbnail is clicked.
If the feed doesn't have a message, the thumbnail becomes a direct link to the SWF itself and opens up in a new window.
You don't need to apply for any whitelist request for this. Any feed story can contain an SWF in it. Please see the Facebook JavaScript SDK for information about what elements you can post within a feed story. One parameter that you can use is the source parameter.
Taken from the documentation :
source:
The URL of a media file (e.g., a SWF or video file) attached
to this post. If both source and picture are specified, only source is
used.
so... for example - you could make a call with these parameters :
var obj = {
method: 'feed',
link: 'http://your_site.com/',
source: 'http://your_site.com/your_swf_movie.swf',
name: 'Publish SWF in feed!',
caption: 'SWF's are cool',
description: 'Here is an SWF file!.'
};
FB.ui(obj);
If your site is in the white list, the swf may play directly on the wall, otherwise it will pop up a new window to play the swf.
My site has a feed system and when user clicks on any one of those feed snippets (the object), I want the action to be publish in their Facebook news feed. So I'm really confused on how to go about it because as far as I'm aware this is how you post actions on Facebook's JavaScript SDK:
FB.api('/me/namespace:action?object=url','post')
How do you dynamically change the properties of the object? Are there parameters you can send? As far as I'm concerned, Facebook asks you to give pass a URL and it'll grab the <meta> information from that URL?
Am I supposed to perform a GET request with my own server and change the meta tags dynamically. This sounds like more work than it needs to be. For example, what if the feed includes a paragraph of text, it'll be impractical for me to post that as a get request and then urldecode the entire thing.
I'm not sure I totally understand your question, but...
You can dynamically change the tags for facebook og: properties, but you have to do it before the page loads (e.g. using PHP as opposed to javascript). After you send the post using the javascript SDK, facebook crawls the page and looks for the info in the og: meta tags.