Need to Remove cache storage of FB.UI (Facebook share dialog box) - facebook-share

I am using Fb.UI function to share my application content on facebook. I have created a public url of my image by storing it in a database to share the content but when I am updating the image, the data in the public url is also updated but FB.ui still shares the old content image cached in it (although my public url has updated content now).
Below is my Facebook share dialog code
window.FB.ui({
method: 'share',
href : publicurl
}, function(response){});

Related

Facebook graph api - getting page public content access while in development mode

I wrote a short script for personal use only which is designed to get easier access to public content on facebook pages. The script is supposed to export the contents of public posts on a given page to an excel file.
I understand that for an app in live mode, I need to submit a request for page public content access in order to get information from pages that I don't manage. However, this script is not intended to go into live mode at all (for example, it doesn't have a user interface) as it is for my own use.
How can I get page public content access without turning the script into an app in live mode?
It does not matter if you go live or not, if you want to access Pages you do not manage, you have to apply for Page Public Content Access. Else it would be easy to just keep in unpublished and redirect user calls to your code as a proxy to the Graph API. Facebook needs to know how you want to use the content.

facebook share button is not showing the image

I am currently creating a facebook app and I need to create a facebook share button.I used facebook share button social plugin and setup the meta tags.image with meta tags
my app genarating images using app users facebook id.I am using a session to get the app id to my page.
It's working fine in image src tag.but not in og:image.
img src image
I used sharing debugger it's only reading the url untill the "http://www.koombiyocharacter.me/joined_images/joined_image" but not variable i got from session.not with the session variable
I need to share with the image.now it shares without the image.Can I find a solution for this with php sdk?.Shares like this
How Can I solve this problem.I am new to facebook app development.

Opengraph og:image unable to change URL

We have a problem when users update the og:image for an article.
The Open Graph Debugger picks up the new image, and our CMS triggers a scrape using the API endpoint documented here.
But for existing shares, Facebook renders a placeholder and doesn't update to the new og:image URL. Which means if the original image is deleted in our CMS, Facebook shows a blank placeholder:
Facebook's documentation says:
You can always edit an object's properties, with two exceptions:
Title: Once 50 actions (likes, shares and comments) have been associated with an object, you won't be able to update its title
Type: An object's type can't be changed once it's been used in a story
If you want to update an image for an object, we strongly suggest that the URL to the image be different than the original image URL. Caching may prevent the image from being updated.
Images uploaded to our CMS always have unique filenames, and are served from an Amazon S3 bucket via Cloudflare.
If we don't delete the original image from our server, in existing shares Facebook continues to use the original in spite of the og:image changing and us telling FB to re-scrape the URL.
How can we get the image to update?
Twitter and Linkedin do not have a problem as they appear to cache the original image on their servers, so once we delete the file they continue to serve the original og:image. That's fine - but Facebook needs to show an image.
Try ?v=2 at the end of og:image url.

Multiple Photo Uploads on Facebook Page Timeline

I would like to publish more than one photo on Page Timeline, but do not see any way how to manage it. I can publish only one photo on Page Timeline or album.
Is there any chance how to upload multiple photos into Page Post in help with Graph API?
Edit: As found out, not worked successfully, because there were changes. More info here...
This is an old post, and I don't know if this method could work back in 2014, but in 2017 it's working. Unfortunately there's no way to create the post in one FB query, but there's a trick.
Step 1
Batch upload the images in silent mode, which means there will be no post on the timeline, just pure upload.
For this you have to use
'published' => false,
in the parameters, and
/me/photos
as the URL.
Step 2
After each upload FB will give you back the ID of the uploaded image. Grab those into an array:
$resparr[] = $graphNode['id'];
Step 3
After the uploads you will have an array of the image IDs. Let's format them for the FB post:
$phc = 0;
foreach ($resparr as $pid) {
$linkData['attached_media['.$phc.']'] = (object)array('media_fbid'=>$pid);
$phc++;
}
Step 4
Make an other call to the API, but this time the URL should be
/me/feed
This will create a public post which contains the images.
(You need a page access token for this to post onto a page, or a user access token to post your wall.)
More info # Faceook Developers.

me/feed with pic from different domain

I was trying to find this on facebook's site in their documentation but so far no luck. I'm sure others must have run into this before.
I use Amazon S3 for storing images. I didn't know ahead of time that if I named my bucket as my domain name with subdomain I could link that way, so until I move all of the pictures I have to link to mybucket.s3.amazonaws.com domain. When I include a picture from there with a post to the wall the picture doesn't show up. If I change the picture to one on the server itself the picture does show up. It seems that the domain name of the picture must match my app? I looked at bugzilla and didn't see this mentioned. Facebook's forum says to post questions here.
I'm using the C# Facebook SDK from CodePlex.
My code looks like (with error handling and authentication check removed):
var client = new FacebookClient(FACEBOOK_APP_ID, FACEBOOK_SECRET);
client.AccessToken = facebook.AccessToken;
var parameters = new Dictionary<string, object>();
parameters.Add("name", name);
parameters.Add("caption", title);
parameters.Add("message", message);
parameters.Add("link", link);
parameters.Add("source", link);
parameters.Add("picture", imageUrl);
client.Post("me/feed", parameters);
I verified that imageUrl does indeed have a correct picture, the domain name just doesn't match. The picture on amazon s3 has public read access. I can view it from my browser so I don't think it's a permission problem. I've tried a few different pictures with the same problem. Only time it's worked so far is when the picture was on the server itself.
So, my question is, is it a problem with me, or does facebook block images that don't match the domain name specified on the app?
You can upload the picture from that url, then add its object id in the post.
Refer to: http://developers.facebook.com/blog/post/526/?ref=nf
Uploading Photos to the Graph API via a URL
Earlier this year, we released support for uploading photos directly
via the Graph API. This requires sending the photo as a MIME-encoded
form field. We are now enhancing our photo upload capability by
introducing the ability to upload photos simply by providing a URL to
the image. This simplifies photo management for a number of use cases:
App developers who host their images on Amazon S3 or a similar
service can pass the S3 URL directly to Facebook without having to
download the file to their application servers only to upload it
again to Facebook. This improves performance and reduces costs for
developers.
Apps written on platforms that don't have good support for
multipart file uploads can create new photos more easily.
To upload a photo via a URL, simply issue an HTTP POST to
ALBUM_ID/photos with the url field set to the URL of the photo you
wish to upload. You need the publish_stream permission to perform this
operation. You can also include an optional message parameter to set a
caption for the photo.
I'am facing the same issue as well. Based on my observations it seems that facebook does not like it when the picture url has more than one sub-domain.
I tried the below 2 URL variations for the same image..
mybucket.s3.amazonaws.com - throws an error
s3.amazonaws.com/mybucket - works fine
:picture => 'http://mybucket.s3.amazonaws.com/footprints/15/coverimgs/medium.jpg'
OAuthException: (#100) picture URL is not properly formatted
:picture => 'http://s3.amazonaws.com/mybucket/footprints/15/coverimgs/medium.jpg'
{"id"=>"587472956_10150280873767957"}
Now i have to figure out how to change the URL structure for the image while passing it to the FB graph API.
I would log it as a bug. If this is really the case, which I kinda doubt, you could create a 301 redirect on your own domain for each image that redirects to the Amazon url.