SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
FB Developers
Workshop : Facebook JavaScript SDK
@d_danailov
Workshop : FB JavaScript SDK
Dimitar Danailov
Senior Developer at 158ltd.com
dimityr.danailov[at]gmail.com
Github
Founder at VarnaIT
Senior Developer at 158ltd.com
Topics Today
●
●
●
●
●

Introduction
Developers Facebook
Official Facebook SDKs
Third-Party SDKs
JavaScript SDK
Introduction

1. Workstation
2. Facebook JavaScript SDK
Developers Facebook
SDK
Facebook SDK
iOS
Android
JavaScript
● Enables you to use the Like Button and other Social
Plugins on your site.
● Enables you to use Facebook Login to lower the barrier
for people to sign up on your site.
● Makes it easy to call into Facebook's primary API,
called the Graph API.
● Launch Dialogs that let people perform various actions
like sharing stories.
● Facilitates communication when you're building a game
or an app tab on Facebook.
PHP
The Facebook SDK for PHP enables developers to
implement a rich set of server-side functionality for
accessing Facebook's API. This includes access to all of
the features of the Graph API and FQL.
The SDK is typically used to perform operations as an app
administrator, but can also be used to perform operations
on behalf of the current session user. By removing the
need to manage access tokens manually, the SDK greatly
simplifies the process of authentication and authorizing
users for your app.
Third-Party SDKs
●
●
●
●

Flash (ActionScript) By Adobe
Python
Java
C# by Outercurve Foundation with Microsoft
Sponsorship
● Ruby
● Node.js
JavaScript SDK
Load SDK
// Load the SDK asynchronously
(function (d, s, id) {
var js, fjs = d.getElementsByTagName (s)[0];
if (d.getElementById (id)) {
return;
}
js = d.createElement (s);
js.id = id;
js.src = "//connect.facebook.net/en_US/all.
js";
fjs.parentNode .insertBefore (js, fjs);
}(document, 'script', 'facebook-jssdk' ));
FB.Init
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId
: 'YOUR_APP_ID' , // App ID from the app dashboard
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html' , // Channel
file for x-domain comms
status
: true, // Check Facebook Login status
xfbml
: true // Look for social plugins on the page
});
// Additional initialization code such as adding Event
Listeners goes here
};
FB.getLoginStatus
FB.getLoginStatus (function (response) {
if (response.status === 'connected' ) {
// the user is logged in and has authenticated your
// app, and response.authResponse supplies
// the user's ID, a valid access token, a signed
// request, and the time the access token
// and signed request each expire
var uid = response.authResponse .userID;
var accessToken = response.authResponse .accessToken ;
} else if (response.status === 'not_authorized' ) {
// the user is logged in to Facebook,
// but has not authenticated your app
} else {
// the user isn't logged in to Facebook.
}
});
FB.getLoginStatus(2)

{
status : 'connected' ,
authResponse : {
accessToken : '...',
expiresIn : '...',
signedRequest : '...',
userID : '...'
}
}
FB.login
FB.login(function (response) {
if (response.authResponse ) {
console .log('Welcome! Fetching your information.... ' );
FB .api('/me', function (response) {
console .log('Good to see you, ' + response.name + '.');
});
} else {
console .log('User cancelled login or did not fully
authorize.' );
}
});
Facebook Query Language (FQL)
Reference
// FQL query

var query = "SELECT uid FROM page_fan WHERE page_id = ' " +
FacebookPageId + "'" + " AND uid = ' " + uid +"' LIMIT 1";
FB.api('fql', { q: query}, function (response) {
if (response.data.length === 0) {
// Load Fan-gating page
}
});
FB.Event.subscribe
FB.Event.subscribe('edge.create' , function (href, widget) {
alert ('You liked the URL: ' + href);
}
);

FB.Event.subscribe('auth.authResponseChange' , function (response) {
alert('The status of the session is: ' + response.status);
});
FB.Event.subscribe
FB.Event.subscribe('edge.create' , function (href, widget) {
alert ('You liked the URL: ' + href);
}
);

FB.Event.subscribe('auth.authResponseChange' , function (response) {
alert('The status of the session is: ' + response.status);
});
FB.api
var registartionPermission = new Array();
registartionPermission .push('email');
registartionPermission .push('user_birthday' );
registartionPermission .push('user_likes' );
registartionPermission .push('publish_actions' );
FB.api (2)
FB.api('/me/permissions' , function (response) {
if (response.hasOwnProperty ('data')) {
var permissionCounter = 0;
for (var iterator in registartionPermission ) {
// ...
}
if (permissionCounter === registartionPermission .length) {
//...
}
}
});
FB.api (3)
// Get Facebook database information for user
FB.api('/me', function (response) {
var jsonString = JSON.stringify(response);
$.ajax({
url : server.registeruser ,
data : jsonString ,
type : 'POST',
contentType : 'application/json' ,
dataType : "json",
}).done(function () {
}).fail(function (error) {
});
});
FB.api (4)
// POST Request to Facebook for a new Facebook post message
FB.api('/me/feed' , 'post', {
message : parser.fbtitle,
link: parser.fblink,
picture : parser.fbimage,
name: parser.fbname,
description : parser.fbdescription
}, function (data) {
//console.log(data); - Preview Error message
});
Questions ?
Dimitar Danailov
Senior Developer at 158ltd.com
dimityr.danailov[at]gmail.com
Github
Founder at VarnaIT
Senior Developer at 158ltd.com

Weitere ähnliche Inhalte

Was ist angesagt?

MozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMat Clayton
 
Social Design - ProSEO
Social Design - ProSEOSocial Design - ProSEO
Social Design - ProSEOMat Clayton
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentAizat Faiz
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introductionh_marvin
 
Introduction to Social Networking Sites and websites
Introduction to Social Networking Sites and websitesIntroduction to Social Networking Sites and websites
Introduction to Social Networking Sites and websitesShruti Arya
 
Facebook Platform - Tech
Facebook Platform - TechFacebook Platform - Tech
Facebook Platform - TechDavid Zhuang
 
Facebook Open Graph Tech Requirements
Facebook Open Graph Tech RequirementsFacebook Open Graph Tech Requirements
Facebook Open Graph Tech RequirementsAffinitive
 
App Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and AppApp Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and AppJuan Gomez
 
Facebook Apps: Ein Entwicklungsleitfaden - WMMRN
Facebook Apps: Ein Entwicklungsleitfaden - WMMRNFacebook Apps: Ein Entwicklungsleitfaden - WMMRN
Facebook Apps: Ein Entwicklungsleitfaden - WMMRNStephan Hochdörfer
 
Facebook Connect Tutorial
Facebook Connect TutorialFacebook Connect Tutorial
Facebook Connect TutorialPrateek Dayal
 
Advanced Structured Data: Beyond Rich Snippets
Advanced Structured Data: Beyond Rich SnippetsAdvanced Structured Data: Beyond Rich Snippets
Advanced Structured Data: Beyond Rich SnippetsJustin Briggs
 
iOS & Android App Indexing & App Actions
iOS & Android App Indexing & App ActionsiOS & Android App Indexing & App Actions
iOS & Android App Indexing & App ActionsJustin Briggs
 
An Introduction To The Use Of Widgets in libraries
An Introduction To The Use Of Widgets in librariesAn Introduction To The Use Of Widgets in libraries
An Introduction To The Use Of Widgets in librariesAaron Tay
 
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015Suzzicks
 
Building an interactive timeline from facebook photos
Building an interactive timeline from facebook photosBuilding an interactive timeline from facebook photos
Building an interactive timeline from facebook photosRakesh Rajan
 
How to Setup App Indexation
How to Setup App IndexationHow to Setup App Indexation
How to Setup App IndexationJustin Briggs
 

Was ist angesagt? (20)

Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
 
Hi5 Open Social
Hi5   Open SocialHi5   Open Social
Hi5 Open Social
 
MozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social Design
 
Social Design - ProSEO
Social Design - ProSEOSocial Design - ProSEO
Social Design - ProSEO
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin Development
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introduction
 
Introduction to Social Networking Sites and websites
Introduction to Social Networking Sites and websitesIntroduction to Social Networking Sites and websites
Introduction to Social Networking Sites and websites
 
Facebook Platform - Tech
Facebook Platform - TechFacebook Platform - Tech
Facebook Platform - Tech
 
Facebook Open Graph Tech Requirements
Facebook Open Graph Tech RequirementsFacebook Open Graph Tech Requirements
Facebook Open Graph Tech Requirements
 
The social media developer
The social media developer The social media developer
The social media developer
 
App Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and AppApp Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and App
 
Facebook + Ruby
Facebook + RubyFacebook + Ruby
Facebook + Ruby
 
Facebook Apps: Ein Entwicklungsleitfaden - WMMRN
Facebook Apps: Ein Entwicklungsleitfaden - WMMRNFacebook Apps: Ein Entwicklungsleitfaden - WMMRN
Facebook Apps: Ein Entwicklungsleitfaden - WMMRN
 
Facebook Connect Tutorial
Facebook Connect TutorialFacebook Connect Tutorial
Facebook Connect Tutorial
 
Advanced Structured Data: Beyond Rich Snippets
Advanced Structured Data: Beyond Rich SnippetsAdvanced Structured Data: Beyond Rich Snippets
Advanced Structured Data: Beyond Rich Snippets
 
iOS & Android App Indexing & App Actions
iOS & Android App Indexing & App ActionsiOS & Android App Indexing & App Actions
iOS & Android App Indexing & App Actions
 
An Introduction To The Use Of Widgets in libraries
An Introduction To The Use Of Widgets in librariesAn Introduction To The Use Of Widgets in libraries
An Introduction To The Use Of Widgets in libraries
 
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
 
Building an interactive timeline from facebook photos
Building an interactive timeline from facebook photosBuilding an interactive timeline from facebook photos
Building an interactive timeline from facebook photos
 
How to Setup App Indexation
How to Setup App IndexationHow to Setup App Indexation
How to Setup App Indexation
 

Andere mochten auch

Happy facebook developer
Happy facebook developerHappy facebook developer
Happy facebook developerYu-Wei Chuang
 
Making Facebook Faster
Making Facebook FasterMaking Facebook Faster
Making Facebook Fasterguest1240e7c
 
Facebook App Development
Facebook App DevelopmentFacebook App Development
Facebook App DevelopmentCristiano Betta
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend FrameworkBrett Harris
 
Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk Yi-Fan Chu
 
Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Yi-Fan Chu
 
RDS_Photoscan_Eval_Cloud
RDS_Photoscan_Eval_CloudRDS_Photoscan_Eval_Cloud
RDS_Photoscan_Eval_CloudRaminder Singh
 
Introduction To Facebook: Opportunities and Challenges For The Institution
Introduction To Facebook: Opportunities and Challenges For The InstitutionIntroduction To Facebook: Opportunities and Challenges For The Institution
Introduction To Facebook: Opportunities and Challenges For The Institutionlisbk
 
Python games
Python gamesPython games
Python gamesdxbeeh
 
Facebook Development for Beginners
Facebook Development for BeginnersFacebook Development for Beginners
Facebook Development for BeginnersJesse Stay
 
introduction to server-side scripting
introduction to server-side scriptingintroduction to server-side scripting
introduction to server-side scriptingAmirul Shafeeq
 
Introduction to Facebook Python API
Introduction to Facebook Python APIIntroduction to Facebook Python API
Introduction to Facebook Python APIColin Su
 
Server and Client side comparision
Server and Client side comparisionServer and Client side comparision
Server and Client side comparisionStew Duncan
 
Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Abhishek Mishra
 
Facebook Python SDK - Introduction
Facebook Python SDK - IntroductionFacebook Python SDK - Introduction
Facebook Python SDK - IntroductionColin Su
 
Facebook essay ideas
Facebook essay ideasFacebook essay ideas
Facebook essay ideasLisa Shaw
 
Scripting languages
Scripting languagesScripting languages
Scripting languagesteach4uin
 

Andere mochten auch (20)

Happy facebook developer
Happy facebook developerHappy facebook developer
Happy facebook developer
 
Making Facebook Faster
Making Facebook FasterMaking Facebook Faster
Making Facebook Faster
 
Facebook App Development
Facebook App DevelopmentFacebook App Development
Facebook App Development
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend Framework
 
Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk
 
Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk
 
RDS_Photoscan_Eval_Cloud
RDS_Photoscan_Eval_CloudRDS_Photoscan_Eval_Cloud
RDS_Photoscan_Eval_Cloud
 
Introduction To Facebook: Opportunities and Challenges For The Institution
Introduction To Facebook: Opportunities and Challenges For The InstitutionIntroduction To Facebook: Opportunities and Challenges For The Institution
Introduction To Facebook: Opportunities and Challenges For The Institution
 
Python games
Python gamesPython games
Python games
 
Facebook Development for Beginners
Facebook Development for BeginnersFacebook Development for Beginners
Facebook Development for Beginners
 
introduction to server-side scripting
introduction to server-side scriptingintroduction to server-side scripting
introduction to server-side scripting
 
Introduction to Facebook Python API
Introduction to Facebook Python APIIntroduction to Facebook Python API
Introduction to Facebook Python API
 
Server and Client side comparision
Server and Client side comparisionServer and Client side comparision
Server and Client side comparision
 
Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1
 
Website vs web app
Website vs web appWebsite vs web app
Website vs web app
 
Facebook Python SDK - Introduction
Facebook Python SDK - IntroductionFacebook Python SDK - Introduction
Facebook Python SDK - Introduction
 
Mobile app Vs Web App
Mobile app Vs Web AppMobile app Vs Web App
Mobile app Vs Web App
 
Client & server side scripting
Client & server side scriptingClient & server side scripting
Client & server side scripting
 
Facebook essay ideas
Facebook essay ideasFacebook essay ideas
Facebook essay ideas
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 

Ähnlich wie Workshop : Facebook JavaScript SDK

Foundational Facebook Marketing
Foundational Facebook MarketingFoundational Facebook Marketing
Foundational Facebook MarketingBlitzMetrics
 
Facebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmFacebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmStephan Hochdörfer
 
Facebook api
Facebook api Facebook api
Facebook api snipermkd
 
Facebook API
Facebook APIFacebook API
Facebook APIsnipermkd
 
Introduction to facebook platform
Introduction to facebook platformIntroduction to facebook platform
Introduction to facebook platformVenkatesh Narayanan
 
Facebook api além de meros usuários
Facebook api além de meros usuáriosFacebook api além de meros usuários
Facebook api além de meros usuáriosAécio Costa
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)Roger Kitain
 
funP 開發者俱樂部 十月份聚會
funP 開發者俱樂部 十月份聚會funP 開發者俱樂部 十月份聚會
funP 開發者俱樂部 十月份聚會tutchiio
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidAlberto Ruibal
 
Traxo Presentation - Facebook Garage Dallas 09
Traxo Presentation - Facebook Garage Dallas 09Traxo Presentation - Facebook Garage Dallas 09
Traxo Presentation - Facebook Garage Dallas 09Chris Stevens
 
Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon PresentationLou Moore
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 
Developing advanced universal apps using html & js
Developing advanced universal apps using html & jsDeveloping advanced universal apps using html & js
Developing advanced universal apps using html & jsSenthamil Selvan
 
funP 麻吉 開發者俱樂部十月份聚會
funP 麻吉 開發者俱樂部十月份聚會funP 麻吉 開發者俱樂部十月份聚會
funP 麻吉 開發者俱樂部十月份聚會Nathan Chiu
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsDavid Keener
 

Ähnlich wie Workshop : Facebook JavaScript SDK (20)

Graph api
Graph apiGraph api
Graph api
 
Foundational Facebook Marketing
Foundational Facebook MarketingFoundational Facebook Marketing
Foundational Facebook Marketing
 
Facebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmFacebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffm
 
Facebook api
Facebook api Facebook api
Facebook api
 
Facebook API
Facebook APIFacebook API
Facebook API
 
Developing Facebook Application
Developing Facebook ApplicationDeveloping Facebook Application
Developing Facebook Application
 
Introduction to facebook platform
Introduction to facebook platformIntroduction to facebook platform
Introduction to facebook platform
 
Facebook api além de meros usuários
Facebook api além de meros usuáriosFacebook api além de meros usuários
Facebook api além de meros usuários
 
Facebook Platform
Facebook PlatformFacebook Platform
Facebook Platform
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)
 
funP 開發者俱樂部 十月份聚會
funP 開發者俱樂部 十月份聚會funP 開發者俱樂部 十月份聚會
funP 開發者俱樂部 十月份聚會
 
Facebook api
Facebook apiFacebook api
Facebook api
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 
Traxo Presentation - Facebook Garage Dallas 09
Traxo Presentation - Facebook Garage Dallas 09Traxo Presentation - Facebook Garage Dallas 09
Traxo Presentation - Facebook Garage Dallas 09
 
Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon Presentation
 
Creating a Facebook App
Creating a Facebook AppCreating a Facebook App
Creating a Facebook App
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]
 
Developing advanced universal apps using html & js
Developing advanced universal apps using html & jsDeveloping advanced universal apps using html & js
Developing advanced universal apps using html & js
 
funP 麻吉 開發者俱樂部十月份聚會
funP 麻吉 開發者俱樂部十月份聚會funP 麻吉 開發者俱樂部十月份聚會
funP 麻吉 開發者俱樂部十月份聚會
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook Apps
 

Mehr von Dimitar Danailov

Evolution - ReConnect() 2019
Evolution - ReConnect() 2019Evolution - ReConnect() 2019
Evolution - ReConnect() 2019Dimitar Danailov
 
Data Visualization and D3Js
Data Visualization and D3JsData Visualization and D3Js
Data Visualization and D3JsDimitar Danailov
 
#Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03} #Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03} Dimitar Danailov
 
#Productivity - {S:01 Ep:02}
#Productivity - {S:01 Ep:02}#Productivity - {S:01 Ep:02}
#Productivity - {S:01 Ep:02}Dimitar Danailov
 
Cloud Conf Varna - Cloud Application with AWS Lambda functions
Cloud Conf Varna - Cloud Application with AWS Lambda functionsCloud Conf Varna - Cloud Application with AWS Lambda functions
Cloud Conf Varna - Cloud Application with AWS Lambda functionsDimitar Danailov
 
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)Dimitar Danailov
 
Building modern Progressive Web Apps with Polymer
Building modern Progressive Web Apps with PolymerBuilding modern Progressive Web Apps with Polymer
Building modern Progressive Web Apps with PolymerDimitar Danailov
 
Typescript - MentorMate Academy
Typescript - MentorMate AcademyTypescript - MentorMate Academy
Typescript - MentorMate AcademyDimitar Danailov
 
HackConf2016 - Ruby on Rails: Unexpected journey
HackConf2016 - Ruby on Rails: Unexpected journeyHackConf2016 - Ruby on Rails: Unexpected journey
HackConf2016 - Ruby on Rails: Unexpected journeyDimitar Danailov
 
Microservices - Code Voyagers Sofia
Microservices - Code Voyagers SofiaMicroservices - Code Voyagers Sofia
Microservices - Code Voyagers SofiaDimitar Danailov
 
Mongo DB Terms - Mentormate Academy
Mongo DB Terms - Mentormate AcademyMongo DB Terms - Mentormate Academy
Mongo DB Terms - Mentormate AcademyDimitar Danailov
 
Startup Europe Week - Cloud Conf Varna & GDG Varna
Startup Europe Week - Cloud Conf Varna & GDG VarnaStartup Europe Week - Cloud Conf Varna & GDG Varna
Startup Europe Week - Cloud Conf Varna & GDG VarnaDimitar Danailov
 
MicroServices: Advantages ans Disadvantages
MicroServices: Advantages ans DisadvantagesMicroServices: Advantages ans Disadvantages
MicroServices: Advantages ans DisadvantagesDimitar Danailov
 
Softuni.bg - Microservices
Softuni.bg - MicroservicesSoftuni.bg - Microservices
Softuni.bg - MicroservicesDimitar Danailov
 
Cloud Conf Varna: Vagrant and Amazon
Cloud Conf Varna: Vagrant and AmazonCloud Conf Varna: Vagrant and Amazon
Cloud Conf Varna: Vagrant and AmazonDimitar Danailov
 
HackConf2015 - Ruby on Rails: Unexpected journey
HackConf2015 - Ruby on Rails: Unexpected journeyHackConf2015 - Ruby on Rails: Unexpected journey
HackConf2015 - Ruby on Rails: Unexpected journeyDimitar Danailov
 

Mehr von Dimitar Danailov (20)

Evolution - ReConnect() 2019
Evolution - ReConnect() 2019Evolution - ReConnect() 2019
Evolution - ReConnect() 2019
 
Data Visualization and D3Js
Data Visualization and D3JsData Visualization and D3Js
Data Visualization and D3Js
 
#Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03} #Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03}
 
#Productivity - {S:01 Ep:02}
#Productivity - {S:01 Ep:02}#Productivity - {S:01 Ep:02}
#Productivity - {S:01 Ep:02}
 
#Productivity s01 ep02
#Productivity s01 ep02#Productivity s01 ep02
#Productivity s01 ep02
 
#Productivity s01 ep01
#Productivity s01 ep01#Productivity s01 ep01
#Productivity s01 ep01
 
Cloud Conf Varna - Cloud Application with AWS Lambda functions
Cloud Conf Varna - Cloud Application with AWS Lambda functionsCloud Conf Varna - Cloud Application with AWS Lambda functions
Cloud Conf Varna - Cloud Application with AWS Lambda functions
 
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
 
Building modern Progressive Web Apps with Polymer
Building modern Progressive Web Apps with PolymerBuilding modern Progressive Web Apps with Polymer
Building modern Progressive Web Apps with Polymer
 
Typescript - MentorMate Academy
Typescript - MentorMate AcademyTypescript - MentorMate Academy
Typescript - MentorMate Academy
 
HackConf2016 - Ruby on Rails: Unexpected journey
HackConf2016 - Ruby on Rails: Unexpected journeyHackConf2016 - Ruby on Rails: Unexpected journey
HackConf2016 - Ruby on Rails: Unexpected journey
 
Microservices - Code Voyagers Sofia
Microservices - Code Voyagers SofiaMicroservices - Code Voyagers Sofia
Microservices - Code Voyagers Sofia
 
Mongo DB Terms - Mentormate Academy
Mongo DB Terms - Mentormate AcademyMongo DB Terms - Mentormate Academy
Mongo DB Terms - Mentormate Academy
 
Startup Europe Week - Cloud Conf Varna & GDG Varna
Startup Europe Week - Cloud Conf Varna & GDG VarnaStartup Europe Week - Cloud Conf Varna & GDG Varna
Startup Europe Week - Cloud Conf Varna & GDG Varna
 
GDG Varna - Hadoop
GDG Varna - HadoopGDG Varna - Hadoop
GDG Varna - Hadoop
 
MicroServices: Advantages ans Disadvantages
MicroServices: Advantages ans DisadvantagesMicroServices: Advantages ans Disadvantages
MicroServices: Advantages ans Disadvantages
 
GDG Varna - EcmaScript 6
GDG Varna - EcmaScript 6GDG Varna - EcmaScript 6
GDG Varna - EcmaScript 6
 
Softuni.bg - Microservices
Softuni.bg - MicroservicesSoftuni.bg - Microservices
Softuni.bg - Microservices
 
Cloud Conf Varna: Vagrant and Amazon
Cloud Conf Varna: Vagrant and AmazonCloud Conf Varna: Vagrant and Amazon
Cloud Conf Varna: Vagrant and Amazon
 
HackConf2015 - Ruby on Rails: Unexpected journey
HackConf2015 - Ruby on Rails: Unexpected journeyHackConf2015 - Ruby on Rails: Unexpected journey
HackConf2015 - Ruby on Rails: Unexpected journey
 

Kürzlich hochgeladen

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Kürzlich hochgeladen (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

Workshop : Facebook JavaScript SDK

  • 1. FB Developers Workshop : Facebook JavaScript SDK @d_danailov
  • 2. Workshop : FB JavaScript SDK Dimitar Danailov Senior Developer at 158ltd.com dimityr.danailov[at]gmail.com Github Founder at VarnaIT Senior Developer at 158ltd.com
  • 6.
  • 7.
  • 8. SDK
  • 10. iOS
  • 11.
  • 13.
  • 14. JavaScript ● Enables you to use the Like Button and other Social Plugins on your site. ● Enables you to use Facebook Login to lower the barrier for people to sign up on your site. ● Makes it easy to call into Facebook's primary API, called the Graph API. ● Launch Dialogs that let people perform various actions like sharing stories. ● Facilitates communication when you're building a game or an app tab on Facebook.
  • 15. PHP The Facebook SDK for PHP enables developers to implement a rich set of server-side functionality for accessing Facebook's API. This includes access to all of the features of the Graph API and FQL. The SDK is typically used to perform operations as an app administrator, but can also be used to perform operations on behalf of the current session user. By removing the need to manage access tokens manually, the SDK greatly simplifies the process of authentication and authorizing users for your app.
  • 16. Third-Party SDKs ● ● ● ● Flash (ActionScript) By Adobe Python Java C# by Outercurve Foundation with Microsoft Sponsorship ● Ruby ● Node.js
  • 18. Load SDK // Load the SDK asynchronously (function (d, s, id) { var js, fjs = d.getElementsByTagName (s)[0]; if (d.getElementById (id)) { return; } js = d.createElement (s); js.id = id; js.src = "//connect.facebook.net/en_US/all. js"; fjs.parentNode .insertBefore (js, fjs); }(document, 'script', 'facebook-jssdk' ));
  • 19. FB.Init window.fbAsyncInit = function() { // init the FB JS SDK FB.init({ appId : 'YOUR_APP_ID' , // App ID from the app dashboard channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html' , // Channel file for x-domain comms status : true, // Check Facebook Login status xfbml : true // Look for social plugins on the page }); // Additional initialization code such as adding Event Listeners goes here };
  • 20. FB.getLoginStatus FB.getLoginStatus (function (response) { if (response.status === 'connected' ) { // the user is logged in and has authenticated your // app, and response.authResponse supplies // the user's ID, a valid access token, a signed // request, and the time the access token // and signed request each expire var uid = response.authResponse .userID; var accessToken = response.authResponse .accessToken ; } else if (response.status === 'not_authorized' ) { // the user is logged in to Facebook, // but has not authenticated your app } else { // the user isn't logged in to Facebook. } });
  • 21. FB.getLoginStatus(2) { status : 'connected' , authResponse : { accessToken : '...', expiresIn : '...', signedRequest : '...', userID : '...' } }
  • 22. FB.login FB.login(function (response) { if (response.authResponse ) { console .log('Welcome! Fetching your information.... ' ); FB .api('/me', function (response) { console .log('Good to see you, ' + response.name + '.'); }); } else { console .log('User cancelled login or did not fully authorize.' ); } });
  • 23. Facebook Query Language (FQL) Reference // FQL query var query = "SELECT uid FROM page_fan WHERE page_id = ' " + FacebookPageId + "'" + " AND uid = ' " + uid +"' LIMIT 1"; FB.api('fql', { q: query}, function (response) { if (response.data.length === 0) { // Load Fan-gating page } });
  • 24. FB.Event.subscribe FB.Event.subscribe('edge.create' , function (href, widget) { alert ('You liked the URL: ' + href); } ); FB.Event.subscribe('auth.authResponseChange' , function (response) { alert('The status of the session is: ' + response.status); });
  • 25. FB.Event.subscribe FB.Event.subscribe('edge.create' , function (href, widget) { alert ('You liked the URL: ' + href); } ); FB.Event.subscribe('auth.authResponseChange' , function (response) { alert('The status of the session is: ' + response.status); });
  • 26. FB.api var registartionPermission = new Array(); registartionPermission .push('email'); registartionPermission .push('user_birthday' ); registartionPermission .push('user_likes' ); registartionPermission .push('publish_actions' );
  • 27. FB.api (2) FB.api('/me/permissions' , function (response) { if (response.hasOwnProperty ('data')) { var permissionCounter = 0; for (var iterator in registartionPermission ) { // ... } if (permissionCounter === registartionPermission .length) { //... } } });
  • 28. FB.api (3) // Get Facebook database information for user FB.api('/me', function (response) { var jsonString = JSON.stringify(response); $.ajax({ url : server.registeruser , data : jsonString , type : 'POST', contentType : 'application/json' , dataType : "json", }).done(function () { }).fail(function (error) { }); });
  • 29. FB.api (4) // POST Request to Facebook for a new Facebook post message FB.api('/me/feed' , 'post', { message : parser.fbtitle, link: parser.fblink, picture : parser.fbimage, name: parser.fbname, description : parser.fbdescription }, function (data) { //console.log(data); - Preview Error message });
  • 30. Questions ? Dimitar Danailov Senior Developer at 158ltd.com dimityr.danailov[at]gmail.com Github Founder at VarnaIT Senior Developer at 158ltd.com