Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I allow people to subscribe to my Facebook app to their Page?

I have a Facebook app that can be used for certain businesses. Instead of manually connecting my app and their pages, is it possible for me to create a website where a customer can login through Facebook, select their Page, and connect it with my App with certain subscription permissions? Where do I even begin? I can't find more info on https://developers.facebook.com/

Basically I am trying to have functionality similar to manychat.com just for my own service.

like image 269
good_evening Avatar asked Dec 28 '19 16:12

good_evening


1 Answers

I will go through an example which I have already implemented. It has to do with Facebook Ads Leads but you can retrieve whatever information you want from pages.

So the flow is like this: I create an app in Facebook, select which permissions I need to get from Facebook users/pages and then create my application to connect with this Facebook app.

End users will open a link and they have a button login with Facebook and when they login with Facebook they will have some options that they can choose and these are their pages.

Please be aware that it depends on what permissions you are asking. If you ask for permissions that are related to pages then Facebook will automatically ask them to select a page otherwise will just ask them to give their personal details to your app.

Facebook has a detailed page with information how you can archive this and you can read it here.

They also have a video tutorial how to make this integration here

Be aware that it's a bit tricky to get through that tutorial but just try to do everything that is listed there and also don't forget to create an app token.

Below I have added some simple steps that you need to go through for this integration but you need to go through links that I provided to get information how to do these steps.

Step 1: Create your app in facebook.

  • Fill your app information here
  • In App Domains you should include webserver URL(Where you want these informations that you get from pages to be sent)

Step 2: Subscribe to facebook app from your server

  • Create a webhook.php file so facebook can make a call there and verify your app

  • Register your file in facebook app

Step 3: Create a platform.php file in your server

  • This file will be just a simple html page which will ask users to login with their facebook and give your permissions to manage their pages.

Step 4: Modify webhooks.php file so you can receive information from facebook when something changes in pages or whatever information you requested to read form pages

Please be aware that you need your facebook business manager and you should be verified as a business in facebook in order to be able to test your integration. So you should go and apply to get verified in facebook.

like image 98
Edison Biba Avatar answered Oct 23 '22 03:10

Edison Biba