Skip to content
rdlabo.dev

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.

Features

  • Facebook login and logout, with native data access reauthorization
  • Current access token lookup
  • Facebook Graph API profile requests
  • Facebook App Events with string and number parameters
  • Native App Event and advertiser settings

Quick start

After Installation and the platform configuration below,
request the permissions your app needs:

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

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

if (result.accessToken) {
  console.log('Facebook login completed.');
}

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.

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.