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 🙏

© 2024 – Pkg Stats / Ryan Hefner

facily-cordova-plugin-accountkit

v1.4.3

Published

Cordova AccountKit Plugin

Downloads

13

Readme

npm version

Cordova AccountKit Plugin

The Apache Cordova wrapper around the Facebook AccountKit.

Installation

  1. Create Facebook Developer Account
  2. Get a Facebook App ID (APP_ID)
  3. Get an AccountKit client token (CLIENT_TOKEN)
  4. To install the plugin in your app, execute the following (replace variables where necessary):
cordova plugin add cordova-plugin-accountkit --save \
   --variable APP_ID="123456789" \
   --variable APP_NAME="myApplication" \
   --variable CLIENT_TOKEN="abcdefghijklmnopqrstuvwxyz" \
   --variable API_VERSION="v1.1"

If you need to change your APP_ID after installation, it's recommended that you remove and then re-add the plugin as above. Note that changes to the APP_ID value in your config.xml file will not be propagated to the individual platform builds.

Additional Steps

If you want to use Access Tokens flow with this plugin, you have to set Enable Client Access Token Flow in your app's dashboard to ON (for more information on Client Access Token Flow, see Access Tokens and Authorization Codes).

Android

It is recommended to add these permission to config.xml of your Cordova project to reduce the friction during the login process (more info):

<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

API

Login with an email address

AccountKitPlugin.loginWithEmail(Object options, Function success, Function failure)

Available options:

{
	useAccessToken: true,
	defaultCountryCode: "US",
	facebookNotificationsEnabled: true,
	initialEmail: "[email protected]"
}

Available country codes can be found here.

Success function returns an Object like:

{
	accountId: "<string>",
	applicationId: "<string>",
	token: "<long string>",
	lastRefresh: 1451606400,
	refreshInterval: 2592000
}

If you do not use access tokens an Object looks like:

{
	code: "<long string>",
	state: "<string>"
}

Failure function returns an error String.

Login with a phone number

AccountKitPlugin.loginWithPhoneNumber(Object options, Function success, Function failure)

Available options:

{
	useAccessToken: true,
	defaultCountryCode: "US",
	facebookNotificationsEnabled: true,
	initialPhoneNumber: ["420", "123456789"]
}

Available dialing codes and country codes can be found here.

Success function returns an Object like:

{
	accountId: "<string>",
	applicationId: "<string>",
	token: "<long string>",
	lastRefresh: 1451606400,
	refreshInterval: 2592000
}

If you do not use access tokens an Object looks like:

{
	code: "<long string>",
	state: "<string>"
}

Failure function returns an error String.

Logout

AccountKitPlugin.logout()

Get account

This method only works when login method was called with { useAccessToken: true }.

AccountKitPlugin.getAccount(Function success, Function failure)

Success function returns an Object like:

{
	accountId: "<string>",
	applicationId: "<string>",
	token: "<long string>",
	lastRefresh: 1451606400,
	refreshInterval: 2592000,
	email: "<string>",
	phoneNumber: "<string>"
}