Like callback on create/load - callback

Is there a way to get the like status when the like button is created? I have the FB.Event.subscribe('edge.create'... but that only fires when a user clicks the like button. I want to know if they have already liked the site when they come to it. I can't create an app and require permissions just to get the like status. I need to just be able to get it with the Javascript API. Is this possible? Is there another way to tell if a user has liked the website when the like button loads? It should be noted that this implementation is on a website without PHP and not within Facebook.

Related

Detect 'Like' in Facebook Social Plugin

I have a webpage with a Facebook Like button (social plugin).
I need to show extra information on my page when the user has liked the page.
I know there has been similar questions but the answer has been to use the edge.create event to react to the user clicking the like button. This works fine except when the like happened prior to loading the page.
Others have suggested using a signed_request but I believe this is only applicable to canvas applications,
I know I can use the API to check for the like but this requires the user to grant permissions, but I want to do this in an anonymous manner (I am not interested in knowing who the user is, I just want to know if they liked the page).
Is there any way to do it?
Well this is exactly the difference between having a canvas app and a site that just uses the plugins. The plugin allows (you to allow) the user to like a certain URL and that's about all. In order for the site operating outside of Facebook at explicitly access that data, it'll need the correct permissions as you have noted... the user_likes permission.
Without a signed_request or the relevant permissions from the user, I do not believe that you'll be able to differentiate between users that have "liked" your URL.
Use a javascript onclick to detect when the like button is clicked and localStorage to store the info?

Tracking user activities on facebook

I've created a Facebook page and implemented an application for it too. Now, my aim is that, a user must like and share page with at least one friend to be able to participate/to get access to the app and consequently use it (play the game). Or simply force a user to like and share the page. Can you please tell me if this is even possible and how it can be achieved?
When user visits your Facebook page, you receive signed_request , which contains some information about the user, including whether or not the user liked your page. For share, you will probably need to implement send dialog. In documentation it is said that user takes action (send or cancel) he will be redirected to url you set up, and if the action was "cancel", there will be an error.
So you will probably need to create db where you store user id and whether or not he shared your page before (since you can check if he liked the page at any time).

Facebook web app... can I change something on my own website in response to a user "liking" my app?

I want a sorta basic answer on this one, just a little guidance but nothing fancy... I just want to know what direction to go in to make it so I update a specific users account (on my personal database) in response to the user clicking the facebook "like" button on my site.
So.. if someone was registered on my site, but not yet clicked FACEBOOK LIKE through my site, when they clicked it can I edit my database, specifically the entry of the user who clicked like?
Hope that makes sense?
Thanks
About as close as you can get is if you call the method for /USER_ID/likes/PAGE_ID the facebook API will return either an empty array, or some data on the page. An empty array means they have not liked it.
That will tell you if they like your facebook page, not necessarily your URL.
Here is a SO answer with some javascript/css black magic for if you really need to know if a user likes a particular URL or not.
Facebook how to check if user has liked page and show content?

Facebook page apps - Authorizing a user

I can't seem to find exactly what I'm looking for. We're trying to build an app to run solely on a Facebook Page. We want to show a landing page if they don't Like the page, and the contest entry form if they do. This functionality works.
Before showing the contest entry form, we'd like to authenticate the user viewing the app so that they can just hit "Enter the contest!" and we can automatically pull a name/email address.
Any of the methods of authentication I've seen described, including through the Facebook Developer docs, don't work at all.
I saw something that said they need to interact with the app first, then you can get the id, but that doesn't work either. I also don't get the page id passed with the signed request.
Its also pretty unclear whether I should be using an iframe or just FBML.
Could anyone point me in the right direction, please? Thanks!
You need to create a fan page and add the FBML plugin to that page, then you will need to insert a short code that will determine if a facebook user has clicked 'Like' or not and by determining that you will decide weather to display the content of the landing page or not (using an iframe). You will probably like to also set the FBML box that you create as the default view for members who didn't press the 'Like' button yet, you can change the default view in your fan page settings.
On the iframe, you will need to use the Facebook API if you want to retrieve any user information from Facebook, for that, you will need to register a new application with Facebook. Go to developers.facebook.com for the API integration and app registration.
Also, what do you mean when you say:
Any of the methods of authentication
I've seen described, including through
the Facebook Developer docs, don't
work at all.
Well, it appears you can't do it that way. The client was very specific in wanting that functionality but we ended up convincing them to go for a redirect to the canvas page to have the app authorized and the contest entered instead.

Facebook API: create event using Facebook's form

I've done my searching for the answer to this but it remains unclear. This could be a simple "possible" or "not possible" answer.
I have a site I'm creating that uses Facebook Connect (may or may not be relevant). I would like users to be able to create Facebook events based on events posted on this site. I'm familiar with the Facebook API and realize I could make my own form that would allows users to create a Facebook event... but I don't really think I want to do that work.
Is there a way I can point a user to Facebook's "create event" form but simply pre-populate some of the fields to help them along?
For example, say I wrote post about a free concert and had a button that said "make this an event on Facebook!". I would like that to link back to the fB event form with a title "Reggae Night 2010" and then from there the user could go on and create the event as they normally would. I don't see the point in doing my own form, validation, etc.
Thanks!
Firstly, obviously have a FB login enabled page and/or when the click your site's "click here to create event in Facebook" button, then have it check for whether the user is already logged into FB. Then use javascript to prepopulate the fields on the form on this page...
http://www.facebook.com/events/create.php
...with the info from your site's event.
That should be it!
-Flak
EDIT: spankmaster79 - yes, that's what I said above.... have your code CHECK for WHETHER you're ALREADY LOGGED INTO FB first. (Please remove the -1, I'd appreciate it)