Facebook Connector

The Pathfix Facebook Connector plugin enables integration from your Bubble app to your user's Facebook account. The plugin will render the Connect button (UI) and calls the relevant Facebook API automatically. No code configurations required to get the plugin working.

This documentation will show setup guide and a few example use cases.



Setup Pathfix

  • Log into Pathfix and add an application (or select an existing application)
  • Select Facebook from the list of providers
  • Add your Facebook ClientID and ClientSecret and hit Save



Image: Save ClientID and ClientSecret
Image: Save ClientID and ClientSecret



  • Navigate to the Keys section
  • Copy your Pathfix Public Key and x-private key for use in your Bubble plugin



Image: Keys
Image: Keys



Setup Plugin

The plugin is available in the Bubble Plugin store.

IMPORTANT: You need to install the Pathfix OAuth Connector plugin first before installing this plugin

  • After you have installed the Pathfix OAuth Connector plugin, Install Facebook Plugin from the Bubble plugin page
  • You can also search for Facebook and pick the Facebook Connector plugin by Pathfix Inc. and install it
  • Under x-partner-key (shared headers), add your Pathfix x-partner-key from the Keys section of your Pathfix account



Image: Partner Key
Image: Partner Key
  • Navigate to the Design section and select the Pathfix Connector element and select "All Providers configured in my Pathfix Account"



Image: Choose providers
Image: Choose providers

Your plugin is activated and ready for use.



Posting to Facebook Pages

If you are looking to post to Facebook pages, Facebooks needs you to call an additional API - ‘Get page access token’ API

The Facebook Connector plugin calls this API as well and allows you to set the state. Here are the steps to calling the API and acquiring the Page Access Token.

  • On your Bubble Design page, select the Pathfix Custom element and add it to the page
  • This element does not have a preview or display properties, it only checks for users connected status



Image: Pathfix Custom
Image: Pathfix Custom



Assuming you want to pull all the pages owned by the user and show it in a dropdown option to select the page they want to post to:

  • Add a dropdown element to the page
  • Select Dynamic choices
  • Setup the Type of choices, Choices source and Option caption as follows



Image: Dropdown setup
Image: Dropdown setup



  • Add a button on the page for when the user clicks to submit the post
  • Head over to the Workflows to setup the dropdown workflow and submission workflow
  • We will setup a workflow to set the page_id and page_access states for 'When Dropdown's value is changed'
    • Element - Set State and set the following state



Image: Set state
Image: Set state



  • Set page_access:
    • Element - Set State and set the following state



Image: Set page_access
Image: Set page_access



  • Now that the states for page_id and page_access has been set, we need to setup the Post button for when the button is clicked, we want to Post to FB page
  • Here is the workflow setup for that



Image: Publish Post
Image: Publish Post

This will post the message to the user's selected page.

Since the page_id and page_access_token have been set, you can choose to save it to your Bubble database against the user.



Actions

The following APIs are called in the Facebook Connector plugin.

Note: If you are looking for any additional APIs, send us an email to support@pathfix.com and we will add the API to the plugin



Image: Actions/Data
Image: Actions/Data