1.0.6 • Published 10 months ago

@openmobilehub/auth-facebook v1.0.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

Installation

npm add @openmobilehub/auth-facebook

Configuration

:::infoPrerequisites

Each plugin requires you to follow the iOS and Android configuration prior to interacting with it.

:::

Console App

To access Google APIs, please follow these steps in order to obtain the Client ID:

  1. Create a new app in Meta for Developers.
  2. Add the Android platform and specify your Key Hash for your app.
  3. Enable the email permission for your app.

Android

Add a new entry to your android/local.properties file:

FACEBOOK_CLIENT_ID=<YOUR_FACEBOOK_APP_ID>
FACEBOOK_CLIENT_SECRET=<YOUR_FACEBOOK_APP_SECRET>

Usage

Initializing

Before interacting with Facebook, initialization of the Facebook Auth Client is necessary, requiring platform specific configuration to be set.

import FacebookAuthClient from '@openmobilehub/auth-facebook';

await FacebookAuth.initialize({
  android: {
    scopes: ['public_profile', 'email'],
  },
  ios: {
    scopes: ['public_profile', 'email'],
    clientId: '<YOUR_FACEBOOK_APP_ID>',
    clientSecret: '<YOUR_FACEBOOK_APP_SECRET>',
    redirectUrl: `fb${'<YOUR_FACEBOOK_APP_ID>'}://authorize/`,
  },
});

Other methods

Interacting with the Facebook provider follows the same pattern as other providers since they all implement the IAuthModule interface. For a comprehensive list of available methods, refer to the Quick Start guide.

License

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4-alpha.0

11 months ago

1.0.3

12 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-beta.4

1 year ago

1.0.0-beta.3

1 year ago

1.0.0-beta.2

1 year ago

1.0.0-beta.1

1 year ago

1.0.0-beta.0

1 year ago