Does Facebook SDK require HTTPS?

enable Client OAuth Login and write “localhost:3000” in Valid OAuth Redirect URIs. Save changes. it will automatically change to https://localhost:3000 , but it doesn’t matter… And set Status: In Development (THIS IS IMPORTANT!) Then it will work in your http localhost.

How to recognize Facebook User-Agent

For list of user-agent strings, look up here. The most used, as of September 2015, are facebookexternalhit/* and Facebot. As you haven’t stated what language you’re trying to recognize the user-agent in, I can’t tell you more information. If you do want to recognize Facebook bot in PHP, use if ( strpos($_SERVER[“HTTP_USER_AGENT”], “facebookexternalhit/”) !== false … Read more

how to set a facebook profile picture using the graph api

Upload the picture to an existing album (or create a new one) using the Graph API. Will look something like this: $args = array(‘message’ => ‘Caption’); $args[‘image’] = ‘@’ . realpath(“the_image.png”); try { $data = $facebook->api(“https://stackoverflow.com/”.$album_uid.’/photos’, ‘post’, $args); } catch(Exception $e) { print “<pre>”; print_r($e); print “</pre>”; } Then get the uploaded image via the … Read more

Getting the Facebook like/share count for a given URL

UPDATE: This solution is no longer valid. FQLs are deprecated since August 7th, 2016. https://api.facebook.com/method/fql.query?query=select%20%20like_count%20from%20link_stat%20where%20url=%22http://www.techlila.com%22 Also http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.techlila.com will show you all the data like ‘Share Count’, ‘Like Count’ and ‘Comment Count’ and total of all these. Change the URL (i.e. http://www.techlila.com) as per your need. This is the correct URL, I’m getting right results. EDIT … Read more

Get user profile picture by Id

http://graph.facebook.com/” + facebookId + “/picture?type=square For instance: http://graph.facebook.com/67563683055/picture?type=square There are also more sizes besides “square”. See the docs. Update September 2020 As Facebook have updated their docs this method is not working anymore without a token. You need to append some kind of access_token. You can find further information and how to do it correctly … Read more