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-facebook

v0.2.2

Published

A Facebook plugin for Cordova 5.0.0+

Readme

CordovaFacebook

Facebook Plugin for Cordova 5.0+

Supports:

  • Cordova >= 5.0.0
  • iOS and Android
  • Login, Graph Requests, App Events

Get the Plugin:

$> cordova plugin add cordova-plugin-facebook --variable FACEBOOK_DISPLAY_NAME=<Your App Name> --variable FACEBOOK_APP_ID=<Your App ID> [--save]

Using the Plugin:

CordovaFacebook defines a single variable on window: window.CordovaFacebook.

Callbacks:

All CordovaFacebook methods accept exactly one argument: options, of type Object.

Passing in a function as options.onSuccess or options.onFailure will allow you to listen to the result of that method.

Both onSuccess and onFailure callbacks will generally be passed one argument (whose type may vary) as the result.

CordovaFacebook.login

The CordovaFacebook.login method accepts a permissions field in addition to the standard callbacks.

  • permissions (optional) - an array of Facebook permissions you are asking for from the user. "public_profile" is always requested. See Facebook's Docs for more information.

Both onSuccess and onFailure receive a single result object, with the following properties:

  • result.error - 1 if there was an error, 0 otherwise.
  • result.success - 1 if the user accepted the login request, 0 otherwise.
  • result.cancelled - 1 if the user cancelled the login request, 0 otherwise.
  • result.errorCode (if error is 1) - Facebook's error code for what went wrong. 0 is a network failure, 304 is a login mismatch (call logout before trying again). See Facebook List of Error Codes.
  • result.errorLocalized (if error is 1) - Facebook's localized description of what went wrong, in the current locale.
  • result.granted (if success is 1) - An array of the permissions the user approved.
  • result.declined (if success is 1) - An array of the permissions the user declined.
  • result.accessToken (if available) - The Facebook Access Token for the User.
  • result.userID (if available) - The Facebook User ID for the User.

Example usage:

CordovaFacebook.login({
   permissions: ['email', 'user_likes'],
   onSuccess: function(result) {
      if(result.declined.length > 0) {
         alert("The User declined something!");
      }
      /* ... */
   },
   onFailure: function(result) {
      if(result.cancelled) {
         alert("The user doesn't like my app");
      } else if(result.error) {
         alert("There was an error:" + result.errorLocalized);
      }
   }
});

CordovaFacebook.logout

The CordovaFacebook.logout method does not have any additional options other than the standard callbacks.

Additionally, the logout method will always succeed, and never fail. (Meaning onFailure will never be called).

The onSuccess callback is not passed any arguments.

Example usage:

CordovaFacebook.logout({
   onSuccess: function() {
      alert("The user is now logged out");
   }
});

// Unless you need to wait for the native sdk to do its thing,
// you dont even really need to use a callback:
CordovaFacebook.logout();