Cookies that can remember facebook users who liked - facebook

I am fresh and making a plugin pop up facebook like box from sketches so please can any body guide me, how I can use cookies to detect if user has already like my facebook page, and don't show the box to him other wise if he hasn't like the page show it.

I think you're heading in a wrong direction. I guess what you want to implement is a so-called "Fan Gate". This was already answered a lot of times here on SO, for example see perl Facebook::Graph API check if user likes page
If you're using a Page Tab App, this is the way to go. Otherwise you'll be having problems to determine whether the specific user has liked you page or not, because you don't have the user_likes permission, which is necessary to get this info.

Related

How do I make sure someone likes my facebook page before entering contest?

I plan to start a Facebook contest where the user is first asked to like the page, then they submit their email to enter the contest.
I checked out other contest examples on:
http://contests.about.com/od/facebookcontests/tp/Facebook-Contests-and-Facebook-Sweepstakes.htm
Most Facebook pages direct a user to a "Like this page to continue" page. I tried to google around to find how this is done, but I cannot find anything. I tried to find ways to track specific user's likes,
For contest-specific legal reasons, I cannot use an app that makes the contest and keeps track of the entries. So I will need to create this from scratch.
I have made other apps before, and I do have access to an external server where I plan to create a page and link to it from facebook for the 'frame' type app.
Is there a standard way of doing this? Is there a documentation that I have yet to find?
Thanks
(Me answering my own question)
Some more googling I was able to find:
How to check if current facebook user like a page using PHP SDK?
A php version of the same question.
In that case, I will be able to check out FQL's documentation to find out how to get this information.
I really don't want a permission popup from facebook to pop up, and I don't think I will need that to make this work. I will try that and add a comment to this answer if it works just like what I'm looking for.

Is this possible to require website visitor to fan a facebook page to access content on the website?

I was wonder if this would be possible and how to do it. I have a personal website. I wanted to have it so that in order for the visitor to gain access to a specific page,the website checks to see if that visitor is a fan of our page on facebook. If they are not, they must become one to advance to the page content on my website. I thought perhaps there is a code that would do this? Maybe some kind of token/cookie combo? Any help would be great. Iv been searching for a solution to this. The page on my personal site gets a lot of traffic so I want to require all visitors to that page to become a facebook fan and the site verifies this before letting them into the page.
Outside of Facebook you can only check if a user likes your page if you have the user login to your site first.
So you’d need to set up an app, have the user login, ask for their permission to read their likes, read the info if they like your particular page – and then either let them see the content, or present them with a like button.
How it’s done in detail is all in the docs – so please have a look around there if you think it’s worth the cost.

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 Development - Simple question on best approach

I am a PHP developer, but completely new to this Facebook stuff and am getting all confused. The whole Apps vs Pages vs Fan Pages terminology is driving me nuts. Please help!
My client's requirements:
1) Display Like button on a single web page
2) When Like button is clicked, content on the page is unlocked and displayed (PHP)
3) Future visits to the page detects that visitor already likes the page, and content remains unlocked (PHP)
4) All updates to web page profile on FB will show on Likers' news feed
My understanding is that the cleanest way of doing (3) above is to use the PHP SDK. But to do this, I need to create an app (to get the App ID). So I created an App. I 'liked' the App from my FB profile. Updates to my app are posted to my news feed. So far, so good.
However when I try and implement the PHP SDK, it only works if I authorize the App to my account first. Is there a way of avoiding this authorization step just for a simple "Like" (I ask because I didn't have to authorize anything when liking the app within FB)? If this authorization is unavoidable, are there any alternatives to Apps that would allow me to achieve the above requirements?
Ideally, I'd like to use just "Pages" to do this, and not Apps, but I believe I cannot achieve (2) and (3) with pages, correct (remembering everything needs to be server side, so no JavaScript showing and hiding layers etc)?
I would be grateful for any guidance.
Thanks.
So I'm assuming what we are talking about here is a Facebook tab - the 520 pixel wide applications that can go in Fan pages?
If not, you will not be able to make this happen without permissions. It sounds like that is what you're talking about, though.
Here's an example of an Facebook tab on the Coca Cola fan page:
In a tab, the PHP SDK will tell you if the user is a fan of the page (not of the app, of the page). You'll need to read the signed request - there will be a parameter there called Page, which tells you if the user is already a fan (see https://developers.facebook.com/docs/authentication/signed_request/). You get this without having to authorize.
I usually read all this and store whether the user is a fan in a boolean variable. Then later in my page I'll do something like this:
<?php if ($isFan):?>
Content for fans here
<?php else:?>
Content for non-fans here
<?php endif;?>
Keep in mind that it is only telling you if the user is a fan OF THAT PAGE - if you set up your app on a test page, for instance, it'll tell you if the user is a fan of that test page or not, NOT if the user is a fan of your app.
In order to read what a facebook user likes using the PHP SDK, you will need the user_likes permission. You may however, be able to hack something together by rendering a like button on your page somewhere and detecting the color of the button, meaning the user has liked the page. This may be problematic because of cross domain issues considering the like button is rendered as an iframe.
Best of luck!
For some things, you need an app. Like restricting access to content if the user has "Liked" something. You need custom code to do that. You don't need an app for a basic "Like" button, but you really can't get any stats on the Likes. You can link an app to a website, so that you can report on the content and referrals. If you go to http://www.facebook.com/insights/ you can link the app with a website so the insights/reporting are combined. Just click on the "Insights for your Website" button. It does require validation.
That said, your confusion is the norm. Apps, Pages and Fan Pages are almost the same thing. They are all referenced through numerical ID. There are subtle feature differences between Pages and App Pages. An app can be added to any Page if it is configured to do so. But you can't add a Page to another Page.
You can use FQL to query if a user is a fan of your app, instead of the Page you are currently on.
Facebook controls what gets shown in the news feed. Just because you post to the feed, doesn't mean it will show. However, if you are an admin of the Page and/or App, posts will always show in your feed.

How can I check if the fb:like button is already pressed on my own page?

I have a website serving free mp3-downloads and I would like them to be only available for facebook fans of the fb-page of the website. The links are thus hidden unless the user is a fan.
I have reached partial functionality by subscribing to the 'edge.create' event, but this event is not fired when the like box is loaded and the page has already been liked.
I don't really know what the best way to do this is, or whether it's possible at all without user permission. Most information on facebook forums is horribly outdated and a lot of it is related to on-facebook facebook apps/tabs, which is not my case.
To clarify: my facebook like button is on my own domain, in my own code.
This is not possible without user permission. You need to ask the user for the user_likes permission as documented here.