How to Create Facebook App, App ID, and App Secret

Facebook app is used in many cases, the most used case is Facebook login integration on website. In this tutorial, we will provide the step by step guide to create a new Facebook app. To implement Facebook login on the website, you need to register an application in the Facebook developer panel. You will get Application ID and Application Secret of the Facebook application, these details are needed to authenticate your web application with Facebook.

Creation Facebook Application Manager

Follow the steps below to create a Facebook application and generate the application ID and application secret.

  • Go to the Facebook developer page and log in with your Facebook account.
  • In the right corner of the top navigation bar, click the My Apps link and select Add New Application.
    • Enter the Display Name and Contact Email.
    • Click the Create Contact ID button app.
    • The new app will be created and redirected to the Facebook app dashboard.
  • Navigate to the page Settings » Basic.
    • In the Application Domains field, specify the domain name of your website (for example, codexworld.com).
    • In Privacy Policy URL field, specify the URL of the privacy policy web page for the login dialog (for example: https://www.codexworld.com/privacy-policy /)
    • Select the Category of your Application.
    • Click the Save Changes button.
  • In the left navigation menu panel, click the PRODUCTS(+) link and go to the Add a Product page.
    • Select the Facebook Login product and click Set Up.
    • Select Web as the application platform .
    • Enter the URL of the site (eg https://www.codexworld.com).
    • Click Save .
  • Navigate to the Facebook page Login » Settings.
    • Go to the Client OAuth Settings section. In the Valid OAuth Redirect URIs field, specify the redirect URL of your OAuth application (eg https://www.codexworld.com/facebook-login-php/) .
    • Click Save Changes.
  • Change Application State:
    • Of course By default, the application will be in development mode . To change the state of the app in Live, click the toggle switch in the top header.
    • Clicking the Status on/off switch will bring up a confirmation dialog. Confirm to make your app public.
See Also:  How to create a HTML link that interacts with Skype (call, chat, view profile, add to contacts)

Navigate to the Settings » Basic page, copy the Application ID and Application Secret. This App ID and App Secret are required to access Facebook APIs.

Please note: You must specify the App ID and App Secret in the script when calling to the Facebook API. Also, the URL specified in Valid OAuth Redirect URI must match the redirect URL specified in the script.

Permissions to get user profile data

The default permissions and Email permissions are approved by default and do not require app review.

default: The default permission grants your app to access the default fields of a user’s public profile .

  • id
  • first name
  • last name
  • middle name
  • first name
  • format_name
  • image
  • short_name

email: The email permission gives your application the access to a user’s primary email address.

  • email

Go to the Application Review » My Permissions & functions to know the approved permissions of your Facebook application.

Get profile link and gender

To retrieve the Facebook profile URL and gender of the user, the user_link and user_gender permissions must be approved.

  • user_link: This permission gr Allows your app to access the URL of a user’s Facebook profile.
  • user_gender: This permission grants your application access to a user’s gender.

Follow the steps below to get the user_link and user_gender permissions.

  • Go to the page App Review » Permissions and Features.
  • Click Request to submit a request for the respective permissions. In addition, you must provide the information required to submit the approval request.
See Also:  How to design an app: the ultimate guide

Once Facebook completes and approves the app review process, you will be able to get the Facebook profile link and the user’s gender.

Conclusion

You only need the App ID and App Secret to integrate Facebook login into the web app. Please refer to the following tutorials where we have used Application ID and Application Secret to access Facebook APIs (OAuth API, Graph API, etc.).

  • Login with Facebook using PHP
  • Login with Facebook to CodeIgniter

.

Leave a Reply

Your email address will not be published. Required fields are marked *