Screenshot not share in facebook titanium - facebook

var media;
Titanium.Media.takeScreenshot(function(e) {
media=e.media;
}
);
var data = {
link: "https://developer.mozilla.org/en/JavaScript",
name: "Best online Javascript reference",
message: " Javascript reference",
caption: "Timbodi",
picture: media,
description: "This section of the site is dedicated to JavaScript-the-language, the parts that are not specific to web pages or other host environments...",
test: [ {foo:'Encoding test', bar:'Durp durp'}, 'test' ]
};
facebook.requestWithGraphPath('me/feed', data, 'POST', showRequestResult);
share the screen shot image, but the image show in facebook is different.
please help i am new in titanium.

Related

facebook ui feed picture taken from facebook not working

if i give picture:any other hosted image(eg:"http://fbrell.com/f8.jpg") that will work fine.. but the following picture not working.. please help
$FB.ui(
{
method : 'feed',
name: head,
caption: '',
description: desc,
picture:'https://m.ak.fbcdn.net/profile.ak/hprofile-ak-prn1/t1/c28.28.355.355/s200x200/945291_160323350810130_2132651521_n.jpg' ,
link: site link,
to: userid
},
function (response) {
}
);
As far as I know this works only with images hosted outside of FB.

How to share individual product image in facebook

I'm having product listing page . I would like to show share link for each product and i want to share individual product image . How can i do this ?
I believe meta doesn't help, because i need to share individual product image.
Create your own button for each image, an onclick invoke FB.UI from the JS SDK https://developers.facebook.com/docs/reference/javascript/FB.ui/ passing in the variables you want for the message
So for each image the html could like similar to:
<img src="path-to-image" title="title" data-uri="path-to-full-product" />
Then using a library like jquery you could have the following script
$('img').click(function(){
var $this = $(this);
var obj = {
method: 'feed',
link: $this.data('uri'),
picture: $this.attr('src'),
name: $this.attr('title'),
caption: 'Your caption here',
description: 'Your description here.'
};
function callback(response) {
alert( "Post ID: " + response['post_id']);
}
FB.ui(obj,callback);
});
More info with an example is here:
https://developers.facebook.com/docs/reference/dialogs/feed/
and you can play around with the JS-SDK here
https://developers.facebook.com/tools/console/

action links text in facebook post to wall dialog using javascript not working

I trying to bulid a facebook application using javascript.In my application, the user gets the result and a dialog after a time delay popup. Everthing is working well except one here's my code for the 'post to wall dialog'
<script>
var publish = {
method: 'stream.publish',
display: 'popup', // force popup mode
attachment: {
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
actions: [{ name: 'action_links text!', link: 'http://www.example.com' }],
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'
),
href: 'http://www.example.com/'
}
};
FB.ui(publish, Log.info.bind('stream.publish callback'));
</script>
The line containing actions not working for me.Can anyone just inform what is the solution for this...
The property should be called action_links not actions and only have text and href values. Use something like:
action_links: [{ text: 'action link test', href: 'http://example.com'}]
Note that the action must be defined through the fb web interface for the app!

Use of FB.ui with method permissions.request opens popup

I am working on a Facebook IFrame app and using FB.ui to display the permissions request dialog using the JS SDK.
Here is the code I`m using:
FB.ui(
{
method: 'stream.publish',
message: '',
attachment: {
name: 'תחרות התחפושות הגדולה של לגדול',
caption: '',
media: [{ 'type': 'image', 'src': 'http://www.p-art.co.il/ligdol_purim/logo.gif', 'href': 'http://apps.facebook.com/ligdolpurim/', 'width': '101', 'height': '84'}],
description: ('פורים 2011'),
href: 'http://apps.facebook.com/ligdolpurim/'
},
action_links: [
{ text: 'Ligdol Purim', href: 'http://apps.facebook.com/ligdolpurim/' }
],
user_prompt_message: 'פרסם את השתתפותך בתחרות'
},
function(response) {
alert(response.post_id);
});
}
A happy surprise is that the SDK knows to show the dialog only for the missing permissions (if any). The problem is that a new IE window pops up and then disappears before the dialog is shown inside an iframe.
I have tried several variations on this code I found all over the net and all of them give me this popup before showing the dialog.
I had not considered that in order to open a facebook lightbox, you actualy need to be on facebook. I was testing my IFrame outside facebook. When I began testing the app inside a page tab, I got the lightbox. Ya learn something new everyday.

facebook stream.publish

I'm making a facebook app and using stream.publish to share something on a wall.
However for the 1) attachemnt link, and the 2) the FB UI action link, when I click either, it will load the page in the same browser window.
I would like to somehow add into these links something like target="_blank" so it opens the link in a new tab.
I know this is possible because when I share a video on youtube it has a target="_blank" on the action link and on the share link.
Does anyone know the trick?
I've tried code like this (I inserted the target blanks) but it doesn't add a target element in the hyperlinks:
FB.ui(
{
method: 'stream.publish',
message: 'Check out this great app! http://apps.facebook.com/{your_app}',
attachment:
{
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'),
'media': [{
'type': 'image',
'target': '_blank',
'src': 'http://test3.com/test.png',
'href': 'http://test3.com'}],
href: 'http://test2.com',
target: '_blank'
},
action_links: [
{ text: 'Code', href: 'http://github.com/facebook/connect-js' }
],
user_message_prompt: 'Share your thoughts about Connect',
target: '_blank'
}
);
Does anyone have any idea how youtube can accomplish the targets
I believe what you are looking for is
display: 'popup', after method: 'stream.publish'
target is in reference to a fb user_id to post a wall-to-wall