{"id":72,"date":"2012-08-19T19:41:00","date_gmt":"2012-08-19T19:41:00","guid":{"rendered":"https:\/\/www.tech-and-dev.com\/blog\/2012\/08\/19\/facebook-app-tutorial-the-basics\/"},"modified":"2021-02-22T00:59:47","modified_gmt":"2021-02-22T00:59:47","slug":"facebook-app-tutorial-basics","status":"publish","type":"post","link":"https:\/\/www.tech-and-dev.com\/blog\/2012\/08\/facebook-app-tutorial-basics.html","title":{"rendered":"Facebook App Tutorial &#8211; The Basics"},"content":{"rendered":"<div style=\"text-align: justify;\">Facebook applications gives you the opportunity to deeply integrate into the core Facebook experience. Your app can integrate with many aspects of Facebook.com, including the News Feed, Notifications, open-graph and all of the core Facebook Platform technologies, such as Social Plugins, like the registration plugin, like plugin, login.<\/div>\n<p>&nbsp;<\/p>\n<h4>To create your first facebook application:<\/h4>\n<p>Go to <a href=\"https:\/\/developers.facebook.com\/apps\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/developers.facebook.com\/apps<\/a><br \/>\nClick on &#8220;Go to app&#8221;<\/p>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-GoToApp.png\"><img decoding=\"async\" title=\"Facebook - Go To App\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-GoToApp.png\" alt=\"Facebook Go To App\" border=\"0\" \/><\/a><\/div>\n<p>On the top right side click on &#8220;Create new App&#8221;<\/p>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-create_new_app.png\"><img decoding=\"async\" title=\"Facebook - Create New App\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-create_new_app.png\" alt=\"Facebook Create New App\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">Choose the name of your app, this can be anything.<\/div>\n<div style=\"text-align: justify;\">Choose the namespace of your app, this is a unique name, so it might be already taken.<\/div>\n<div style=\"text-align: justify;\">Uncheck Web Hosting with Huroku. Huroku allows you to host your app on their servers for free. We won&#8217;t be using Heroku for this tutorial. I will write a tutorial in the future on how to use Heroku with facebook apps.<\/div>\n<div style=\"text-align: justify;\">Click &#8220;Continue&#8221;.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-name.png\"><img decoding=\"async\" title=\"Facebook - App Name\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-name.png\" alt=\"Facebook App Name\" border=\"0\" \/><\/a><\/div>\n<p>You might need to verify your facebook account by adding your mobile phone number or credit card.<\/p>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-verify-account.png\"><img decoding=\"async\" title=\"Facebook - Verify App\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-verify-account.png\" alt=\"Facebook Verify App\" border=\"0\" \/><\/a><\/div>\n<p>This is the interface of our new app:<\/p>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-interface.png\"><img decoding=\"async\" title=\"Facebook - App Interface\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-interface.png\" alt=\"Facebook App Interface\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">The most important two things in the new app are the &#8220;App ID&#8221; and the &#8220;App Secret&#8221;. <b>Never share your App Secret with anyone.<\/b><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">Let&#8217;s go to &#8220;Edit Settings&#8221;<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">In &#8220;Edit Settings&#8221;, we can see all the app&#8217;s important info.<\/div>\n<div style=\"text-align: justify;\">If you want your app to be accessed from one or more website, you can define those websites in the &#8220;<b>App Domains<\/b>&#8220;. For this tutorial, I&#8217;m gonna allow the app to be accessed from tech-and-dev.com, which also includes the subdomains of this site.<\/div>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-edit-settings.png\"><img decoding=\"async\" title=\"Facebook - App - Edit Settings\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-edit-settings.png\" alt=\"Facebook App Edit Settings\" border=\"0\" \/><\/a><\/div>\n<p>If you want to use the facebook login button on your website, you will have to set the URL in the &#8220;<b>Website with Facebook Login<\/b>&#8221; section.<\/p>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-website-with-facebook-login.png\"><img decoding=\"async\" title=\"facebook - app - website with facebook login\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-website-with-facebook-login.png\" alt=\"Facebook App Website With Facebook Login\" border=\"0\" \/><\/a><\/div>\n<p>If you want your app to be part of facebook, that is, your app displayed in a facebook canvas, you can set the url of your facebook canvas. (I will explain more about this in my next tutorial)<\/p>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/Facebook-app-canvas.png\"><img decoding=\"async\" title=\"Facebook - App - Canvas\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/Facebook-app-canvas.png\" alt=\"Facebook App Canvas\" border=\"0\" \/><\/a><\/div>\n<p>Let&#8217;s go to the &#8220;Auth Dialog&#8221; and configure it. The &#8220;Auth Dialog&#8221; link is on the left sidebar.<\/p>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-auth-dialog.png\"><img decoding=\"async\" title=\"Facebook - App - Auth Dialog\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-auth-dialog.png\" alt=\"Facebook App Auth Dialog\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">You can check how will the app dialog will appear by clicking on the <b>Preview Current Dialog<\/b>.<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">It&#8217;s very important to set a logo for your application, otherwise later on, when you decide to work with Open Graph, facebook will reject your application.<\/div>\n<div style=\"text-align: justify;\">Adding a privacy policy and terms of service is a facebook requirements now, and any app that does not have a privacy policy or terms of use URL will receive a warning to add one or the application will be banned from facebook.<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">You can google for <i>privacy policy<\/i> and <i>terms &amp; conditions<\/i> if you don&#8217;t have any.<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">A warning will look like the following:<\/div>\n<div style=\"font-family: 'Courier New',Courier,monospace; text-align: justify;\">\n<p><i><b>Notice of Violation: Privacy Policy (App ID: [YOUR_APP_ID])<\/b><\/i><\/p>\n<p>Hi,<\/p>\n<p>We&#8217;ve found the following policy violation with your app and you need to address this issue by [DATE] at [TIME] or your app may be subject to enforcement action.<\/p>\n<p>Our policies require that your app has a privacy policy that tells users what user data you are going to use and how you will use, display, share, or transfer that data and you will include your privacy policy URL in the Developer Application (See Platform Policy II.3, http:\/\/developers.facebook.com\/policy).<\/p>\n<p>It has come to our attention that your app is missing a privacy policy in the permissions dialogue. Please update the privacy policy URL field in the Developer Application at developers.facebook.com\/apps\/[YOUR_APP_ID]\/auth. Also, please review your app to ensure you are also displaying your privacy policy on your web site or within your app.<\/p>\n<p>Thanks,<br \/>\nPlatform Policy Teamen<\/p>\n<\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\">Let&#8217;s add some permissions in the <b>Configure how Facebook refers users to your app<\/b>:<\/div>\n<div style=\"clear: both; text-align: left;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-permissions.png\"><img decoding=\"async\" title=\"Facebook - App - Permissions\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app-permissions.png\" alt=\"Facebook App Permissions\" border=\"0\" \/><\/a><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\">All the permissions and their description can be found in here:<\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><a href=\"http:\/\/developers.facebook.com\/docs\/authentication\/permissions\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/developers.facebook.com\/docs\/authentication\/permissions\/<\/a><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\">You can check the app canvas in here: <a href=\"http:\/\/apps.facebook.com\/tech-and-dev\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/apps.facebook.com\/tech-and-dev\/<\/a><\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><img decoding=\"async\" title=\"Facebook App\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/facebook-app.png\" alt=\"Facebook App\" border=\"0\" \/><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\">Notice how there is a <b>privacy policy<\/b> and <b>terms and conditions<\/b> link on the bottom, and all the permissions we&#8217;ve added.<\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\">That&#8217;s it for our basic tutorial!<\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\">In my next tutorial, I will show you to build a php facebook app and work with the permissions and login.<\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><b>Any questions or suggestions? Leave a comment below!<\/b><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n<div style=\"font-family: inherit; text-align: justify;\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Facebook applications gives you the opportunity to deeply integrate into the core Facebook experience. Your app can integrate with many aspects of Facebook.com, including the News Feed, Notifications, open-graph and all of the core Facebook Platform technologies, such as Social Plugins, like the registration plugin, like plugin, login. &nbsp; To create your first facebook application: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[33,94,92],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-facebook","category-facebook-api","category-facebook-app"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":1,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":200,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions\/200"}],"wp:attachment":[{"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}