Response from edge.create if Like clicker has no FB page - facebook

I'm subscribing to a Like button on my page to notify me when someone clicks the Like button. I then give this user a discount for telling their friends about the site. But what if the user doesn't have a Facebook page? Will I still get a call at my handler function. The Response passed by the edge.create call to the handler is just the URL that was liked, so there doesn't seem to be any flag passed that tells me that the user didn't really post anything to a FB page. How can I handle this and not be giving discounts for nothing?
Thanks

What do you mean by "user has no FB page"? Not every Facebook user will also have a Facebook page. I only have pages on my Facebook user account are there solely for testing purposes. If I wasn't developing apps with the Facebook API, then I wouldn't have any at all. So requiring your users to have a Facebook page may not be in your best interest. Just let them like your website using their normal Facebook user account.

Related

Does Facebook send notifications to my web page by the fb app?

I have searched on Google and Fb's documentation about this but didn't find anything.
I've already shared content of my page on Facebook with the Share button provided by FB's api and also made an app on Facebook.
Now I want to receive notifications in my page when someone comments the publication or likes it.
I know that I can consult the posts/comments/likes if the user gives me the permissions, but I don't want to do this every 5 minutes. I want that facebook notifies me like a push notification.
How can I do that if it's possible?
Thanks!
After the user shared something on his wall, there is no way for you to get notified about comments/likes on that wall post, unless you authorize the user with user_status or read_stream.
That being said, there is the Realtime API with the feed and statuses fields to subscribe to: https://developers.facebook.com/docs/graph-api/real-time-updates/
That´s probably the best option, although you must authorize the user with the correct permissions too.

Force User To Like FB Page Before Visiting My Website

As part of a website that I am developing, I have a Like Gate Page that I want to use in order to force my site visitors to press the like button before they are redirected to the site homepage.
When a Liker visitor comes back for the LIKE Gate page he/she should be redirected automatically to the website homepage (he/she already pressed like).
Important:
The whole website including the Like Gate is not found in a Facebook App/Page Tab!
It is OK to ask the user to login before he/she can press the Like button.
Well, in your web page you could implement Facebook login and get user's permission to see his/her likes. Get said likes from Graph API, see if your page is in the list and depending on that, either show your web page, or redirect user to your facebook page. You will need user_likes permission for that.
By using Facebook Javascript SDK Methods FB.Event.subscribe, FB.getLoginStatus, FB.api, authResponse, pages.isFan, access.token and Javascript SDK and a little bit PHP SDK.
I saw one, almost perfect that can be site-integrated, fully-explained, and free in this blog: http://daneworx.blogspot.com/2014/02/how-to-force-users-to-like-your-page.html

Facebook get users that like our business page

Our business wants to give a free gift to all the users that like our facebook page. Do you know a way to get the list of emails with all users that liked our page?
Is it possible to obtain that using graph API?
Is there any possibility to offer this functionality to our customers? My problem will reduce to check if one user likes our page.
Radu,
This is not possible at (with FB API) at this time.
See here
You could create tab (with a canvas url) on your facebook page that does the following:
User clicks the tab (or is directed there by some other link)
On the canvas page, use the FB api to check if that user has liked your page. If not, persuade them to do so.
If the user liked the page, show a form where the user can enter his email.
Store the data on your own server.
Hope this helps.
After much research, I used this solution:
I call FB.login to authorize my application and request 'user_likes' permission
check /me/likes/[pageid]
If the response is not null the user likes our page.

Get FB User when authenticating to Facebook via Send Button

I've done quite a search on SO and this doesn't seem possible. But I'll ask the question, just in-case someone does know if this is possible.
With the standard like/send buttons. If an unauthenticated FB user clicks send and via the FB dialog window then authenticates. Is there a way of finding out the FB id of this user?
Edit: To clarify, this question is not about clicking the like button. I know you can't get any information from clicking it. This is about clicking the send button and then post auth with FB.
This is not possible, as already seen in
How to know who clicked the Facebook "Like" button on my site?
How can I get user's facebook ID who clicked like button?
You can only track users that allowed an app made by you to access their information.

Show content on external website, only if user is a 'fan' of the URL?

Similar to the ever-trendy Fan Page trick that allows page owners to only show certain content when a user performs the 'like' action (visible-to-connection), I wish to be able to only show certain content on a website once a user has liked the website.
If there is no FB code for this, I have considered using a Facebook like callback (triggered when a user likes on the current page) to set a cookie that establishes a user has liked the page or perhaps a database table that sets a users status to 'liked', again using the callback within the documentation.
Any ideas would be helpful. Thanks.
I haven't seen a "fangate" implementation for non-Facebook pages that didn't require you to go through the full Facebook authentication process (with the user_likes scope) first. You could set a cookie when they like, but that'll only work if they liked it via your site (i.e. if they liked you on Facebook, it wouldn't get caught by your site), and the cookie could get deleted or lost.
you can use the Javascipt SDK to easily accomplish this.
First, call FB.init:
https://developers.facebook.com/docs/reference/javascript/FB.init/
Then call getLoginStatus:
https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
If they're not logged in ( not authorized your app ), then call
FB.login and then recall getLoginStatus.
If logged in, then get the user's likes via FQL:
https://developers.facebook.com/docs/reference/javascript/FB.Data.query/