Facebook Account Kit login queries...Please help!

Hi All, I am trying to integrate facebook account kit login in my ionic android app. I have installed following things.

  1. cordova plugin add cordova-plugin-facebook-account-kit --save --variable APP_ID=“XXXXXXX” --variable APP_NAME=“XXXX” --variable AK_TOKEN=“XXXXXXXXXXXXXXXXXXXXXXX”
  2. npm i cordova-plugin-facebook-account-kit

Below is my code snippet. The below code throws me account kit login page. The problem is:

  1. . How to set the default country code while throwing the page (for ex: +852 for hongkong)
  2. How to do logout functionality

I am confused by what is written in npm sites as I am not sure why there are so many plugins for account kit. Kindly, if any body has any working code, please help. Thanks.

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

declare var FacebookAccountKit:any; 


  selector: 'page-home',
  templateUrl: 'home.html'
export class HomePage {
  result: any;
  test: any;
  userDetail: any;
  constructor(public navCtrl: NavController) {

  success (response: any){
        this.result = response;
  //      this.navCtrl.push('OnboardLocationPage');
       this.test = this.result;
    error(err) {
        this.test = err;
    smsLogin() {
        FacebookAccountKit.mobileLogin(function (response) 
        { alert(JSON.stringify(response)); }, function (error) { console.log(error) });

Hi Anyone to help in this please…

Hi to login with a phone number you should use this function:

   Object options, 
   Function success, 
   Function failure

To logout:


for exemple I live in KSA the code country is : SA

          useAccessToken: true,
          defaultCountryCode: "SA",
          facebookNotificationsEnabled: true
        }, (successdata) => {
          (<any>window).AccountKitPlugin.getAccount((user) => {
            console.log( JSON.stringify(user) );
        }, (err) => {

some doc:

Add your plugin

ionic cordova plugin add cordova-plugin-accountkit --save \
   --variable APP_ID="YOURAPPID" \
   --variable APP_NAME="APP_NAME" \
   --variable API_VERSION="v1.1"

then call these function for login

    useAccessToken: true,
    defaultCountryCode: "IN",
    facebookNotificationsEnabled: true,
  }, data => {
    info => this.userInfo = info,
    err => console.log(err));

If it showing error, you can use this code

    useAccessToken: true,
    defaultCountryCode: "IN",
    facebookNotificationsEnabled: true,
  }, data => {
    info => this.userInfo = info,
    err => console.log(err));

Reference : https://codesundar.com/ionic-accountkit-integration/

its saying window.AccountKitPlugin is undefined altho i added the plugin with cordova successfully