Facebook Messenger App Creation Guide
A Facebook app is what connects your Facebook Page to your webhook (the main element of the Messenger experience: this is where you receive, process and send messages. ) and is where you configure various settings for the Messenger experience, generate the access token, and choose which events will be sent to your webhook.
In this guide, you'll learn how to set up a Facebook app.
Requirements
Before you begin, a few things will need to be created. Make sure you have all of the following:
Facebook page: A Facebook page will be used as the identity of your Messenger experience. When people chat with your app, they'll see the Page's name and page's profile picture. To create a new Page, visit https://www.facebook.com/pages/create
Facebook Developer Account: Your developer account is needed to create new apps, which are the centerpiece of any Facebook integration. You can create a new developer account by logging into the Facebook Social technologies | Meta for Developers developer website and clicking the "Get Started" button.
Facebook app: The Facebook app contains settings for your Messenger experience, including access tokens. To create a new app, visit the app dashboard by clicking "My Apps" in the top bar of the developer page.
Webhook URL: Actions that take place in conversations, such as new messages, are sent as events to your webhook. Along with the callback url, a verification token will be provided that will need to be used when installing the app. CTLiveSocial needs to be reachable via a public WebHook according the following format
Creating a new Facebook app
To create a Facebook app, from the Facebook developer page (Social technologies | Meta for Developers ), click on "My Apps" and then on the "Create an app" button.
Then follow the following steps in the wizard:
Select the type of app. App types determine which products can be added to an app in the app dashboard and what permissions and features can be requested for approval through the app review process.
Enter details about the app such as app name, email address, and purpose. Then press the "Create App" button to finish the creation process.
Installation steps
Before you begin, make sure that you have met all the requirements listed above.
Add the Messenger platform to your Facebook app
In the app's settings sidebar under "PRODUCTS", click "+ Add Product".
Hover over "Messenger" to see the options.
Click the "Configure" button. The Messenger platform will be added to your app and the Messenger settings console will appear.
Set up the webhook for your app
In the "Webhook" section of the Messenger settings console, click the "Configure webhook" button.
In the "Callback URL" field, enter the public URL for your webhook.
In the "Verify token" field, enter the verification token for your webhook.
Click "Verify & Save" to confirm the callback URL. The Messenger platform will send a GET request to your webhook with the verification token you provided. If your webhook is valid and configured correctly to respond to the verification request, the settings of your webhook will be saved.
Subscribe your app to a Facebook Page
Click "Add or remove pages" and select the pages you want your app to subscribe to. Your webhook will receive events for each selected page when people chat with it via Messenger.
In the "Access Tokens" section, there will be a Generate Token button for each Authorized Page. Be sure to save the access token, it is required to send messages using the Sending API. It will need to be stored in the connector configuration saved on db along with app ID, Facebook page ID, and webhook verification token.
For each authorized Page, the "Webhooks" section will contain the fields that the app can subscribe to. Click "Add Subscriptions" to select the desired fields. At a minimum, we recommend that you choose messages and messaging_postbacks to get started. The Messenger platform will now be able to send the webhook events you have subscribed to for the selected Page to your webhook.
Publishing your app
App analytics is the process of requesting permissions or features for the app or integration. As part of the scan process, your app will be tested to verify that it actually uses the required permissions and functions.
Before you begin the process of submitting your App Analytics request, be sure to complete each of the steps below. This will improve the quality of your submission and reduce the chances of it being rejected.
Upload an icon image of the 1024x1024 compliant app, under Settings > Basic Settings > App icon.
Read the guide on screen recordings and create screen recordings of your app using every permission and function you will request in your submission. Yourrecordings will be used as guides when testing your app to verify that it actually uses all the required permissions and features.
Make sure your app's name and icon meet logo and trademark requirements.
Make sure you've completed app development. If you make changes to basic or advanced settings after submission, you may need to run the scan again.
Make sure they can access your app or website. Your app must be publicly available, or you must provide instructions on how to access it.
If you want the test on your account to run using a specific test user, provide their credentials.
Please read the Platform Terms and Developer Policies to ensure that your app complies with the terms and regulations.
Read the Allowed Use section in the reference for each permission and feature you will request in your request. If your app doesn't meet the allowed use for a permission or feature, your app won't be approved for that permission or feature.
The App Analytics process begins in the App Analytics blade of the App Management Dashboard.
Selecting Permissions and Functions
Go to App analysis > tab Permissions and functions. Request each of the permissions and features your app needs by searching for them individually and clicking the Request to add them to the request. Request only the permissions and features your app needs. When you're ready, click the Continue your request. Request permission to pages_messaging.
Completing app verification
Scroll down to the Complete app verification section and click anywhere in the row. The App Verification Details window appears. Iset the radio button to Yes. This lets you know that we can log in to your app using a Facebook account.
In the Platform Settings section, verify that the information displayed is correct, and in the space provided, describe how you can access the app to test it.
Completing Usage Descriptions
Scroll down to the Required Permissions and Features section and click on the first permission or feature in the row. In the window that appears, describe why your app needs this permission or feature.
After that, upload the screen recording that shows you how to use the app to test this permission or feature.
Repeat step 3 for each permission and feature you're requesting.
Completing app settings
Scroll down to the Complete app settings section and click anywhere in the row. The window that appears shows the required settings available in the Settings tab > Basic Settings, so they may already be complete. In that case, just confirm that everything is correct or make the necessary changes. If they are incomplete, set them.
Privacy Policy URL: This is the URL that is presented to app users in the Facebook Login interface so they can decide whether or not to grant your app the required permissions.
Purpose of the app: Set it to your or your company's if your app is only available to people who have a role in your app or a role in a company that has claimed your app. If not, set it to Customers.
App Category: Be sure to select a category that accurately describes your app.
Primary Contact: Make sure you have access to the email account displayed here. Email notifications related to the App Analytics request will be sent to this address.
Sending the analysis request
Click Submit for Analysis and accept the Initial Platform Terms in the window that appears.
Follow the steps required to verify your business.
Then go back to The à Requests App Analysis and send the analysis request for the requested permissions (example pages_messaging).
After accepting the conditions and submitting, the request will be queued and you should receive a decision within a week.
After you submit an App Analytics request, you'll receive periodic notifications to developers about the status of the request. You can view these alerts on the >mail Tab. You can also check the status of your request using the App's Analytics pane > Requests.
It typically takes less than a week to process your request, and it often only takes 2-3 days, but the time may lengthen during peak request periods.
Any changes you make to your app's basic or advanced settings after you submit your app for App Analytics may need to be re-scanned before they take effect.