Is a third party website allowed to post messages on facebook, on behalf of another site? - facebook

So here's my use case:
A user sees a cool product on a shopping website (sample-shopping-site.com)
They want to share this product with their friends on facebook
They however want to pass the information to an intermediary site (a-sharing-app.com - that i'm trying to develop), that posts to facebook on my behalf.
My questions:
Is this even allowed by facebook? i.e. can a-sharing-app.com put a widget on sample-shopping-site.com, so that a person visiting sample-shopping-site.com can share on facebook via a-sharing-app.com?
If yes, could you point me to helpful bits on the facebook developers API page?
Just want to clarify: the APIs and most questions/examples on the internet point towards sharing directly from sample-shopping-site.com to facebook, by registering sample-shopping-site.com as an App with facebook.
I however want to register a-sharing-app.com as an App, and then putting a widget of a-sharing-app.com on any page (such as sample-shopping-site.com) allows me to share on facebook by passing information to a-sharing-app.com

As far as I know there is no Facebook guidelines that restrict what you want to achieve, so I may safely say that yes, you can create an app so that a person visiting sample-shopping-site.com can share on facebook via a-sharing-app.com . I can even mention a well know service that is doing the same, Disqus.
How you can implement this feature is a little up to you but may I suggest what Disqus or apps like it are doing is, they use the JavaScript API of Facebook to integrate and are mostly enabled within an iframe that loads content from their domain. The exchange of information between sample-shopping-site.com and a-sharing-app.com is done by the JavaScript loader which loads the necessary iframe then. The other things you would like to check would be Dialogs which you may use for different cases, or you may do it on your own using the FB.api and make API calls to the Graph API for sharing data.

Related

Facebook Like button for one facebook page of an app from it's own ios app

I am looking for Like Button to be shown in my ios native app, users of that app have already connected to app via facebook account.
there are several questions related to Facebook Like Button on stackoverflow but those are not specific to authorized single facebook page of the app.
According to official doc of facebook, facebook pages can not be liked via built-in action o open graph api.
But want only one official facebook page of that app to be liked by user when he hits like button. i don't want user to navigate away from the app or login again in web view to like facebook page.
is it possible to like app's facebook page without promoting user to log in again in webveiw?
Edit
Findings
1. https://stackoverflow.com/a/5837036/1632984
2. Comment by wallacer
"the general consensus does seem to be that you can't like a page on behalf of the user, however I just had an ios game like a page on my behalf. Extreme Road Trip successfully manages to get you to like their own page. I wish I'd paid more attention when I did it now..." – wallacer
This still can't be done directly using the graph api ( to the best of my knowledge ). What you can do is open a webview to the page you want the user to like. If you're rewarding their liking your app or something, when they close the webview (you'll have to provide a close button), you can use the graph api to check whether they like your app page. As far as I can tell this is the best current solution - and seems to be the approach taken by mobile games.
That said, I haven't used Facebook SDK 3 yet, so there may be something in there that could help you.
It appears that Liking a page on behalf of a user is still impossible. I've glanced over the iOS SDK Reference, and it doesn't seem like there is a built in mechanism to like anything.
However, in reading one of the other posts you linked to, and remembering that Facebook opened up the Like open graph action so app developers could allow their users to like content generated by their application...I found this link about built-in-actions (likes).
According to that link, you can post Like actions to your users by POSTing to https://graph.facebook.com/<user_id>/og.likes with the POST params for object (the open graph object URL you want to like on behalf of the user in this case your page's url. eg. www.facebook.com/yourpage) and access_token (obviously, for your user).
I'm not totally convinced that will work; though it is conceivable. My second thought would be to create an Open Graph Object for your page, and have all your users like that. Though, that is a little less ideal, as it removes the possibility of people finding your Page while they're on Facebook and would require you to put a lot more effort into getting likes for the Page via your website, application, etc.
I hope that helps a bit, good luck.

Liking a page on behalf of a user?

I'm trying to get a user to 'Like' a page via the SDK. User is signed in and I get a valid access tokken form the cookie. My APP has asked for permissions read_stream and publish_stream. I can successfully do things like post to their wall, etc. But when my APP tries to 'Like' a page, I get the error back:
OAuthException: (#3) Application does not have the capability to make this API call.
Am I missing some other permission, or is there a setting I have to turn on in my APP? I'm at a loss here.
You can't like a Page on behalf of a user (Bugzilla discussion). You can, however, like posts, comments, and photos on behalf of a user.
Edit 7/9/2012
Since bugzilla no long exists, the bug linked above is inaccessible. Google doesn't have a cached version of the page, so I ran another search. The best thing I could come up with was this Google Code Discussion regarding the ActionScript API.
Facebook makes brief mention of Publishing likes via the Graph API in the documentation, but doesn't say one way or another whether you can like a Page on behalf of a user - just "Objects" which (probably arguably) are not "objects" in Facebook-lingo.
My thought is, the API to like page is available, but is only offered to white listed applications (such as, the Facebook iOS and Android applications) written by "special" publishers. There's obvious reasons why Facebook wouldn't want/allow developers to create like connections on the graph. It would be taken advantage of by spammers and other nefarious developers and would deteriorate the meaning of what a "like" represents for a page on Facebook.
My guess is, you'd have to make a pretty strong case to Facebook about why you need/want access to the Page's Like connection (for publishing) before they'd even consider giving you access. I'd also guess that they'd want to verify that you're doing only user initiated like creations (in such a way that the iOS application would handle it) so as to protect the reptutation/meaning of a "like" action.
Actually this is NOT true, but you have to do a complicated Javascript / UIWebView process in order to display a Facebook 'page' of JUST the like button on your view, and this like button you can configure in the JavaScript / Objective-C (using string replacement) to be any Facebook page url you like.
Facebook's platform policies don't allow for a web-based like button aside from using the officially supported options
Those options doesn't require using OAuth or the Open Graph api. However, facebook just added support for mobile apps to send like actions through opengraph.
I'm not sure if they intend to allow sites to customize their like buttons or just apps...
Liking works for me with the iOS SDK using the graph api:
https://developers.facebook.com/docs/opengraph/actions/builtin/likes/

Check whether user of non-facebook app likes/shares particular URL on FB

I'd like to know if there is a possibility to check (using Graph API or any other way) whether given user likes / shares a specific link. Probably I'll have this user's facebook ID or facebook login, but my site is non-Facebook application. Actually it's Dot Net Nuke portal (target: .NET with MS SQL Server) with part of it being avaliable as Facebook app, but certainly not greater part of it, so the solution should be out of Facebook Connect, although it's not a showstopper if it's necessary.
We'll be giving points to users who share/like most of links that we serve in our portal and such possibility would be a great help to make a ranking.
Another option we consider is making some kind of "wrapper" or proxy for FB like / share buttons which will at first save some data in our database (probably - this user clicked on like for this link) and then go on with standard FB like / share route. Did anybody of You tried such solution?
If You have any other suggestion on the subject, please, post them, we'll be really thankful.
It is possible to know if a user has LIKED a site or not. You can get all user's likes with Graph API (you need user_likes permission). Take a look at the docs: http://developers.facebook.com/docs/reference/api/user/
I'm not sure if you can know if he has shared your site, but you could try by parsing his wall with the read_stream permission and then look for your site name/URL post by post.
For just general liking of items on your site, you can use a Facebook Social Plugin. However, you won't be able to associate (or really even access) user activity with users on your site without integrating Facebook Connect and creating a Facebook application for your site. At that point you can design with greater control all the possible user activity and interleave with your facebook calls other calls that affect users' accounts on your site.

Hiding application source when posting to Facebook fan page via graph API

I've successfully posted to a fan page as the actual page via the Graph API.
The problem is that the post says it was posted at "time via application name". Is there any way to hide this, so my post looks exactly as if I typed it directly into Facebook?
I'm building a messaging center that can easily deliver messages on many different channels, Facebook being one of them. Clients probably won't appreciate their Facebook posts linking to my application, nor do I want to set up a new Facebook application for each client.
There is no way to disable this. It is an internal Facebook system and is very deliberate on their part to show users where content comes from and make it easier to report malicious and spammy apps.

Can I access Facebook API's without an api_key?

Is it possible to access Facebook APIs for logging in a user, or to allow a user to become a fan of a fan page through a third party site, without actually creating an app on facebook?
Why don't you create a fab page directly for users to become fans for that page? And as far as i know, you can not access facebook API without API key.
You can't access the API without creating an application and getting an API key. There are a small number of API queries that will work without the user having added an application or even interacted with it but they generally on retrieve very basic data.
There's certainly no programmable way of making a user a fan of a page without using a fan box widget or having them do it directly through the site. This is because the post_form_id value which Facebook uses for these kinds of interactions is only present on pages served from facebook.com and is never accessible to the developer. To allow otherwise would open up the system to all kinds of exploitation.
I've no idea what problem you're trying to solve anyway. Creating an application API key is no hardship (and it doesn't have to be an active application for session-less queries - just create an app and grab the keys) and the fan box widget can be styled with CSS, as long as you follow the basic rules that Facebook has set out.