Reputation: 1718
I try to connect Facbook Account Kit in Ionic/cordova App, main problem i faced that in facebook account kit set client/server side domain name but in ionic/cordova app the webview serve from file system("file:///android_asset/www/index.html#/app/request"). So how to do this in Ionic app.
Upvotes: 8
Views: 3091
Reputation: 246
You can use plugin instead of webview https://github.com/gurisko/cordova-plugin-accountkit
Steps:
cordova plugin add cordova-plugin-accountkit --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" --variable CLIENT_TOKEN="abcdefghijklmnopqrstuvwxyz"
AccountKitPlugin.loginWithPhoneNumber({
useAccessToken: true,
defaultCountryCode: "US",
},function(res){
console.log(res)
},function(err){
console.log(err)
})
Incase of Ionic with typescript just add (window) before function
(<any>window).AccountKitPlugin.loginWithPhoneNumber({
useAccessToken: true,
defaultCountryCode: "US",
},function(res){
console.log(res)
},function(err){
console.log(err)
})
Reference: https://codesundar.com/ionic-accountkit-integration/
Upvotes: 2