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

cordova-plugin-facebook-account-kit

v0.1.7

Published

Facebook Account Kit Login Plugin - Allows email and mobile logins using Facebook Account Kit. Now with background colors customization also available. Docs: https://github.com/Mhusain/FacebookAccountKit

Downloads

18

Readme

alt cordova-plugin-facebook-account-kit

cordova-plugin-facebook-account-kit

Use Facebook Account Kit Login in Apache Cordova projects in iOS & Android. Now with background colors customization also available.

Command

cordova plugin add cordova-plugin-facebook-account-kit --save --variable APP_ID="123456789" --variable APP_NAME="TestApp" --variable AK_TOKEN="XYZ123"

Installation

See npm package for versions - https://github.com/Mhusain/FacebookAccountKit

Make sure you've registered your Facebook app with Facebook and have an APP_ID on https://developers.facebook.com/apps and AccountKitClientToken on https://developers.facebook.com/apps/<APP_ID>/account-kit/.

$ cordova plugin add cordova-plugin-facebook-account-kit --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" --variable AK_TOKEN="AccountKitClientToken"

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

Android (One more steps to add)

Open class MainActivity.java

Import Facebook Account Kit package

import com.facebook.accountkit.AccountKit;

Add below line of code to initialize Facebook Account Kit

@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Account Kit initialization AccountKit.initialize(getApplicationContext()); }

Usage

Email Login

FacebookAccountKit.emailLogin(function (response) { alert(JSON.stringify(response)); }, function (error) { console.log(error) });

Success function will response like:

{ accessToken: "", provider: "", id: "", email: "" }

Mobile Login

FacebookAccountKit.mobileLogin(function (response) { alert(JSON.stringify(response)); }, function (error) { console.log(error) });

Success function will response like:

{ accessToken: "", provider: "", id: "", mobile: "" }

Colors customizations

iOS

Change colors according to your requirements in js.

var theme = new Object(); theme.backgroundColor = "f8e8db" theme.buttonBackgroundColor = "d4c0c8" theme.buttonBorderColor = "1877a5" theme.buttonTextColor = "ffffff" theme.headerBackgroundColor = "ddadc0" theme.headerTextColor = "ffffff" theme.inputBackgroundColor = "def3ee" theme.inputBorderColor = "a4a4d0" theme.inputTextColor = "ff7373" theme.textColor = "c25975" theme.titleColor = "9e596e"

FacebookAccountKit.mobileLoginWithTheme( function (response) { alert(JSON.stringify(response)); }, function (error) { console.log(error) }, theme );

Android

Plugin have defualt values now but you can change colors according to your requirements in /android/res/values/FacebookAccountKitLogin.xml file or comment all '<item> tags to achieve default theme of account kit'

File :: res/values/FacebookAccountKitLogin.xml

<style name="AccountKitLoginTheme" parent="Theme.AccountKit"> <item name="com_accountkit_background_color">#EEF6FF</item> <item name="com_accountkit_button_background_color">#96BDEB</item> <item name="com_accountkit_button_disabled_background_color">#96BDEB</item> <item name="com_accountkit_button_border_color">#96BDEB</item> <item name="com_accountkit_button_text_color">#ffffff</item> <item name="com_accountkit_header_background_color">#96BDEB</item> <item name="com_accountkit_header_text_color">#ffffff</item> <item name="com_accountkit_input_background_color">#EEF6FF</item> <item name="com_accountkit_input_border_color">#96BDEB</item> <item name="com_accountkit_input_text_color">#da4a11</item> <item name="com_accountkit_text_color">#da4a11</item> <item name="com_accountkit_title_text_color">#da4a11</item> </style>

you will find above style in file res/values/FacebookAccountKitLogin.xml. Change these colors accordingly.