npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-plugin-fb-sdk-basic

v1.0.1

Published

Cordova plugin for Facebook SDK - Login, Events, and IDFA Tracking

Readme

cordova-plugin-facebook-sdk

Cordova plugin for Facebook SDK — focused on login, event logging, and IDFA/advertiser tracking.

Built for iOS and Android. Uses Facebook SDK 18.0.3.

Installation

cordova plugin add cordova-plugin-facebook-sdk \
  --variable APP_ID="your_app_id" \
  --variable CLIENT_TOKEN="your_client_token" \
  --variable APP_NAME="your_app_name"

Or from a local path:

cordova plugin add /path/to/cordova-plugin-facebook-sdk \
  --variable APP_ID="your_app_id" \
  --variable CLIENT_TOKEN="your_client_token" \
  --variable APP_NAME="your_app_name"

Plugin Variables

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | APP_ID | Yes | — | Facebook App ID | | CLIENT_TOKEN | Yes | — | Facebook Client Token | | APP_NAME | Yes | — | Display name for your app | | FACEBOOK_URL_SCHEME_SUFFIX | No | — | URL scheme suffix (for multiple apps) | | FACEBOOK_AUTO_LOG_APP_EVENTS | No | true | Auto-log app events | | FACEBOOK_HYBRID_APP_EVENTS | No | false | Enable hybrid app events for WebView | | FACEBOOK_ADVERTISER_ID_COLLECTION | No | true | Collect advertiser ID | | FACEBOOK_ANDROID_SDK_VERSION | No | 18.0.3 | Android SDK version | | FACEBOOK_IOS_SDK_VERSION | No | 18.0.3 | iOS SDK version |

API

All methods are available on the global facebookConnectPlugin object.

Login

login(permissions, success, failure)

Standard Facebook login.

facebookConnectPlugin.login(['public_profile', 'email'],
  (result) => console.log('Login response:', result),
  (error) => console.error('Login error:', error)
);

Success response:

{
  "status": "connected",
  "authResponse": {
    "accessToken": "...",
    "expiresIn": "...",
    "data_access_expiration_time": "...",
    "userID": "..."
  }
}

loginWithLimitedTracking(permissions, nonce, success, failure)

iOS Limited Login (ATT-compliant). On Android, falls back to standard login.

facebookConnectPlugin.loginWithLimitedTracking(
  ['public_profile', 'email'],
  'unique-nonce-string',
  (result) => console.log('Limited login response:', result),
  (error) => console.error('Login error:', error)
);

Success response (iOS):

{
  "status": "connected",
  "authResponse": {
    "authenticationToken": "...",
    "nonce": "...",
    "userID": "..."
  }
}

logout(success, failure)

facebookConnectPlugin.logout(
  () => console.log('Logged out'),
  (error) => console.error(error)
);

getAccessToken(success, failure)

Returns the current access token string. Not available with Limited Login.

facebookConnectPlugin.getAccessToken(
  (token) => console.log('Token:', token),
  (error) => console.error(error)
);

getCurrentProfile(success, failure)

facebookConnectPlugin.getCurrentProfile(
  (profile) => console.log('Profile:', profile),
  (error) => console.error(error)
);

Response (standard login): { userID, firstName, lastName } Response (limited login): { userID, name, email }

getLoginStatus(force, success, failure)

facebookConnectPlugin.getLoginStatus(true,
  (status) => console.log('Status:', status),
  (error) => console.error(error)
);

Events & Analytics

logEvent(name, params, valueToSum, success, failure)

// Simple event
facebookConnectPlugin.logEvent('view_content');

// Event with parameters
facebookConnectPlugin.logEvent('view_content', { content_id: '123' });

// Event with parameters and value
facebookConnectPlugin.logEvent('purchase', { currency: 'USD' }, 9.99);

logPurchase(value, currency, params, success, failure)

facebookConnectPlugin.logPurchase(9.99, 'USD',
  { content_id: 'product_123' },
  () => console.log('Purchase logged'),
  (error) => console.error(error)
);

activateApp(success, failure)

facebookConnectPlugin.activateApp();

Tracking & Privacy

setAutoLogAppEventsEnabled(enabled, success, failure)

facebookConnectPlugin.setAutoLogAppEventsEnabled(false);

setAdvertiserTrackingEnabled(enabled, success, failure)

iOS only (ATT). No-op on Android.

facebookConnectPlugin.setAdvertiserTrackingEnabled(true);

setAdvertiserIDCollectionEnabled(enabled, success, failure)

facebookConnectPlugin.setAdvertiserIDCollectionEnabled(true);

setDataProcessingOptions(options, country, state, success, failure)

CCPA compliance.

// Disable Limited Data Use
facebookConnectPlugin.setDataProcessingOptions([]);

// Enable Limited Data Use for California
facebookConnectPlugin.setDataProcessingOptions(['LDU'], 1, 1000);

Configuration

getApplicationId(success, failure) / setApplicationId(appId, success, failure)

setClientToken(clientToken, success, failure)

Compatibility

  • cordova-android >= 9.0.0
  • cordova-ios >= 6.0.0
  • Facebook SDK 18.0.3 (configurable)

Compatible with @awesome-cordova-plugins/facebook — the JS interface clobbers the same facebookConnectPlugin global with matching method signatures.

iOS Dependencies

Only the pods needed for login and analytics:

  • FBSDKCoreKit
  • FBSDKLoginKit

ShareKit and GamingServicesKit are not included.

License

MIT