Facebook account kit plugin for {N}.
npm i --save nativescript-facebook-account-kit

Facebook Account Kit plugin for NativeScript (Unofficial)

This plugin is a wrapper in {N} around the native facebook's Account Kit's iOS and Android plugins.

Refer to facebook's docs to understand how Account Kit works and how to set it up on Facebook's developer portal.


tns plugin add nativescript-facebook-account-kit


On iOS, Add the following to your Info.plist found under /app/App_Resources/iOS somewhere inside <dict />

<string><!--Your app id from developer portal--></string>
<string><!--Client token from dev portal--></string>
<string>ak<!--Your app id from developer portal--></string>


On Android, Add the following to AndroidManifest.xml inside the <application> tag.

	<meta-data android:name="com.facebook.accountkit.ApplicationName"
android:value="@string/app_name" />

<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/FACEBOOK_APP_ID" />

<meta-data android:name="com.facebook.accountkit.ClientToken"
android:value="@string/ACCOUNT_KIT_CLIENT_TOKEN" />

<activity android:name="com.facebook.accountkit.ui.AccountKitActivity" >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="ak<Your Facebook app id>" />

Add the following as your strings.xml file under app/App_Resources/Android/src/main/res/values/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="">
<string name="app_name">Your App Name </string>
<string name="title_activity_kimera">Your App name</string>
<string name="FACEBOOK_APP_ID">FACEBOOK_APP_ID</string>

Account Kit and Google Play Services Version

The plugin will default to this version of the Android play-services-auth SDK and account-kit-sdk SDK. If you need to change the versions (to for instance the latest version), you can add project ext properties googlePlayServicesVersion and accountKitVersion to app/App_Resources/Android/app.gradle:

project.ext {
googlePlayServicesVersion = "+"
accountKitVersion = "+"


Initialize the plugin with the response type you seek either AuthorizationCode or AccessToken

import { FacebookAccountKit, AccountKitResponseType } from 'nativescript-facebook-account-kit';
const facebookAccountKit = new FacebookAccountKit(AccountKitResponseType.AuthorizationCode);
import { Color } from "tns-core-modules/color";

const options : AccountKitOptions = {
prefillPhoneNumber : "9XXXX12345",
prefillCountryCode : "91",
defaultCountryCode : "IN",
whitelistedCountryCodes : ["IN"],
blacklistedCountryCodes : [],
enableGetACall : true,
presentAnimated : false,
enableSendToFacebook : true,
primaryColor : new Color("orange")
this.facebookAccountKit.loginWithPhoneNumber(options).then(authCode => {
this.authCode = authCode;
}, error => {
this.authCode = error.message;


Method Description Return type
loginWithPhoneNumber Use account kit login flow with lot of options. A promise that resolves to either authorization code or access token.
loginWithEmail Use account kit email flow. A promise that resolves to either authorization code or access token.


Apache License Version 2.0, January 2004