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

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.