Skip to content

Enabling Facebook Login

Note this step may be done any time before publishing your app, but your Facebook Login will not work until then.

To enable Facebook Login in your app, please follow below steps.

Set Up Facebook App

Steps

  1. Log into Facebook for developer and click Add a New App in the dropdown menu on the top right of the page.

  2. Fill out your Display Name and Contact Email then click the button Create App ID. Note you can change this later.

  3. Click Settings on the page.

  4. Click + Add Platform under the settings page and choose iOS.

  5. Fill out the bundle ID and check the Single Sign On button

  6. You can find your ID in your config.xml file on the root of your project , it’ll looks like.

  7. Click + Add Platform under the settings page and choose android

  8. Fill out the Google Play Package Name, Key Hashes and check the Single Sign On button

  9. You can find your name in your platforms/android/AndroidManifest.xml file, it’ll looks like <manifest package="com.example.myapp" …

  10. You can refer here for how to generate a key hash for developer environment.

  11. Click Save Changes on the bottom right

Set Up Facebook Login Setting

Steps

  1. Click on + Add Product in the left side menu, then add Facebook Login.

  2. Next, click Facebook Login in the left side menu and select Setting.

  3. The Client OAuth Settings page for Facebook Login will appear. Enter the following URL in the Valid OAuth redirect URIs field.

    https://<my_domain>/api:1/social/handle/Facebook

  4. Click Save Change

  5. Finally, you must provide your App ID and App Secret to Exosite to enable your solution for Facebook Login. (You can find them on dashboard.)

Update Your App Project

  1. Update the APP_ID and the APP_NAME in your "package.json" and "config.xml" files.

  2. Reinstall your app dependencies and platforms. Any time you change your "config.xml" or "package.json", you need to do the following remove commands and then reinstall the dependencies and platforms.

    (1) Remove node_modules, plugins and platforms

    cd hamv_mobile
    rm -rf node_modules
    rm -rf plugins
    rm -rf platforms
    

    (2) Remove platform

    ionic cordova platform rm android
    ionic cordova platform rm ios
    

    (3) Reinstall project dependencies

    npm install
    

    (4) Reinstall platforms

    ionic cordova platform add android
    ionic cordova platform add ios
    

Publish Your Facebook App

Steps

  1. Go to Facebook for developer and select your app.

  2. Click "App Review" on the left menu.

  3. Click the button under "Make {yourAppName} public".

  4. Select a category and click "Confirm" button.

  5. Congratulations! Your app is now public.

Back to top