Through Facebook Platform, you have access to Facebook's representation of the social graph: the network of connections and relationships through which people communicate and share information in the real world. This means you can create uniquely social, uniquely relevant experiences for your users. The combination of integration into the Facebook Web site, access to the social graph, and new business opportunities that Facebook Platform offers makes it a unique development platform, enabling you to be on the cutting edge of technology while having an impact on millions of users. Use the social data context to provide great experience for users.Facebook platform API enables developers to incorporate the data users choose to share into applications.It gives developers access to the core of facebook’s value – Social graph
The social graph, in addition to providing social context to make a user’s experience more relevant, also enables a viral distribution model. Valuable content and applications themselves can spread through a user’s connections, meaning that a great application can rapidly be used by millions of peopleApplications developed for use inside Facebook can use integration points into the Facebook site, which you can use to give your users a seamless experience inside Facebook. Applications can also provide canvas pages specific to their applications, which users can access at http://apps.facebook.com/your_app/.
Provides web service for accessing and contributing Facebook data.Display layer for presenting your application on Facebook.Facebook applications can be developed for use inside the Facebook Web site, on standalone Web sites, on desktops, or even on mobile devices.
Once a user has authorized your application, you receive a temporary session key which grants you the right to make calls to the API Web service (api.facebook.com/restserver.php) on that user's behalf. All API calls made with that user's session key return information as the user would see it; so, the list of friends returned from friends.get using a user's session key would be the friends of the calling user. The photos returned from an album in a call to a photos.* method would be the set of photos that user can see in that album (depending on the privacy settings, a viewer might see no photos). You can prompt the user for the offline access extended permission so you can access that user's data without an active session. You can prompt the user for the offline access extended permission so you can access that user's data without an active session. If a user logs out of Facebook or removes your application, the session key is invalidated, and you can no longer act on that user's behalf nor access any data on behalf of the user. Push application-defined FBML to the calling user's profile, which controls the profile box for your application, and any other profile integration points relating to your application she sees. Push application-defined content to a user's Feed. Send application-defined notifications to a user. User Data Vs. Application Data When designing your application, keep in mind the distinction between user data and application data. Any data provided directly to you by users is your data, which you can use as you like. Data provided by the Facebook API belongs to users and is only temporarily authorized by a user specifically for your responsible use. Aside from temporarily caching some data to assist with storing, you can never store or redistribute any data provided by Facebook Platform. The only exceptions are data that are storable indefinitely, largely identifiers that are usually used as keys pointing to a user's data gathered by your application. Please refer to the Facebook Developer Terms of Service for more information.
Whenever a user authorizes the application, Facebook pings (calls) this url and POST several parameters to the page at the same time, including fb_sig_user which is the uid of the user who is authorizing our application. So the next step is easy. We just need to store this user id to a database. Then we can get a list of users who have authorized our application at any time we want. Below is a sample code showing how this can be done.
Facebook Platform includes integration points into the Facebook profile, which you can use to give your users a seamless experience inside Facebook. We've tried to expose a broad variety of integration points (including everything we use to build Facebook applications) for your use. One way to explore available integration points is by taking a look at how Facebook's popular Photos application integrates into the Facebook website. Feed: An application can publish content into a user's Feed, appearing on the user's Wall tab. These stories are most effective when they involve primary actions taken by or on the owner of the profile, are recent events (occurring in the past 24 hours), and involve the profile owner's friends. For instance, Photos might generate a Feed story like "Kate tagged Caitlin in a photo," alongside a preview of that photo. Profile box: The profile box provides a space for the application to represent itself on a user's profile. Users think about profiles as representations of themselves, so profile boxes are best used as a way for users to express themselves, not a place to consume content. Profile boxes are most engaging when they showcase recent interactions of a user with her friends or with your applications, or show recent relevant content. Feed Forms: Feed forms are special FBML components that allow applications to publish Feed stories on the behalf of users. Your application can publish directly into the user's and the user's friends' Feeds. Bookmarks: If a user has bookmarked your application, it will appear in the Applications menu on the bottom left side of the viewer's Facebook profile, which gives the viewer an easy way to always access your application. Application Info Sections: The Info tab on the profile allows users to express their interests in a more structured way than before. Users can add structured information from your applications by way of application info sections. An application info section is a list of text and/or images provided by your application. Application Tabs: Application tabs let users feature full canvas-like pages for applications they enjoy the most. Tabs behave like a hybrid of a canvas page and a profile box. Boxes Tab: The Boxes tab contains application profile boxes. Users can move profile boxes from the main profile to the Boxes tab and vice versa. There are also several integration points available outside of a user's profile. Message Composer and Wall: Users of your application can include relevant attachments from your application in Facebook messages or as part of Wall posts. Canvas pages: You can build a full presence for your application on canvas pages – you control the look and feel as well as the functionality of the pages. This is a great place to provide an in-depth experience for your users, build a community, encourage interaction, and surface content to users. Canvas pages which don’t require user context can also be indexed by external search engines. News Feed: This is the easiest way for users to become engaged with your application. News Feed operates probabilistically, choosing the most relevant stories for each user, so it’s important to provide stories that your users will find valuable. The most effective News Feed stories contain information a user will find interesting, involve a user’s friends, and give the user a preview of what the user will see should she engage more deeply with an application. Notifications: Your application can send notifications to a user. Be forewarned that your application's ability to send notifications will be impacted if users mark notifications as spam. It's important to only send notifications with real updates about a user's relevant interactions on your application. Of course, many of these integration points are controlled by the user. The user can choose at any time not to show profile boxes, application info sections, or Feed stories from an application.
Run this code in developers.facebook.com/tools and show demo.
API Test Console Demo:Log into FacebookSelectfriends.get with Facebook PHP client as Response Format.This would give the user id of all the logged in friends.Select users.getinfo and pass bunch of uidsIn the fields column, enter “first_name, birthday”Do CallMethod to fetch the data.FBML Test Console:<table cellpadding=0 cellspacing=0><tr><td><table cellpadding=0 cellspacing=0><tr><td><fb:profile-picuid=518609572></fb:profile-pic></td></tr><tr><td><fb:nameuseyou=false uid=518609572 firstnameonly=true></fb:name></td></tr></table></td><td><table cellpadding=0 cellspacing=0><tr><td><fb:profile-picuid=557769867></fb:profile-pic></td></tr><tr><td><fb:nameuseyou=false uid=557769867 firstnameonly=true></fb:name></td></tr></table></td><td><table cellpadding=0 cellspacing=0><tr><td><fb:profile-picuid=574360773></fb:profile-pic></td></tr><tr><td><fb:nameuseyou=false uid=574360773 firstnameonly=true></fb:name></td></tr></table></td></tr></table>FQML Test ConsoleSelect Response Format as Facebook PHP Client.Select Method as fql queryEnter the following query :SELECT first_name, last_name,birthdayFROM userWHERE uid IN ( SELECT uid1FROM friendWHERE uid2=1027980517)
Existing Sample App for Demo : http://apps.facebook.com/aspdotnetsample/friends.aspx
Execute it in FB Tools console
Once authorized, the [Facebook user] is considered to be a [user of the application]. A Facebook user only needs to authorize an application once. After that the application can access the user's information forever. Therefore authorization should only take place once for every user, unless the user removed your application.After the user clicks "Allow Access", he or she will be re-directed back to a url you specified in your Developers application. This is the Post-Authorize Redirect URL, which can be found under the Canvas section. If you do not specify this url, the user will be re-directed to the Canvas Page URL (i.e. the first page of your application) by default.
fbFund enables innovative and engaging social experiences with Facebook Connect. Get your funded and running while learning from the best. Apply now
Facebook Connect is a powerful set of APIs for developers that lets users bring their identity and connections everywhere. Developers can access a user's:Identity: name, photos, events, and more.Social Graph: friends and connections.Stream: activity, distribution, and integration points within Facebook, like stream stories and Publishers.Use this information to create more engaging experiences on your website. Facebook Connect is free, so what are you waiting for? Be a part of making the Web more social and connecting people everywhere. Seamlessly connect their Facebook account and information with your iPhone appConnect and share experiences with friends who also use your iPhone appShare user information and actions on your iPhone app with friends on Facebook
Introduction to facebook platform
What is Facebook Social Network More than 400M users worldwide Gallery, Profile Management, Collaboration, Notes, Ratings, Discussion boards, Video all in one place. You don’t need to pay anything to access it.
Benefits of developing on FBplatform User management is done by FB Harvest social relationships Viral marketing Easy to develop, promote and monetize Bring an existing app and brand into FB Support for different languages
What can I develop? Imagination is the Limit Games Dump Entertaining Apps Content Sharing Apps Business Apps Social Network Aggregator and Mashups
Basic Concepts Facebook applications are applications that use Facebook Platform to access and incorporate Facebook social data All applications (including those developed by Facebook) can be added or removed by a user, which will add or remove an application from a user’s account. Users can add and remove applications at will. Users can also authorize applications (by “logging in” to an application) to access their user data.
Facebook API Web Service A user has to authorize the application to fetch user data. Session key is issued that grants application to make calls to the API Web Service (api.facebook.com/restserver.php) All API calls made with the user’s session key would return user’s specific data. Most data returned from Web service is simple XML, defined by an XML schema document at http://api.facebook.com/1.0/facebook.xsd. You can use this to create bindings, run XSLT on the results, or simply use as a reference to understand the data being returned.
Developing Application :Example Login here : http://facebook.com/developers
Post Authorization Facebook pings an url whenever a user authorizes an application. This url must be specified in our developer application as shown below.
And the output ishttp://apps.facebook.com/softexpo/
Important Components FBML FBJS FQL XFBML REST API
FBML Its like any other markup language. Comes with namespace “fb”.http://wiki.developers.facebook.com/index.php/FBML
Facebook Integration Points Facebook platform provides integration points into the facebook profile. Feed: An application can publish content into a users Feed, appearing on the users Wall tab. Profile box: The profile box provides a space for the application to represent itself on a users profile. Feed Forms: Feed forms are special FBML components that allow applications to publish Feed stories on the behalf of users.
Feed Form A Feed Form is a form which prompts the user to post something to his/her/friends/pages/groups/events wall. Because it is a form, the user must click the "Publish" button to publish the feed to the wall. A Feed Form is simply something like this:
Sample FBML<fb:board xid="titans_board" canpost="true"candelete="false" canmark="false" cancreatetopic="true"numtopics="5"returnurl="http://apps.facebook.com/myapp/titans/"><fb:title>Discuss the Titans</fb:title></fb:board>
Sample FBML – Invite Friends<fb:request-form action="index.php" method="POST" invite="true" type="Softexpo 2010" Content="Checkout Softexpo Application on Facebook"> <fb:multi-friend-selector actiontext="Invite your friends to useSoftExpo." /></fb:request-form>
Demo 1 : Facebook Tools Go to http://developers.facebook.com/tools.php Demo of API Test Console Demo of FBML Test Console Demo of FQML Test Console
Demo 2 : Facebook Application Go to www.facebook.com/developers Go to the Developer application and click “Set Up New Application”. Give your application a name, check to accept the Terms of Service, then click Submit. Canvas Page URL : The address which is seen by your application users. Your users go to this address in facebook to access your application. In the example " http://apps.facebook.com/myfbapp_pi/ “ Canvas Callback URL : The location where to host your application.
FQLSELECT name, picFROM userWHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 1027980517)AND sex=female
FQL You can get the result of complex “SEARCH” quickly You can do things which are resource hungry, quite easily You can join complex queries together and find a specific item
AuthorizationAuthorization is an important step and concept aboutFacebook applications. According to Facebooks policy, anapplication can only perform the followings without apermission of the user: Access the users name, users profile picture and the list of friends of the user, provided that the user does not choose to hide his/her information for public search Publish feeds to the users wall by prompting the user to do so Send request or invitations to other users by prompting the user to do so.
Extended Permissions SMS, Stream, Email, Events, Notes, status_update and a lot more. http://wiki.developers.facebook.com/index.php/Exten ded_permissions <fb:prompt-permission perms="publish_stream"> Let me update your status </fb:prompt-permission>
Conclusion Facebook applications can embed advertising and sponsorship – no revenue sharing Facebook applications run from your servers giving more accountability and metrics Face application platform enables rapid application development in multiple languages.