Skip to content

AccountKit Plugin for Apache Cordova which allows you to add passwordless email and SMS authentication to your app

License

Notifications You must be signed in to change notification settings

uzumakinaruto123/cordova-plugin-accountkit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"

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.

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

accountKitPlugin.loginWithEmail(Function success, Function failure) accountKitPlugin.loginWithPhoneNumber(Function success, Function failure)

Success function returns an Object like:

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

Failure function returns an error String.

Logout

accountKitPlugin.logout()

Get access token

accountKitPlugin.getAccessToken(Function success, Function failure)

Success function returns an Object like:

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

About

AccountKit Plugin for Apache Cordova which allows you to add passwordless email and SMS authentication to your app

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 91.4%
  • Java 7.8%
  • JavaScript 0.8%