Facebook Platform, Genel Kavramlar, iFrame & FQL

34

description

Ozgur Demir's presentation at Facebook Developer Garage Istanbul - 2009-10-11

Transcript of Facebook Platform, Genel Kavramlar, iFrame & FQL

Page 1: Facebook Platform, Genel Kavramlar, iFrame & FQL
Page 2: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook PlatformGenel Kavramlar, iFrame & FQL

Özgür DemirSite Reliability Engineer / Software Engineer11 Ekim 2009

Page 3: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Platform Nedir ?

Page 4: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Platform Nedir ?

Facebook temel işlevlerini, yazılım geliştiricilerin kullanımına sunmak için hazırlanmış olan bileşenler bütünüdür

Page 5: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Platform Nedir ?

Facebook temel işlevlerini, yazılım geliştiricilerin kullanımına sunmak için hazırlanmış olan bileşenler bütünüdür

1. Identity (Kimlik)

Page 6: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Platform Nedir ?

Facebook temel işlevlerini, yazılım geliştiricilerin kullanımına sunmak için hazırlanmış olan bileşenler bütünüdür

1. Identity (Kimlik)2. Social Graph (Sosyal Grafik)

Page 7: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Platform Nedir ?

Facebook temel işlevlerini, yazılım geliştiricilerin kullanımına sunmak için hazırlanmış olan bileşenler bütünüdür

1. Identity (Kimlik)2. Social Graph (Sosyal Grafik)3. Stream (Veri Akışı)

Page 8: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Platform Nedir ?

Facebook temel işlevlerini, yazılım geliştiricilerin kullanımına sunmak için hazırlanmış olan bileşenler bütünüdür

1. Identity (Kimlik)2. Social Graph (Sosyal Grafik)3. Stream (Veri Akışı)

Identity SocialGraph

Stream

Page 9: Facebook Platform, Genel Kavramlar, iFrame & FQL

Nasıl ?

Page 10: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Platform Bileşenleri

Page 11: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Platform Bileşenleri

Facebook APIFBML (Facebook Markup Language)XFBML (Extended FBML)FQL (Facebook Query Language)FBJS (Facebook Javascript Library)

Page 12: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Uygulaması Veri Gösterim Yöntemleri

Page 13: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Uygulaması Veri Gösterim Yöntemleri

- FBML

<div id=‘welcome’>Merhaba <fb:name uid="12345" />, Hoşgeldin</div>

Page 14: Facebook Platform, Genel Kavramlar, iFrame & FQL

Facebook Uygulaması Veri Gösterim Yöntemleri

- FBML- iFrame

Page 15: Facebook Platform, Genel Kavramlar, iFrame & FQL

iFrame Uygulamalarında Program Akışı

Page 16: Facebook Platform, Genel Kavramlar, iFrame & FQL

http://apps.facebook.com/uygulama_adresi/

Page 17: Facebook Platform, Genel Kavramlar, iFrame & FQL

http://apps.facebook.com/uygulama_adresi/

Facebook

Sayfa yükleme istemi

Page 18: Facebook Platform, Genel Kavramlar, iFrame & FQL

http://apps.facebook.com/uygulama_adresi/

Facebook

iFrame dışındaki içerik ve fb_sig parametreleri

Page 19: Facebook Platform, Genel Kavramlar, iFrame & FQL

http://apps.facebook.com/uygulama_adresi/

Uygulama Sunucusu

iFrame içeriği istemi

Page 20: Facebook Platform, Genel Kavramlar, iFrame & FQL

http://apps.facebook.com/uygulama_adresi/

Uygulama Sunucusu

apps.facebook.com

iFrame içeriği istemi

API istemi (FQL)

Page 21: Facebook Platform, Genel Kavramlar, iFrame & FQL

http://apps.facebook.com/uygulama_adresi/

Uygulama Sunucusu

apps.facebook.com

iFrame içeriği istemi

API sonuç verisi

Page 22: Facebook Platform, Genel Kavramlar, iFrame & FQL

http://apps.facebook.com/uygulama_adresi/

Uygulama Sunucusu

iFrame içeriği

Page 23: Facebook Platform, Genel Kavramlar, iFrame & FQL

Yetkilendirme ve Güvenlik

Page 24: Facebook Platform, Genel Kavramlar, iFrame & FQL

Yetkilendirme ve Güvenlik

fb_sig parametreleri

Page 25: Facebook Platform, Genel Kavramlar, iFrame & FQL

Yetkilendirme ve Güvenlik

fb_sig parametreleri

fb_sig_addedfb_sig_api_keyfb_sig_localefb_sig_timefb_sig_user/fb_sig_canvas_userfb_sig_session_keyfb_sig_expiresfb_sig_in_canvasfb_sig_in_profile_tab

Page 26: Facebook Platform, Genel Kavramlar, iFrame & FQL

Yetkilendirme ve Güvenlik

$_REQUEST ve fb_sig

$fbsig = array();foreach($_GET as $key=>$value) { if(substr($key,0,7) == 'fb_sig_') { $fbsig[substr($key,7)] = $value; }}ksort($fbsig);

foreach($fbsig as $key=>$value) { $string .= $key . '=' . $value;}$string .= $secret;

if (md5($string) == $_GET['fb_sig’]) { // OK} else { // NOT OK}

Page 27: Facebook Platform, Genel Kavramlar, iFrame & FQL

FQL

SELECT name, status, is_app_user FROM user WHERE uid=211031

Page 28: Facebook Platform, Genel Kavramlar, iFrame & FQL

FQL

require_once 'facebook.php';

$appapikey = ’UYGULAMA APP KEY';$appsecret = ’UYGULAMA APP SECRET';

Page 29: Facebook Platform, Genel Kavramlar, iFrame & FQL

FQL

require_once 'facebook.php';

$appapikey = ’UYGULAMA APP KEY';$appsecret = ’UYGULAMA APP SECRET';

$sessionKey = $_REQUEST['fb_sig_session_key'];$fbClient = new FacebookRestClient($appapikey, $appsecret, $sessionKey);

Page 30: Facebook Platform, Genel Kavramlar, iFrame & FQL

FQL

require_once 'facebook.php';

$appapikey = ’UYGULAMA APP KEY';$appsecret = ’UYGULAMA APP SECRET';

$sessionKey = $_REQUEST['fb_sig_session_key'];$fbClient = new FacebookRestClient($appapikey, $appsecret, $sessionKey);

$userid = $_REQUEST['fb_sig_user'];

$fql = "SELECT name, status, is_app_user FROM user WHERE uid= “ . $userid;$userInfo = $fbClient->fql_query($fql);

Page 31: Facebook Platform, Genel Kavramlar, iFrame & FQL

FQL

require_once 'facebook.php';

$appapikey = ’UYGULAMA APP KEY';$appsecret = ’UYGULAMA APP SECRET';

$sessionKey = $_REQUEST['fb_sig_session_key'];$fbClient = new FacebookRestClient($appapikey, $appsecret, $sessionKey);

$userid = $_REQUEST['fb_sig_user'];

$fql = "SELECT name, status, is_app_user FROM user WHERE uid= “ . $userid;$userInfo = $fbClient->fql_query($fql);

// $userInfo[0][‘name’] Kullanicinin tam adi// $userInfo[0][‘status’] Status mesaji// ..

Page 32: Facebook Platform, Genel Kavramlar, iFrame & FQL

Sorular ?

Page 33: Facebook Platform, Genel Kavramlar, iFrame & FQL

Sorular ?

[email protected] Subject: Garage

Page 34: Facebook Platform, Genel Kavramlar, iFrame & FQL

(c) 2009 Facebook, Inc. or its licensors.  "Facebook" is a registered trademark of Facebook, Inc.. All rights reserved. 1.0