Topic-icon Post a photo on facebook user's timeline

Active Subscriptions:

None
11 years 9 months ago #46448 by sortby
Hello Alex,
so....I'm wondering how to implement a facebook share of an IMG on user's timeline.
This image has not url because is contained in a js variable, I can use it as it is or after php encoding in jpg....so I have two choices [ from js or php].
My app is a stand alone js-html5 canvas app and my goal is to make shareable this IMG on user's timeline.
I think it could be integrated in actual app, maybe grant some new permission etc...but I'm not sure how to implement this
If you could give me some advice or code example on that i will really appreciate it, in the meantime have a look at that [www.sanwebe.com/2012/02/post-to-facebook...wall-using-php-graph]
Which is the best way to perform this? Also considering new graph api 2 !!!
Thanks :)
Sortby
The topic has been locked.
Support Specialist
11 years 9 months ago #46502 by alzander
Sorry for the delayed response to this post.

so....I'm wondering how to implement a facebook share of an IMG on user's timeline.
This image has not url because is contained in a js variable, I can use it as it is or after php encoding in jpg....so I have two choices [ from js or php].

Facebook doesn't let you directly share an image from your website to Facebook. You need to share a URL from your site, which may be primarily be about a specific image. To share, you'd share the URL to that page of your site with the proper Open Graph tags set. Those Open Graph tags tell Facebook the title, description and image for the page, along with any other information you want to present in a user's Timeline when it's shared.

JFBConnect will automatically set the Open Graph tags for content from your site, but you can always override the tags by adding the following Easy Tag to any page:
{SCOpenGraph title=Title of image}
{SCOpenGraph description=Description for image}
{SCOpenGraph image=http://site.com/link-to-image.jpg}
Then, to add a Like button to your site, you can add the following:
{JFBCLike href=http://site.com/link-to-page-with-image}
That code can all be added to an article or any other part of your site, like a custom PHP module. If you add it somwehere you can set PHP from, you can use a tag like:
{JFBCLike href=http://site.com/<?php echo $urlLink; ?>}

If you could give me some advice or code example on that i will really appreciate it, in the meantime have a look at that [www.sanwebe.com/2012/02/post-to-facebook...wall-using-php-graph]
Which is the best way to perform this? Also considering new graph api 2 !!!

JFBConnect fully supports the new Graph API functions as well as the older Graph API calls for older apps that support them. Generally, you shouldn't need to make API calls directly, but if there's something I'm missing about what you're trying to do, just let me know.

I hope that all make sense, but if you have any questions, just let me know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 9 months ago #46635 by sortby
Hello Alex,
thank you very much for your kind and complete reply.
I will have a look with calm at the solutions you proposed.
If I'm not wrong all of them involves to save the image somewhere in my server and use the link.
But to make that I have this kind of problems:
My app is a live app (js-html5canvas+some php functions) that creates imgs at runtime so "live" without generating any url, actually from a blob js variable starts the php jpg encode function and save with browser directly on users pc. So without any link to user name, or session token or similar.
Saying that what do you think about?

Do you think is possible to perform instead of a wall posting (that require an url) an users' album posting?
Or if you have any other insight I'm open to consider new solutions

Thanks ;)
Sortby
The topic has been locked.
Support Specialist
11 years 9 months ago #46638 by alzander
Facebook wants 'persistent' data to be stored. They track all assets and things shared by the URL of that content. There, unfortunately, needs to be a URL to point Facebook too. That URL and image can be dynamically generated, but there needs to be somewhere to point Facebook too.

Even for a dynamic image that's generated 'on the fly', there should be some URL that the user can go to to see the image. Once there, you can have PHP automatically generate the image and return it. It doesn't need to be a direct link to a file on your server.. but whoever is requesting it wouldn't know how it's generated.. they would just get an image back.

Do you think is possible to perform instead of a wall posting (that require an url) an users' album posting?
Or if you have any other insight I'm open to consider new solutions

I'm not sure.. can you go through the process of what you want to accomplish? That may help me come up with some suggestions. Let me know how a user would visit your site and when, how, and where the image would be posted for them:
* Do they have to 'do' something for the image to post?
* Are they clicking the Facebook Like button, or some other action?
* Does the image go to their Timeline, Facebook Page, Album, etc?
etc.
Any steps you can tell me that you *want* to implement will help me understand what you're trying for and provide some suggestions as to what is, and isn't, possible.

Thanks,
Alex
The topic has been locked.