Skip to main content

Posts

Showing posts with the label facebook

Facebook User Authentication: Get access to user data

This is the extension of my previous article on facebook share. But, no need of prior knowledge. Proceed from here. After registering a developer account @ https://developers.facebook.com/ , create an app. Note the App-Id and don't forget to add the redirect url under the app settings section. Also add all the access permissions you would like to get from the user under Auth Dalog section. All these permissions are to be used later to retrieve corresponding data. URL pattern to implement the authentication is as follows: http://m.facebook.com/dialog/oauth?client_id=<APP-ID> &redirect_uri=<PATH- TO-TARGETTED-LOCATION> &scope=<ALL-THE-PERMISSIONS-LIKE-email,offline_access> &response_type=token Just modify the CAPITAL lettered data, and for the redirect-url no need of using quotation marks ("")

Facebook Share (URL based)

This is the most simplest way to add a facebook share button. Use the following code as the reference(href) attribute of your anchor tag(<a>) "http://www.facebook.com/sharer.php?u=<text or url to post on wall>" You can use any image to show the share button, but be precise in selecting it, as the user should get on it easily. Consider the following sample code: <a href="http://www.facebook.com/sharer.php?u=https://thechaithanya.wordpress.com"><img src="http://www.acrnet.org/uploadedImages/Get_Involved/facebook-logo.png" alt="share on facebook"></a> If you are developing any applicetion or website and want the post to be displayed as it was posted from your app, like " via theChaithanya ", use the following code:          "http://m.facebook.com/dialog/feed?app_id=YOUR-APP-ID&link=LINK-TO-BE-POSTED&redirect_uri=PATH-TO-LOCATION-AFTER-SHARE" On successful sharing it w...