SlideShare a Scribd company logo
1 of 42
Building Facebook Apps
                 using PHP

                                 Trinh Van Thanh
                                        Facebook App Leader
                                               Japan Division
                                  SETA International Vietnam



1         We Know Business, We Know Technology, We Are Global
ABOUT ME                                         ABOUT US
       TRINH VAN THANH                               Software Outsourcing
       Facebook App Development Leader               150 developers in
       @SETA International LLC since 2010             Hanoi, VN
       A Facebook Lover. Facebook 24/7              Market: US, Japan
       1000 hours developing Facebook Apps           2nd Join PHP Day as
       20 Facebook Apps built                         Sponsor and Presentor
       Top 3 Facebook App in Japan                   http://www.seta-
       Contact: thanhtv6075@setacinq.com.vn           international.co.jp/
       Gmail: tvthanhdl@gmail.com
       Facebook:
        http://www.facebook.com/tvthanhdl




2                               We Know Business, We Know Technology, We Are Global
AGENDA
      WHY FACEBOOK
      BUILDING FACEBOOK APPS USING PHP
      DEMO




3                 We Know Business, We Know Technology, We Are Global
WHY FACEBOOK
4        We Know Business, We Know Technology, We Are Global
FACEBOOK IS HUGE ECO




    Source: The perfect Startup, Fabemovel

5                                            We Know Business, We Know Technology, We Are Global
PERFECT SCALING –VERY STABLE PLATFORM (NOW)




    Source: The perfect Startup, Fabemovel

6                                            We Know Business, We Know Technology, We Are Global
Social media on Facebook




          The Viral Loop




Source: The perfect Startup, Fabemovel



  7                                      We Know Business, We Know Technology, We Are Global
Facebook’s platform is built on three main tools




Source: The perfect Startup, Fabemovel

8                                             We Know Business, We Know Technology, We Are Global
BUILDING FACEBOOK
APPS BY PHP
9          We Know Business, We Know Technology, We Are Global
Facebook apps?


     • Apps on Facebook.com
        – Canvas app
        – Page tab
        – Mobile web




10                     We Know Business, We Know Technology, We Are Global
Canvas Apps


     • It is just the “home” page of the application where the
       app is described to those who might want to use it.
     • Example: http://apps.facebook.com/monipla/




11                    We Know Business, We Know Technology, We Are Global
Canvas Apps




     760px(default)


                                               Advertising
                                              CPM and CPC


12      We Know Business, We Know Technology, We Are Global
Page Tab


     • Facebook page: are a heavily used feature of Facebook. Major
        brands, celebrities, etc. use Facebook Pages as their "social
        home" on the web. One of the most interesting features of Apps
        on Facebook.com is the ability for your app to be used within the
        context of a Facebook Page.
     Example:
         -   YouTube
         -   Nhật Ký
         -   SETA:CINQ Vietnam, Ltd
         -   PHPDay2012
         -   Pargolfonline
         -   …
     • Page tab are apps on Facebook Page.


13                          We Know Business, We Know Technology, We Are Global
Page Tab




     810px(max)
                                            advertising



14   We Know Business, We Know Technology, We Are Global
Page Tab




     520px(default)




15   We Know Business, We Know Technology, We Are Global
Mobile Web




 Source: socialbakers

16                      We Know Business, We Know Technology, We Are Global
Mobile Web

     • Mobile web apps are built using web
       technologies including HTML5, Javascript and
       CSS. You can build once and deploy
       everywhere, including on iPhone, iPad and
       Android.
        - Hummerbinbyun




17                We Know Business, We Know Technology, We Are Global
Mobile Web




18   We Know Business, We Know Technology, We Are Global
Open Graph




     •   Social network
     •   Social media

     •   Open graph 1.0 -> Like action only
     •   Open graph 2.0 -> customize actions




19                            We Know Business, We Know Technology, We Are Global
Open Graph 1.0




20   We Know Business, We Know Technology, We Are Global
Open Graph 2.0




21   We Know Business, We Know Technology, We Are Global
Build apps use PHP SDK with Graph API
                                             (Becoming a Facebook Developer)


     •   Requires
     •   Resources
     •   How to build facebook app




22                    We Know Business, We Know Technology, We Are Global
Requires

     •   PHP (Support PHP, JS, IOS, Android SDK)
     •   JS
     •   HTML (HTML5 with mobile web)
     •   CSS (CSS3 with mobile web)
     •   MySQL (optional)




23                      We Know Business, We Know Technology, We Are Global
Resources

     • Tools - https://developers.facebook.com/tools/
     • Bugs - https://developers.facebook.com/bugs
     • Developer Application -
       https://developers.facebook.com/apps
     • Developer Blog - https://developers.facebook.com/blog/
     • Developer Roadmap -
       https://developers.facebook.com/roadmap/
     • Document - https://developers.facebook.com/docs/
     • PHP SDK - https://github.com/facebook/facebook-php-sdk




24                  We Know Business, We Know Technology, We Are Global
Create a Facebook App
                                                                        (Create)

     • Start by visiting the Developer App. If you haven't created an
       application before you will be prompted to add the Developer
       Application.




25                       We Know Business, We Know Technology, We Are Global
Create a Facebook App
                                                   (Configuring Canvas apps)




                                                       Enable auth on
                                                     domain & subdomain
Only app developer
will be able to use
        app
                                                        Required if check
                                                          permission




                                                   Default: 760px
                                                    Fluid: 100%


26                    We Know Business, We Know Technology, We Are Global
Code example
                                                               (use PHP SDK)


     • Installing and Initializing




27                      We Know Business, We Know Technology, We Are Global
Code example
                                                                (Graph API)



     •   Use static: Facebook::api(/* polymorphic */);
     •   Use object: $facebook->api(/* polymorphic */);

     •   /* polymorphic */:= {$path, $method, $params}




28                     We Know Business, We Know Technology, We Are Global
Code example
                                              (Graph API)




29   We Know Business, We Know Technology, We Are Global
Code example
                                                              (Graph API)




     • Function fbRedirect():




30                   We Know Business, We Know Technology, We Are Global
Code example
                                                           (Post Status)




     • Permission: publish_stream

     $facebook->api('/me/feed', 'POST',
        array(
         'link' => 'www.yourdomain.com',
         'message' => 'Posting with the PHP SDK! on
        http://yourdomain.com'
        ));




31                 We Know Business, We Know Technology, We Are Global
Code example
                                                                  (Post Photo)


     •   Permissions: publish_stream, photo_upload

     //Required set to upload photo
        $facebook->setFileUploadSupport( true );

     $photo = 'path-to-photo'; //required in host login to apps
     $message = 'Photo upload via the PHP SDK! on
        http://yourdomain.com';
     $facebook->api('/me/photos', 'POST', array(
                         'source' => '@' . $photo,
                         'message' => $message,
                 ));



32                     We Know Business, We Know Technology, We Are Global
Code example
                                                               (count LIKE of an url)


     $link = 'LINK_TO_COUNT';
     $likes = $facebook->api(array(
           'query' => 'SELECT share_count, like_count, comment_count,
           total_count FROM link_stat WHERE url IN("' . $link . '")',
          'method' => 'fql.query')
     );




33                        We Know Business, We Know Technology, We Are Global
Create a Facebook App
                                                            (Configuring Page tab)


     • You can find these settings in the "Basic" section of your app's
       settings in the Developer App under 'Select how your app
       integrates with Facebook'. Click 'Page Tab' to expand the Page Tab
       settings, and the Page Tab fields will appear


                                                     The user-facing title
                                                      of your Page app



                                                         URL to load content
                                                             to page tab



                                                        Icon of page tab

34                       We Know Business, We Know Technology, We Are Global
Create a Facebook App
                                                         (Adding an App to Page)

     •   The Add Page Tab Dialog prompts the user to add an app to a
         Facebook Page that the user admins. This does not require any
         extended permissions.
     •   Request URL: https://www.facebook.com/dialog/pagetab?
         app_id=YOUR_APP_ID &display=popup&next=YOUR_URL




35                     We Know Business, We Know Technology, We Are Global
Code example
                                                            (Page tab: check LIKE page)

     $signedRequest = $facebook->getSignedRequest();
     $isLiked = $signedRequest["page"]["liked"];

     if( $isLiked ){
                //load visible contents to page tab
     }else{
                //load invisible contents to page tab
                //Show message “click like button to app”
     }




36                        We Know Business, We Know Technology, We Are Global
Combined with JS SDK
                                                                 (loading js)
     •   Add to body:




37                      We Know Business, We Know Technology, We Are Global
Combined with JS SDK
                                                                    (loading js)


     •   FB.Canvas.setAutoGrow(timeout);
     •   FB.Canvas.setSize();
     •   FB.Canvas.scrollTo();




38                         We Know Business, We Know Technology, We Are Global
Facebook for Websites
                                                           (social plugins)

     • Like
     • Share
     • Comment

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




39                    We Know Business, We Know Technology, We Are Global
DEMO
40     We Know Business, We Know Technology, We Are Global
DISCUSSION

41           We Know Business, We Know Technology, We Are Global
THANK YOU
     Please contact me to receive sample code




                                            http://www.facebook.com/setacinq


42                              We Know Business, We Know Technology, We Are Global

More Related Content

Similar to Build Facebook Apps using PHP

How to Build a Nonprofit Mobile App To Engage Supporters
How to Build a Nonprofit Mobile App To Engage SupportersHow to Build a Nonprofit Mobile App To Engage Supporters
How to Build a Nonprofit Mobile App To Engage SupportersTechSoup
 
Insights on Android App Development, Marketing and Monetization
Insights on Android App Development, Marketing and MonetizationInsights on Android App Development, Marketing and Monetization
Insights on Android App Development, Marketing and MonetizationJayneel Patel
 
Appsplash'16 session(1) "Introduction to mobile application"
Appsplash'16 session(1) "Introduction to mobile application"Appsplash'16 session(1) "Introduction to mobile application"
Appsplash'16 session(1) "Introduction to mobile application"Hany Halim
 
Ibm worklight - going from xpages mobile to native mobile applications
Ibm worklight - going from xpages mobile to native mobile applicationsIbm worklight - going from xpages mobile to native mobile applications
Ibm worklight - going from xpages mobile to native mobile applicationsMark Roden
 
Mobile Apps - Where's the beef
Mobile Apps - Where's the beefMobile Apps - Where's the beef
Mobile Apps - Where's the beefcompuccino
 
Intro to tech stacks bonny
Intro to tech stacks bonnyIntro to tech stacks bonny
Intro to tech stacks bonnyLama K Banna
 
Getting The Vibe from Facebook Application
Getting The Vibe from Facebook ApplicationGetting The Vibe from Facebook Application
Getting The Vibe from Facebook ApplicationSartika Kurniali
 
Anubavam Technologies I Phone Offerings
Anubavam Technologies I Phone OfferingsAnubavam Technologies I Phone Offerings
Anubavam Technologies I Phone OfferingsSandeep Mohan
 
RockYou at Girls in Tech Developer Forum
RockYou at Girls in Tech Developer ForumRockYou at Girls in Tech Developer Forum
RockYou at Girls in Tech Developer Forumthemix
 
Building Mobile Apps on aPaaS platforms
Building Mobile Apps on aPaaS platformsBuilding Mobile Apps on aPaaS platforms
Building Mobile Apps on aPaaS platformsDr Ganesh Iyer
 
Deep linking at App Promotion Summit
Deep linking at App Promotion SummitDeep linking at App Promotion Summit
Deep linking at App Promotion SummitAlexandre Jubien
 
Daffodil iOS App Development Portfolio
Daffodil iOS App Development PortfolioDaffodil iOS App Development Portfolio
Daffodil iOS App Development PortfolioAshok Surendran
 
Zemoga Capabilities Presentation
Zemoga Capabilities PresentationZemoga Capabilities Presentation
Zemoga Capabilities PresentationSven Larsen
 
Facebook Apps Vs Google Open Social
Facebook Apps Vs Google Open SocialFacebook Apps Vs Google Open Social
Facebook Apps Vs Google Open SocialRachel Vacek
 
Notes from Educator Pre-training Briefing 1 - Summary of AfG-toolset 2012-13
Notes from Educator Pre-training Briefing 1  - Summary of AfG-toolset 2012-13Notes from Educator Pre-training Briefing 1  - Summary of AfG-toolset 2012-13
Notes from Educator Pre-training Briefing 1 - Summary of AfG-toolset 2012-13CDI Apps for Good
 

Similar to Build Facebook Apps using PHP (20)

How to Build a Nonprofit Mobile App To Engage Supporters
How to Build a Nonprofit Mobile App To Engage SupportersHow to Build a Nonprofit Mobile App To Engage Supporters
How to Build a Nonprofit Mobile App To Engage Supporters
 
Insights on Android App Development, Marketing and Monetization
Insights on Android App Development, Marketing and MonetizationInsights on Android App Development, Marketing and Monetization
Insights on Android App Development, Marketing and Monetization
 
Appsplash'16 session(1) "Introduction to mobile application"
Appsplash'16 session(1) "Introduction to mobile application"Appsplash'16 session(1) "Introduction to mobile application"
Appsplash'16 session(1) "Introduction to mobile application"
 
Ibm worklight - going from xpages mobile to native mobile applications
Ibm worklight - going from xpages mobile to native mobile applicationsIbm worklight - going from xpages mobile to native mobile applications
Ibm worklight - going from xpages mobile to native mobile applications
 
Mobile Apps - Where's the beef
Mobile Apps - Where's the beefMobile Apps - Where's the beef
Mobile Apps - Where's the beef
 
W make104
W make104W make104
W make104
 
Intro to tech stacks bonny
Intro to tech stacks bonnyIntro to tech stacks bonny
Intro to tech stacks bonny
 
Getting The Vibe from Facebook Application
Getting The Vibe from Facebook ApplicationGetting The Vibe from Facebook Application
Getting The Vibe from Facebook Application
 
Anubavam Technologies I Phone Offerings
Anubavam Technologies I Phone OfferingsAnubavam Technologies I Phone Offerings
Anubavam Technologies I Phone Offerings
 
RockYou at Girls in Tech Developer Forum
RockYou at Girls in Tech Developer ForumRockYou at Girls in Tech Developer Forum
RockYou at Girls in Tech Developer Forum
 
Company2
Company2Company2
Company2
 
Building Mobile Apps on aPaaS platforms
Building Mobile Apps on aPaaS platformsBuilding Mobile Apps on aPaaS platforms
Building Mobile Apps on aPaaS platforms
 
Deep linking at App Promotion Summit
Deep linking at App Promotion SummitDeep linking at App Promotion Summit
Deep linking at App Promotion Summit
 
Introduction to wp7
Introduction to wp7Introduction to wp7
Introduction to wp7
 
PhoenixGMN All About Apps - Idea to Launch
PhoenixGMN All About Apps - Idea to LaunchPhoenixGMN All About Apps - Idea to Launch
PhoenixGMN All About Apps - Idea to Launch
 
Daffodil iOS App Development Portfolio
Daffodil iOS App Development PortfolioDaffodil iOS App Development Portfolio
Daffodil iOS App Development Portfolio
 
Zemoga Capabilities Presentation
Zemoga Capabilities PresentationZemoga Capabilities Presentation
Zemoga Capabilities Presentation
 
How to Build an Awesome Non-Profit Website
How to Build an Awesome Non-Profit WebsiteHow to Build an Awesome Non-Profit Website
How to Build an Awesome Non-Profit Website
 
Facebook Apps Vs Google Open Social
Facebook Apps Vs Google Open SocialFacebook Apps Vs Google Open Social
Facebook Apps Vs Google Open Social
 
Notes from Educator Pre-training Briefing 1 - Summary of AfG-toolset 2012-13
Notes from Educator Pre-training Briefing 1  - Summary of AfG-toolset 2012-13Notes from Educator Pre-training Briefing 1  - Summary of AfG-toolset 2012-13
Notes from Educator Pre-training Briefing 1 - Summary of AfG-toolset 2012-13
 

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Build Facebook Apps using PHP

  • 1. Building Facebook Apps using PHP Trinh Van Thanh Facebook App Leader Japan Division SETA International Vietnam 1 We Know Business, We Know Technology, We Are Global
  • 2. ABOUT ME ABOUT US  TRINH VAN THANH  Software Outsourcing  Facebook App Development Leader  150 developers in  @SETA International LLC since 2010 Hanoi, VN  A Facebook Lover. Facebook 24/7   Market: US, Japan  1000 hours developing Facebook Apps  2nd Join PHP Day as  20 Facebook Apps built Sponsor and Presentor  Top 3 Facebook App in Japan  http://www.seta-  Contact: thanhtv6075@setacinq.com.vn international.co.jp/  Gmail: tvthanhdl@gmail.com  Facebook: http://www.facebook.com/tvthanhdl 2 We Know Business, We Know Technology, We Are Global
  • 3. AGENDA  WHY FACEBOOK  BUILDING FACEBOOK APPS USING PHP  DEMO 3 We Know Business, We Know Technology, We Are Global
  • 4. WHY FACEBOOK 4 We Know Business, We Know Technology, We Are Global
  • 5. FACEBOOK IS HUGE ECO Source: The perfect Startup, Fabemovel 5 We Know Business, We Know Technology, We Are Global
  • 6. PERFECT SCALING –VERY STABLE PLATFORM (NOW) Source: The perfect Startup, Fabemovel 6 We Know Business, We Know Technology, We Are Global
  • 7. Social media on Facebook The Viral Loop Source: The perfect Startup, Fabemovel 7 We Know Business, We Know Technology, We Are Global
  • 8. Facebook’s platform is built on three main tools Source: The perfect Startup, Fabemovel 8 We Know Business, We Know Technology, We Are Global
  • 9. BUILDING FACEBOOK APPS BY PHP 9 We Know Business, We Know Technology, We Are Global
  • 10. Facebook apps? • Apps on Facebook.com – Canvas app – Page tab – Mobile web 10 We Know Business, We Know Technology, We Are Global
  • 11. Canvas Apps • It is just the “home” page of the application where the app is described to those who might want to use it. • Example: http://apps.facebook.com/monipla/ 11 We Know Business, We Know Technology, We Are Global
  • 12. Canvas Apps 760px(default) Advertising CPM and CPC 12 We Know Business, We Know Technology, We Are Global
  • 13. Page Tab • Facebook page: are a heavily used feature of Facebook. Major brands, celebrities, etc. use Facebook Pages as their "social home" on the web. One of the most interesting features of Apps on Facebook.com is the ability for your app to be used within the context of a Facebook Page. Example: - YouTube - Nhật Ký - SETA:CINQ Vietnam, Ltd - PHPDay2012 - Pargolfonline - … • Page tab are apps on Facebook Page. 13 We Know Business, We Know Technology, We Are Global
  • 14. Page Tab 810px(max) advertising 14 We Know Business, We Know Technology, We Are Global
  • 15. Page Tab 520px(default) 15 We Know Business, We Know Technology, We Are Global
  • 16. Mobile Web Source: socialbakers 16 We Know Business, We Know Technology, We Are Global
  • 17. Mobile Web • Mobile web apps are built using web technologies including HTML5, Javascript and CSS. You can build once and deploy everywhere, including on iPhone, iPad and Android. - Hummerbinbyun 17 We Know Business, We Know Technology, We Are Global
  • 18. Mobile Web 18 We Know Business, We Know Technology, We Are Global
  • 19. Open Graph • Social network • Social media • Open graph 1.0 -> Like action only • Open graph 2.0 -> customize actions 19 We Know Business, We Know Technology, We Are Global
  • 20. Open Graph 1.0 20 We Know Business, We Know Technology, We Are Global
  • 21. Open Graph 2.0 21 We Know Business, We Know Technology, We Are Global
  • 22. Build apps use PHP SDK with Graph API (Becoming a Facebook Developer) • Requires • Resources • How to build facebook app 22 We Know Business, We Know Technology, We Are Global
  • 23. Requires • PHP (Support PHP, JS, IOS, Android SDK) • JS • HTML (HTML5 with mobile web) • CSS (CSS3 with mobile web) • MySQL (optional) 23 We Know Business, We Know Technology, We Are Global
  • 24. Resources • Tools - https://developers.facebook.com/tools/ • Bugs - https://developers.facebook.com/bugs • Developer Application - https://developers.facebook.com/apps • Developer Blog - https://developers.facebook.com/blog/ • Developer Roadmap - https://developers.facebook.com/roadmap/ • Document - https://developers.facebook.com/docs/ • PHP SDK - https://github.com/facebook/facebook-php-sdk 24 We Know Business, We Know Technology, We Are Global
  • 25. Create a Facebook App (Create) • Start by visiting the Developer App. If you haven't created an application before you will be prompted to add the Developer Application. 25 We Know Business, We Know Technology, We Are Global
  • 26. Create a Facebook App (Configuring Canvas apps) Enable auth on domain & subdomain Only app developer will be able to use app Required if check permission Default: 760px Fluid: 100% 26 We Know Business, We Know Technology, We Are Global
  • 27. Code example (use PHP SDK) • Installing and Initializing 27 We Know Business, We Know Technology, We Are Global
  • 28. Code example (Graph API) • Use static: Facebook::api(/* polymorphic */); • Use object: $facebook->api(/* polymorphic */); • /* polymorphic */:= {$path, $method, $params} 28 We Know Business, We Know Technology, We Are Global
  • 29. Code example (Graph API) 29 We Know Business, We Know Technology, We Are Global
  • 30. Code example (Graph API) • Function fbRedirect(): 30 We Know Business, We Know Technology, We Are Global
  • 31. Code example (Post Status) • Permission: publish_stream $facebook->api('/me/feed', 'POST', array( 'link' => 'www.yourdomain.com', 'message' => 'Posting with the PHP SDK! on http://yourdomain.com' )); 31 We Know Business, We Know Technology, We Are Global
  • 32. Code example (Post Photo) • Permissions: publish_stream, photo_upload //Required set to upload photo $facebook->setFileUploadSupport( true ); $photo = 'path-to-photo'; //required in host login to apps $message = 'Photo upload via the PHP SDK! on http://yourdomain.com'; $facebook->api('/me/photos', 'POST', array( 'source' => '@' . $photo, 'message' => $message, )); 32 We Know Business, We Know Technology, We Are Global
  • 33. Code example (count LIKE of an url) $link = 'LINK_TO_COUNT'; $likes = $facebook->api(array( 'query' => 'SELECT share_count, like_count, comment_count, total_count FROM link_stat WHERE url IN("' . $link . '")', 'method' => 'fql.query') ); 33 We Know Business, We Know Technology, We Are Global
  • 34. Create a Facebook App (Configuring Page tab) • You can find these settings in the "Basic" section of your app's settings in the Developer App under 'Select how your app integrates with Facebook'. Click 'Page Tab' to expand the Page Tab settings, and the Page Tab fields will appear The user-facing title of your Page app URL to load content to page tab Icon of page tab 34 We Know Business, We Know Technology, We Are Global
  • 35. Create a Facebook App (Adding an App to Page) • The Add Page Tab Dialog prompts the user to add an app to a Facebook Page that the user admins. This does not require any extended permissions. • Request URL: https://www.facebook.com/dialog/pagetab? app_id=YOUR_APP_ID &display=popup&next=YOUR_URL 35 We Know Business, We Know Technology, We Are Global
  • 36. Code example (Page tab: check LIKE page) $signedRequest = $facebook->getSignedRequest(); $isLiked = $signedRequest["page"]["liked"]; if( $isLiked ){ //load visible contents to page tab }else{ //load invisible contents to page tab //Show message “click like button to app” } 36 We Know Business, We Know Technology, We Are Global
  • 37. Combined with JS SDK (loading js) • Add to body: 37 We Know Business, We Know Technology, We Are Global
  • 38. Combined with JS SDK (loading js) • FB.Canvas.setAutoGrow(timeout); • FB.Canvas.setSize(); • FB.Canvas.scrollTo(); 38 We Know Business, We Know Technology, We Are Global
  • 39. Facebook for Websites (social plugins) • Like • Share • Comment • http://developers.facebook.com/docs/plugins 39 We Know Business, We Know Technology, We Are Global
  • 40. DEMO 40 We Know Business, We Know Technology, We Are Global
  • 41. DISCUSSION 41 We Know Business, We Know Technology, We Are Global
  • 42. THANK YOU Please contact me to receive sample code http://www.facebook.com/setacinq 42 We Know Business, We Know Technology, We Are Global