82
Facebook development platform For .net Developers

Facebook Platform for Developers

Embed Size (px)

DESCRIPTION

Facebook platform for .net Developers@ Web Development Community, Israel, 06.02.2011for more information: http://www.lidans.com

Citation preview

Page 1: Facebook Platform for Developers

Facebook development platform For .net Developers

Page 2: Facebook Platform for Developers

About me Interests Contact

Photographing

Music

Startups

Entrepreneurship www.lidans.com

Page 3: Facebook Platform for Developers

Agenda

Introduction to facebook platform Facebook architecture, Platform components

Enhancing facebook pages with FBML Using Static FBML Application

Facebook for Websites Open Graph Protocol, Social Plugins

Facebook apps development With ASP.NET MVC & Social Graph API

Page 4: Facebook Platform for Developers

Part 1

Introduction to facebook platform

Page 5: Facebook Platform for Developers

20 Minutes on facebook...

1,000,000 1,484,000 1,972,000 2,716,000 2,716,000

1,323,000 1,851,000 1,587,000 10,208,000

LINKS SHARED

TAGGED PHOTOS

EVENT INVITES

STATUS UPDATES

WALL POSTS

COMMENTS MADE

FRIEND REQUESTS ACCEPTED

PHOTOS UPLOADED

MESSAGES SENT

Page 6: Facebook Platform for Developers

20 Minutes on facebook...

500 GB of data every 20 minutes!

~36 TB/day ~13 PB/year

Page 7: Facebook Platform for Developers

How to handle such a freak amount of information? open source

Page 8: Facebook Platform for Developers

facebook infrastructure

Page 9: Facebook Platform for Developers

facebook infrastructure

More information at:

http://developers.facebook.com/opensource

Page 10: Facebook Platform for Developers

facebook platform- why?

of facebook users engaged with facebook applications every day

More than

70% facebook users engaged with facebook on 2.5M websites every month

More than

250M facebook users accessing facebook through their mobile devices every day

More than

200M

Page 11: Facebook Platform for Developers

Facebook Insights

Platform Core Components

Social Graph API

Open Graph Protocol Social Plugins

Page 12: Facebook Platform for Developers

Part 2

Enhancing facebook pages with FBML

Page 13: Facebook Platform for Developers

Static FBML Application

Provides HTML, CSS and JavaScript functionality on

facebook pages

Page 14: Facebook Platform for Developers

What’s needed?

Be admin of your facebook page

Install Static FBML Application

Add FBML Tabs with static content

Page 15: Facebook Platform for Developers

Before getting started...

Max width is 520px

You cannot auto run JavaScript

in FBML tab

Use FBJS

Use external CSS file instead of

<style> tag

6 Tabs maximum

facebook pages only

Page 16: Facebook Platform for Developers

Demo

Adding FBML Tab to facebook page

Page 17: Facebook Platform for Developers

FBML

Page 18: Facebook Platform for Developers

FBML

>fb:swf imgstyle="border-width: 3px; border-color: white;” swfsrc="http://www.youtube.com/v/CfMGFHiTKLY” imgsrc="http://i4.ytimg.com/vi/CfMGFHiTKLY/default.jpg” width="480” height="390” />

>fb:user-agent includes="ie 6, ie 7”> <link rel="stylesheet” href="ie.css” /> </fb:user-agent>

Page 19: Facebook Platform for Developers

FBML

>fb:swf imgstyle="border-width: 3px; border-color: white;” swfsrc="http://www.youtube.com/v/CfMGFHiTKLY” imgsrc="http://i4.ytimg.com/vi/CfMGFHiTKLY/default.jpg” width="480” height="390” />

>fb:user-agent includes="ie 6, ie 7”> <link rel="stylesheet” href="ie.css” /> </fb:user-agent>

FBML Documentation is available at:

http://developers.facebook.com/docs/reference/fbml

Remember that FBML is deprecated

Page 20: Facebook Platform for Developers

Part 3

Facebook for Websites

Page 21: Facebook Platform for Developers

Platform Core Components

Open Graph Protocol

Page 22: Facebook Platform for Developers

A Webpage...

Page 23: Facebook Platform for Developers

Is a real-world facebook object!

Picture Check-in Comment Like Recommend

Lidan

Page 24: Facebook Platform for Developers

What do you LIKE in the real-world? (Except your smartphone)

Page 25: Facebook Platform for Developers

Movies

Page 26: Facebook Platform for Developers

Food

Page 27: Facebook Platform for Developers

Government

Page 28: Facebook Platform for Developers

Government

Bar

Page 29: Facebook Platform for Developers

Public Figure

Page 30: Facebook Platform for Developers

Actor

Page 31: Facebook Platform for Developers

What user likes in the real-world Based off of the most popular categories for Facebook Pages

Activities

Businesses

Groups

Organizations

People

Places

Products and Entertainment

Websites

company, restaurant

sports_team, cause

band, government

musician, actor

city, country

book, movie, tv_show

website, blog, article

Page 32: Facebook Platform for Developers

Implementing the Open Graph

Page 33: Facebook Platform for Developers

Implementing the Open Graph

>html xmlns="http://www.w3.org/1999/xhtml”> <head> <title> The Social Network (2010) </title> </head>

>html xmlns="http://www.w3.org/1999/xhtml” xmlns:og=“http://ogp.me/ns#” xmlns:fb="http://www.facebook.com/2008/fbml”> <head> <title> The Social Network (2010) </title> </head>

>html xmlns="http://www.w3.org/1999/xhtml” xmlns:og=“http://ogp.me/ns#” xmlns:fb="http://www.facebook.com/2008/fbml”> <head> <title> The Social Network (2010) </title> <meta property="og:title” content="The Social Network” /> <meta property="og:type” content="Movie” /> <meta property="og:url” content="http://www.imdb.com/897” /> <meta property="og:image” content="http://www.imdb.com/897/theSocialNetwork.jpg” /> </head>

Page 34: Facebook Platform for Developers

Open Graph Meta-Tags

og:email og:phone_number

fb:admins og:street-address og:latitude og:longitude

og:audio og:video

Page 35: Facebook Platform for Developers

Open Graph Meta-Tags

og:email og:phone_number

fb:admins og:street-address og:latitude og:longitude

og:audio og:video

More information at:

http://ogp.me

Page 36: Facebook Platform for Developers

Platform Core Components

Social Plugins

Page 37: Facebook Platform for Developers

Social Plugins

Let user see what his friends have liked, commented on or shared across the web

Provides integration between facebook platform and your website

Page 38: Facebook Platform for Developers
Page 39: Facebook Platform for Developers

Like Button

Activity Feed

Recommendations

Like Box

Login

Facepile

Comments

Live Stream

Social Plugins

Page 40: Facebook Platform for Developers

Like Box

Enable users to like your facebook page and view its stream directly from your

website

Page 41: Facebook Platform for Developers

<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;stream=true&amp;header=true&amp;height=427" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px;height:427px;" allowTransparency="true"></iframe>

Like Box IFrame

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> <fb:like-box href="http://www.facebook.com/platform" width="292" show_faces="true" stream="true" header="true"></fb:like-box>

XFBML

Page 42: Facebook Platform for Developers

Demo

Like Box Generate code for all of the social plugins at:

http://developers.facebook.com/docs/plugins

Page 43: Facebook Platform for Developers

Like Button

Lets users share pages from your site back to their facebook

profile with one click

Page 44: Facebook Platform for Developers

Demo

Like Button

Page 45: Facebook Platform for Developers

Recommendations

Gives users personalized suggestions for pages on your

site they might like

Page 46: Facebook Platform for Developers

Advanced plugins

Create a new facebook application

Setup a new application at:

http://developers.facebook.com/setup

Page 47: Facebook Platform for Developers

Comments

Lets users comment on any piece of content on your site

Page 48: Facebook Platform for Developers

Demo

Comments

Page 49: Facebook Platform for Developers

Live Stream

Lets users share activity and comments in real time, best for

real-time events

Page 50: Facebook Platform for Developers

Demo

Live Stream

Page 51: Facebook Platform for Developers

Login & Registration

Allows users to easily sign up for your website with their

facebook account

Page 52: Facebook Platform for Developers
Page 53: Facebook Platform for Developers

More information at:

http://developers.facebook.com/docs/plugins/registration

Page 54: Facebook Platform for Developers

A Short Break Good time to update your status

Page 55: Facebook Platform for Developers

Part 4

facebook apps development

Page 56: Facebook Platform for Developers

TOP Facebook apps (January 2011)

98,607,517

53,508,022

37,187,222

346,300

Page 57: Facebook Platform for Developers

What motivates users to use facebook apps? too much free time

Page 58: Facebook Platform for Developers

What makes facebook apps so successful?

Social

Viral

Competitiveness

Real time Anytime

Simple

Page 59: Facebook Platform for Developers

Platform Core Components

Social Graph API

Page 60: Facebook Platform for Developers

The Social Graph “Privacy no longer a social norm”

- Mark Zuckerberg

Page 61: Facebook Platform for Developers
Page 62: Facebook Platform for Developers

https://graph.facebook.com/ me/ albums/

Profile Pictures

My Pictures Picture Picture Picture

comment

comment

notes

The Social Graph

Page 63: Facebook Platform for Developers

698752998

Objects

https://graph.facebook.com/ lidan

{ id: "698752998“, name: "Lidan Hifi“, first_name: "Lidan“, last_name: "Hifi“, link: "http://www.facebook.com/lidan", birthday: "04/27/1988“, location: {

id: "113187025363265“, name: "Be'Er Sheva`, Hadarom, Israel"

}, gender: "male“ }

Unique ID

Page 64: Facebook Platform for Developers

698752998

Relationships

https://graph.facebook.com/

{id: "698752998_187701601241105“, from: {

name: "Lidan Hifi“, id: "698752998"

} message: " רק הטלפון שלי עם התיקון שגיאות שלו יכול לאחל לאנשים שנה מלאה

..."בלוויות במקום שנה מלאה בחוויות ,- privacy: {

description: "Friends Only; “, value: "CUSTOM“, friends: "ALL_FRIENDS"

}, type: "status“, created_time: "2011-01-02T13:05:10+0000“, likes: 5 }

/feed

Page 65: Facebook Platform for Developers

Relationships

https://graph.facebook.com/lidan/friends

https://graph.facebook.com/lidan/photos

https://graph.facebook.com/lidan/videos

https://graph.facebook.com/lidan/likes

https://graph.facebook.com/lidan/notes

https://graph.facebook.com/lidan/links

https://graph.facebook.com/lidan/events

https://graph.facebook.com/lidan/groups

Page 66: Facebook Platform for Developers

Authentication OAuth 2.0-based authentication https://graph.facebook.com/me?access_token=2227470867|2.v UgGGAgEL6yF_LEYygniXA__.3600.1296417600698752998|rlW FrcgmkEVVKd7aYi3bKjNZ1gU

Permissions You must request specific permissions from the user

read_stream, publish_stream, user_photos, user_checkins, user_location, offline_access

Page 67: Facebook Platform for Developers

Authentication OAuth 2.0-based authentication https://graph.facebook.com/me?access_token=2227470867|2.v UgGGAgEL6yF_LEYygniXA__.3600.1296417600698752998|rlW FrcgmkEVVKd7aYi3bKjNZ1gU

Permissions You must request specific permissions from the user

read_stream, publish_stream, user_photos, user_checkins, user_location, offline_access

https://www.facebook.com/dialog/oauth?client_id=114587458&redirect_uri=http://www.lidans.com https://www.facebook.com/dialog/oauth?client_id=114587458&redirect_uri=http://www.lidans.com

https://www.facebook.com/dialog/oauth?client_id=114587458

&redirect_uri=http://www.lidans.com

Page 68: Facebook Platform for Developers

Publishing

HTTP POST https://graph.facebook.com/18754916/attending

HTTP POST https://graph.facebook.com/lidan/feed { message: ‘Hi, Do you like the graph API?’ } HTTP POST https://graph.facebook.com/lidan/checkins { coordinates: { 32.175876, 34.889177 }, place: 149111711803941, message: ‘playing with the graph API at Microsoft Israel’ }

Page 69: Facebook Platform for Developers

Deleting

HTTP DELETE https://graph.facebook.com/5174466698

Page 70: Facebook Platform for Developers

Deleting

HTTP DELETE https://graph.facebook.com/5174466698

More info about Facebook Social Graph:

http://graph.facebook.com

Page 71: Facebook Platform for Developers

How facebook app works

user Application server

User Request

HTML Response

API Call

API Response

Request For application

Response For application

1

2

3 4

5 6

Page 72: Facebook Platform for Developers

Web Server Valid domain or IP

(NO localhost)

Facebook SDK

Application Application Id

API Key

AppSecret

What’s needed?

Page 73: Facebook Platform for Developers

Facebook applications

Setup a new facebook application

Setup a new application at:

http://www.facebook.com/developers

Page 74: Facebook Platform for Developers

Application Settings

APP_NAME

Page 75: Facebook Platform for Developers

Application Pages

Page 76: Facebook Platform for Developers

facebook Official SDKs

FBJS

Page 77: Facebook Platform for Developers

facebook C#.NET SDKs

Facesharp http://facesharp.codeplex.com

Facebook C# SDK http://facebooksdk.codeplex.com

Page 78: Facebook Platform for Developers

Demo

Create facebook application with ASP.NET MVC

Page 79: Facebook Platform for Developers

Review

Facebook platform

Facebook pages & Static FBML

Facebook for Websites

Facebook Applications

Page 80: Facebook Platform for Developers

More Topics

Advanced APIs

Facebook Credits

Promote your application

Performance

Page 81: Facebook Platform for Developers

Related links

Page 82: Facebook Platform for Developers

Thanks! Questions?