Skip to content
rdlabo.devdocs

Getting Started

Overview

Capacitor community plugin for Facebook Login and Facebook App Events on
Android, iOS, and Web. It wraps the native Meta SDKs on Android and iOS and the
Facebook JavaScript SDK on Web.

Installation

This plugin targets Capacitor 8, iOS 15 or later, and Android API 24 or later.
It declares the native Facebook SDK dependencies for both CocoaPods and Swift
Package Manager.

npm install @capacitor-community/facebook-login
npx cap sync

Install the plugin major version that matches your Capacitor major version.

Capacitor Plugin
8 8.x
7 7.x
6 6.x

Complete the required native and Web setup in
Configuration before calling the plugin.

First email login

After Installation and Configuration,
call login from a user action such as a button click. Request only email for
the first check:

import { FacebookLogin } from '@capacitor-community/facebook-login';

async function onLoginClick() {
  const result = await FacebookLogin.login({ permissions: ['email'] });

  if (result.accessToken) {
    console.log('Facebook login succeeded.');
  } else {
    console.log('Facebook login canceled or returned no token.');
  }
}

Expected result: success resolves with an accessToken object (do not log the
raw token string). Cancellation on Android and iOS resolves without a token. On
Web, a failed login rejects instead.

iOS Limited Login returns an OIDC authentication token (JWT), not a Graph API
access token. Profile via Graph requires different token conditions—see
Authentication.

Documentation

Start with Configuration, then use the guide for the
feature you are implementing. Method signatures and generated type information
remain in the API section below.

  • Configuration — Meta app settings and Android, iOS,
    and Web SDK setup.
  • Authentication — login, logout, current tokens,
    profile fields, reauthorization, and platform differences.
  • App Events — custom events, parameters, automatic event
    logging, and advertiser settings.