Hi All, I am trying to integrate facebook account kit login in my ionic android app. I have installed following things.
- cordova plugin add cordova-plugin-facebook-account-kit --save --variable APP_ID=“XXXXXXX” --variable APP_NAME=“XXXX” --variable AK_TOKEN=“XXXXXXXXXXXXXXXXXXXXXXX”
- npm i cordova-plugin-facebook-account-kit
Below is my code snippet. The below code throws me account kit login page. The problem is:
- . How to set the default country code while throwing the page (for ex: +852 for hongkong)
- 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;
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
result: any;
test: any;
userDetail: any;
constructor(public navCtrl: NavController) {
}
success (response: any){
console.log(response);
this.result = response;
// this.navCtrl.push('OnboardLocationPage');
this.test = this.result;
}
error(err) {
console.log(err);
this.test = err;
}
smsLogin() {
FacebookAccountKit.mobileLogin(function (response)
{ alert(JSON.stringify(response)); }, function (error) { console.log(error) });
}
}
