Social - Installation and setup


Prepare your repo

Here are the steps to creating a Facebook registration and login:

  1. Add the social plugin to your repo (and update site/index.php)
  2. Create a new app at Facebook Developers
  3. Set up the Facebook app details in social.conf.ini and set the proper urls in the Facebook developer panel
  4. Optionally create a “Test app” based on your live application. You can add a facebook_develop section in your social.conf.ini (see docs below)
  5. Optionally create different localized apps. You can add facebook_en_US and other localized app settings in your social.conf.ini (see docs below)

Enable social.js

To enable social.js, simply include the script right after the opening <body> tag:

<body>
  {% include 'social/js/' %}

Different apps for develop/localization

You can set up different Facebook apps in the Facebook developer panel for develop version and localized versions of the application since these may be running on different domains. To do this, simply create additional sections in the configuration file:

When you need access to the Facebook app id and secret to make app-level API requests you’ll need to load up the proper configuration. You can do this automatically with the helper:

$this->zajlib->facebook->load_config();

Most API requests do not require you to load this since you can send requests via the FacebookUser object which should already have a valid token if the user is logged in.

Many Facebook apps in one repo

Your web application can also support many different Facebook apps in case you need to have a collection of apps in one repo (even though this is generally not recommended). You can achieve this with subsections:

Outlast Web & Mobile Development (c) 2019 | Privacy Policy |