I used the Facebook API to post an image or a comment on the wall using an iPhone. But I am trying to post an image on someone's comment through my application. How can we programmatically post an image to someone's post as a comment?
According to the Graph API documentation you can post comments to an object's /comments connection, but the only argument it takes is "message". So, no images.
Normally if you paste a URL to an image in a post, it automatically appears as an image, but I don't think I've ever seen images in comments on posts.
You can try putting it inside <img src="pic-url-goes-here">, but I'm pretty sure that does not work in replies at least.
If it really is impossible, you should (ask to) modify your application's functionality. Uploading the image from the application and linking to it in the comment would at least "get it in there" (as a link).
Related
I write a blog but now nothing about programming.
Until some time ago, whenever I shared a new post on FB it chooses the first image of the post and that was fine (although I'd prefer to control which one to share every time). And it also got the title of the post correctly.
Now it always chooses the header picture of the blog and inserts the blog's title and description instead. Also, if I try to share the blog itself it chooses not the header picture but some old one from one given post...
FB debugger gives me this:
"og:image was not defined, could not be downloaded or was not big enough. Please define a chosen image using the og:image meta tag, and use an image that's at least 200x200px and is accessible from Facebook. Image 'http://1.bp.blogspot.com/-vVHBaAssg-E/VdiSUEICydI/AAAAAAAAApw/Tsmhu4ZefTk/s1600/dpca%2Bblog%2Bcover%2Bv3.png' will be used instead. Consult (...) for more troubleshooting tips.
To find the object, these are the redirects we had to follow"
But the pictures in the post (or the blog's header) are in fact larger than 200x200.
I've added code as suggested in FB and bloggers tutorials but still no juice...
What's wrong?
I'm using AddThis as the sharing "platform".
Example post: http://doportocomamor.blogspot.pt/2016/02/brincar-com-o-fogo.html
thanks a lot in advance
I have some problems with Facebook Graph API and want to ask some short questions.
Firstly. Is there any method to post multiple images in single wall page post using API? Any method? I want take some photos, text description and say to facebook through API: "I need your wall post with this data". After search I did not find any chance to do it.
Secondary. I can add single photo with description to page wall (edge /{pageID}/photos), but I can not edit through API (edge /{photoID}). Interesting fact - facebook answers to API photo edit call with message "success: true", but nothing happens! Image stays unchanged. Maybe anyone knows why?
Thank you for your future advices and your patience.
You can´t post multiple pictures in one API call, at least not right now.
Are you sure you looked at the right spot? Keep in mind that there will be a picture posted with a caption, but there will also be a wall post. Maybe you have only changed the photo caption and it´s not visible on the wall. Take a look at the picture directly.
That being said, according to the API reference, you should get more than just "OK", you should get the post id in the result. i´d file a bug: https://developers.facebook.com/bugs/
In my Unity IOS game, I am unsuccessfully trying to use FB.Feed to share a screenshot on the user's wall.
Facebook documentation uses FB.Api to publish the screenshot, but this method does not display a share dialog, it simply uploads the pic to Facebook.
Answers I have found so far:
Upload the picture using FB.Api, and then parse the FBResult for the picture URL, and feed that to FB.Feed Link to answer.
This method triggers an error, since it is not possible to use a Facebook URL as source for a picture.
Save the picture locally and prepend "File://" to the picture path. Link to question. This does not seem to work either, and the Facebook documentation does not seem to have any information on URL formatting.
My question:
Is this the correct (and only) way to display a share dialog when publishing a picture? Or am I looking in the wrong direction?
FB.Feed only allows you to post link to images. It doesn't upload the images to Facebook. Therefore, these images need to hosted somewhere on the net and not locally.
The best way to make it work is either upload the images to FB (with privacy property set to EVERYONE) using FB.API, and then share the link to that picture via FB.Feed. If you don't want to create duplicate stories, i.e. one from posting the picture and another from FB.Feed, make sure that you set no_story to true.
In facebook site you able to make a comment and attach image to it. Is it possible to do the same things with facebook api?
I have read this facebook for dev link and there is no answer to my question.
If you read the documentation properly, it says-
message is the only parameter in this API call. It should be a string containing the comment text.
So, using the API you can just comment a message to the object using-
POST /{object-id}/comments?
message='This is my message'
, no link/picture could be attached alongwith.
I don't know if it is a recent change in the way Facebook handles this, but if I put the complete url in the comment, Facebook detects it as an image and shows it there (along with the url).
Maybe it's not the cleanest way, but it's a way.
We're able to post to user's FB timeline/page as the page, no problem. The issue is the post that our app is posting is way smaller than post that a page/user can post to the feed manually.
We've tried to change status_type to one of mobile_status_update, created_note, added_photos, added_video, shared_story, created_group, created_event, wall_post, app_created_story, published_story, tagged_in_photo, approved_friend according to the API (https://developers.facebook.com/docs/reference/api/post/) but neither of these change how the post looks in the feed.
Has anyone been able to post content to timeline/page wall through an APP that looks as if it was posted manually - specifically size of the image?
Sample page post that was posted through our app as page owner - image is small:
Sample page post that was posted manually - large image. We'd like the one above to look like this as well when posted through the app:
status_type is set automatically. You can't set it yourself.
In the case of the manual post, you added a photo. To do that in the API, you have to query /PROFILE_ID/photos.
What you did through the API most probably is a post with a link, with the use of /PROFILE_ID/post with the link field filled. Hence, Daniel & Co shared a link.
That's why it doesn't look the same.
Some help for you to succeed at posting a photo:
How-To: Use the Graph API to Upload Photos to a user’s profile
Adding Photos to Stories
Disable grouping of photos on the timeline
Also note that you won't be able to post a photo with the link to image which is hosted on Facebook.