I'm doing my first steps in FB Apps using the Javascript API but I stumble upon this Top Gear page and I would like to know what method throws this message as I had to make a if statement in php that would use the
$like_status = $signed_request["page"]["liked"];
from the PHP Library (really would love to do all in Javascript, really) to show a <fb:like> button and then subscribe up to the edge.create event in order to show the app it self...
I think was to much trouble if I could at least perform this technique as a simple call.
This article has what you are looking for. Facebook will send post variables to your page with anonymous info about the user including their language and whether they are a fan or not. Once they like the page, the page will refresh and you will know that they are a fan, so you won't need to subscribe to edge.create methods. You will have a variable server side that indicates whether they are a fan and you can code from there.
Related
I'm a bit confused on how to implement the javascript api on my website. First, I need to create an app from facebook, but are there any settings that I should pay more attention to?
Ultimately, I Just want a like button - but I have elements on the page that will pay attention to the like stats, and would like to subscribe to the Edge.create etc methods.
I have an 'App for websites' created, but I'm running into a few issues: First, my like button doesn't show up at all unless the user is logged in. The second is that I just want it to say 'Greg likes biscuitcleaver.com' (much like it would read if the user liked a facebook page - but instead, when I click the like button it says 'Greg Likes a page on biscuitcleaver.com'
Ultimately, the link that ends up on Facebook should just redirect back to my url that I have registered with the Like button. (oh by the way, the url that's in the like button - does it have to be registered with my app somewhere # developers.facebook.com/apps)?
Thanks!
-Greg
You may have a look at the FB Javascript SDK and its login use case for examples and all the configuration details. Beware that FB has been known to change the behavoir of their SDK, so what's true about it today might not be by short notice.
I would like to add a Facebook Like button inside my software.
I know how to programmatically do the actual liking process,
but how do I check and see if a person actually has liked my page?
Edit: I'm guessing that my software also has got to communicate with an actual Facebook App
that I have to develop, and not Only with a regular facebook html source?
Have you considered dropping a TWebControl on your Delphi form, assigning a simple HTML document string to it that contains the markup needed for a Facebook like button and making it just large enough to display your facebook like button content?
The like count and user liked state would be handled automatically by the javascript dynamically loaded into the html page. The javascript written by Facebook.
Seems like a full-functionality, least-effort approach worth considering.
I don't have Facebook to test this, but try to use what is described in this blog post; try to use the following HTTP GET request and in the response (after you parse it), find the user you're looking for:
https://graph.facebook.com/me/likes/PAGE_ID&access_token=ACCESS_TOKEN
Where PAGE_ID should be your page ID and ACCESS_TOKEN your access token.
For a simple GET request you can use e.g. this code.
I have used the javascript code for developing facebook feed dialog and its working perfectly.
But I also want to fill the "Say something here.." field automatically, which appear on popup.
I m not sure how to do it. I have checked the facebook feed dialog documentation for that but have not find anything relevant yet.
Anybody knows how to do this?
Filling in the messages field is not possible (anymore), at least not
with the JavaScript SDK. Any message parameter will just be ignored.
The message field must always be filled with
user 100% generated content if you use the PHP SDK (see Facebook terms).
https://developers.facebook.com/policy/ (see IV.2)
Remember, it´s a "personal message", not something you would/should create with an app.
you are violating the facebook policy by automatically prefilling the message field.
•You should check this link.
https://developers.facebook.com/docs/apps/review/prefill
I know it's possible to do a "like box" for a facebook page, but is it possible to do something similar for events?
Here's the URL for the like box
http://developers.facebook.com/docs/reference/plugins/like-box/
If i simply change the page url to the event url, I get the error message Could not retrieve the specified page. Please verify correct href was passed in.
Basically I would like to be able to post something similar on my website saying "these people signed up for XY event."
Thanks for the help!
Sounds like a nice plugin idea. However, I can imagine after months/years pass there will be millions of event plugins on web pages whose associated events has long passed. The like box is relevant practically forever, but events come and go.
Still, you can definitely build your own event box using the Event API:
https://developers.facebook.com/docs/reference/api/event
For example, query all attending and build a facepile of those users along with the event's info.
I have a Facebook app that is giving me fits. I basically have an app that once the user has liked the app, they can continue through the app. Using the Facebook Javascript API, it will see if the user has logged in, and if not allow them to log in. I pass rather or not they "like" the page from the controller, as well as their language (English or Spanish) to the view via the ViewBag object.
This works both locally and from the staging server; however I have to disable the like check in the view, but the language and like is passed in the viewbag.
I placed language in the view like
<p>The user's language is #ViewBag.lang</p>
and
<p>They like the page? #ViewBag.likes
Like I said, both locally and at the staging server it works; but nothing gets passed through to the Facebook app. I have a conditional check to see if the user likes the page in javascript like:
var likes = #ViewBag.likes
In Facebook, using the console I see that the data isn't passed as well as the before mentioned debugging I tried doing.
I am very new to MVC; is there something I need to enable to make it work through Facebook?
Thanks!
Well the issue is that the Facebook canvas sends an initial POST, this was hitting my POST instead of the GET which was setting these values. See here:
Does Facebook open a canvas app with a Post request? It's causing havoc with my MVC actions
Thanks!