Is there any way I can pass blob directly to facebook share dialog since I dont have any url. I have an image in the form of blob data which I want to post on facebook.
window.FB.ui({
display: 'popup',
method: 'share',
action_type: 'og.likes',
action_properties: {
object : my blob data
}
}, function(response){});
Above code is not working since object only takes https url. Is there any way I can pass blob data
Related
I have a facebook app, and I am able to share links, and image for this link, on FB, using FB.ui.
The point is, depending for the FB account who is sharing the link, I can get big image, or small one.
This is a real pain, because if I configure and send big image, on the accounts which uses small one, the image is cropped, and also on the other way.
I am sending, as far as I know, all known parameters for FB, but the result is the same.
FB.ui({
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object: {
'og:title': title,
'og:description': description,
'og:url': invitationLink,
'og:image:url': imgPath,
'og:image:width': imgWidth,
'og:image:height': imgHeight,
'og:image:alt': 'refer a friend by lottoland'
}
})
});
What could be wrong here? How can I "force" facebook to always use same type of image?
Thanks anyone for the support.
I would like to enable users to share a certain feed with dynamically generated pictures. This means that the picture url is always a new one.
However, it seems that the picture Facebook is using is not that from the URL but always (an old) one from the cache.
The URL is something like http://www.domain.com/facebook/unique-picture.png
How is it possible to turn off the caching?
function shareMessage(link) {
alert(link);
FB.ui(
{
method: 'feed',
name: link,
link: 'link',
picture: link,
caption: link,
description: "description",
message: ''
});
}
We are working on updating our site to use the v2 facebook API. With v1, we did the sharing as follows:
FB.ui({
method: 'feed',
name: $('title').val(),
display: 'popup',
link: url,
picture: fbImg,
caption: 'Compute information about '+$("#i").val()+'.'})
});
We used some javascript to dynamically pick the thumbnail image and would store it in fbImg.
With v2, it appears that there is no longer a simple picture parameter. Instead it seems that we must define a static image to be used with the og:image meta tag.
We've found that a dynamic image can be used using method share_open_graph:
FB.ui({
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object: 'http://' + longUrl,
image: imageVariable
})}, function(response){});
This is v2 compliant, but the action type og.shares was just a guess, which oddly seems to work. og_shares is not documented, and a google search for it turns up nothing. This makes us very hesitant to just use that code in production..
Is there a "correct" way to dynamically pick an image for a facebook share using the v2 api?
https://developers.facebook.com/docs/javascript/reference/FB.ui
With the new update of Facebook API, I've been trying show a dialog for share in timeline, but don't only recognize me the href..
What can I do?
Code:
FB.ui({
name: 'Mejores Huecas',
link: 'www.lasmejoreshuecas.com',
from: '1469541393326876',
caption: 'Las mejores huecas!',
method: 'share',
href: 'https://apps.facebook.com/mejoreshuecas/?fb_source=search&ref=ts&fref=ts',
},
function(response) {
if (response && !response.error_code) {
//alert('Posting completed.');
}
else {
//alert('Error while posting.');
}
}
);
That´s intentional, the Share Dialog reads the data from the Open Graph Tags of the URL and it only takes the href as parameter, as you can see in the docs.
If you want to share custom data, you need to create a separate URL with separate Open Graph tags. After all you share a Link, and the message must be user generated anyway, so you don´t really need additional info - i guess that is why Facebook deprecated the old Feed Dialog.
I am following this thread Is it possible to add a link to download a file that can only be downloaded by sharing it on Facebook? to detect if user share my given link or not, If user share then allow him to access the next level.
This is how i am doing:
FB.ui({
display: 'popup',
method: 'share',
href: 'url-here',
} , function(response){
console.log(response.e2e)
if (response && response) {
$.ajax({
url: ajaxurl,
type: 'post',
data: {action: 'unlock_om_gmap'},
success: function(res) {
}
});
}
});
But everytime its returning Object { e2e="{"submit_0":1406412308276}"} not any post id. Is there anyone familiar with this issue? How do i check if user shared my link or not?
As I mentioned in the comments, as per the Facebook docs on this topic, you'll need to check for an object_id property in the response data to determine if an Open Graph story was shared, but this is only available if the user is logged into your app using Facebook and has granted publish_actions