cordova-plugin-accountkit icon indicating copy to clipboard operation
cordova-plugin-accountkit copied to clipboard

integration with ionic 2

Open mrpower55 opened this issue 8 years ago • 19 comments
trafficstars

it is really looking nice and i want to ask if this is compatiable with ionic 2 i tried to download it but i don't know how to import it in my typescript file

so please if anyone know how please tell me thanks

mrpower55 avatar Mar 21 '17 12:03 mrpower55

Have you tried window['AccountKitPlugin'].method() ?

gurisko avatar Mar 21 '17 12:03 gurisko

Closing due to inactivity.

gurisko avatar Apr 07 '17 13:04 gurisko

Hi gurisko! can we use this plugin in ionic 2

rajbisht13 avatar Jun 05 '17 12:06 rajbisht13

Hello. Yes, I had no troubles using it with Ionic2.

On 5 Jun 2017 2:27 p.m., "Raj Bisht" [email protected] wrote:

Hi gurisko! can we use this plugin in ionic 2

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gurisko/cordova-plugin-accountkit/issues/22#issuecomment-306175580, or mute the thread https://github.com/notifications/unsubscribe-auth/AAePvYg0h4pwTs-5ZvcOevCrcv6aANb2ks5sA_RMgaJpZM4Mjtte .

gurisko avatar Jun 05 '17 12:06 gurisko

Ohk, and what about ionic 3? btw, thanks gurisko

rajbisht13 avatar Jun 05 '17 13:06 rajbisht13

I haven't tested with Ionic 3, but there were no major changes (other than angular itself which doesn't really touch Cordova plugins) so it should be working fine. You're welcome. And please let us know if everything works as expected if you decide to proceed with the implementation.

On 5 Jun 2017 3:30 p.m., "Raj Bisht" [email protected] wrote:

Ohk, and what about ionic 3? btw, thanks gurisko

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gurisko/cordova-plugin-accountkit/issues/22#issuecomment-306187633, or mute the thread https://github.com/notifications/unsubscribe-auth/AAePvY8UGxUfxsF1_I77DJy2OF-egzHGks5sBALtgaJpZM4Mjtte .

gurisko avatar Jun 05 '17 13:06 gurisko

Hi gurisko, I am trying to use this plugin in my ionic3 project. Can you please tell is this correct way of implementing the plugin.

declare var AccountKitPlugin:any; 
export class LoginPage {
result: any;
constructor(public navCtrl: NavController){
}
smsLogin() {
    let options = {
      defaultCountryCode: "IN",
      facebookNotificationsEnabled: true,
      initialPhoneNumber: ["+91", this.userDetail.value.phoneNumber]
    }  
    let that = this;
    let success = function(response){
        that.result = response;
        console.log(that.result);
        that.navCtrl.push('TabPage');
     }
    let error = function(err){
       return error;
    }    
    AccountKitPlugin.loginWithPhoneNumber(options, success, error);
}   

rajbisht13 avatar Jun 05 '17 17:06 rajbisht13

It seems good to me. Doesn't it work? I'll have a look when I have access to my laptop.

On 5 Jun 2017 7:51 p.m., "Raj Bisht" [email protected] wrote:

Hi gurisko, I am trying to use this plugin in my ionic3 project. Can you please tell is this correct way of implementing the plugin.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gurisko/cordova-plugin-accountkit/issues/22#issuecomment-306256614, or mute the thread https://github.com/notifications/unsubscribe-auth/AAePvUojlDEewbW8TNh35_6bh0VRJi6dks5sBEAIgaJpZM4Mjtte .

gurisko avatar Jun 06 '17 10:06 gurisko

Hi! it works perfectly fine but when i navigate to 'Tabpage', TabPage responds very slowly and bit buggy ( still don't know why! ) So i just removed 'that.navCtrl.push(TabPage)' from the success function and placed outside it, then it works perfectly fine. Thanks, gurisko!

rajbisht13 avatar Jun 06 '17 17:06 rajbisht13

I am using cordova-plugin-accountkit but I cannot chage colors in FacebookAccountKitLogin.xml for android platform ionic 2.

Thanks!

khinchotin avatar Sep 01 '17 06:09 khinchotin

Hello.. Doesn't seem to work for me... throws me the below error ...

Failure Class not found

I have just copied the above code trying to even hard code the phone number... but no luck.. here's my code

let options = {
      defaultCountryCode: "IN",
      facebookNotificationsEnabled: true,
      initialPhoneNumber: ["+91", "xxxxxxxxxx"]
    }  
    let that = this;
    let success = function(response){
        that.result = response;
        console.log(that.result);
     }
    let error = function(err){
      console.log(error)
       return error;
    }    
    AccountKitPlugin.loginWithPhoneNumber(options, success, error);

Any help on this is much appreciated as this is only live plugin available for account kit as much as I've seen through the entire internet.

kkrishnan90 avatar Oct 23 '17 18:10 kkrishnan90

Hi, I am trying to use this plugin in Ionic 3 and I am not sure how to import this plugin in my ts file.

I followed the sample code of Whhymee which he mentioned in his comment but I am getting 'AccountKitPlugin is not defined'. I am new to Ionic and I am not sure what I am missing here. Package.json and config.xml has this plugin with name as 'cordova-plugin-accountkit'. Where else I have to make the change to use this plugin in Ionic 3.

Any help is appreciated! Thank you

sharmila-r avatar Nov 01 '17 00:11 sharmila-r

@sharmila-r I think you need to add 'declare var AccountKitPlugin: any;' in your ts file. go through this link https://www.joshmorony.com/using-cordova-plugins-in-ionic-2-with-ionic-native/

rajbisht13 avatar Nov 01 '17 01:11 rajbisht13

@Whhymee, thank you for the reply. I have declared the variable after import as 'declare var AccountKitPlugin:any; ' and still getting that error. Do I need to add anything in app.module.ts? Here is my login.ts code.

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, AlertController , Platform} from 'ionic-angular';
declare var AccountKitPlugin:any; 

@IonicPage()
@Component({
  selector: 'page-login',
  templateUrl: 'login.html',
})
export class LoginPage {
	public verificationId = "";
    result: any;

constructor(public platform: Platform, public navCtrl: NavController,
	public navParams: NavParams,  public alertCtrl:AlertController) {
      platform.ready().then(() => {
        //console.log("cordova ",cordova.plugins)
       });
    }
    registerPhone(phoneNumber): void {
      let options = {
        defaultCountryCode: "US",
        facebookNotificationsEnabled: true,
        initialPhoneNumber: ["1", phoneNumber]
        };
        let that = this;
        let success = function(response){
            that.result = response;
            console.log(that.result);
            that.navCtrl.push('TabPage');
         }
        let error = function(err){
           return error;
        }    
    AccountKitPlugin.loginWithPhoneNumber(options, success, error);
    }
}

Thank you in advance!

sharmila-r avatar Nov 01 '17 14:11 sharmila-r

@sharmila-r i have the same error... if you solved it please update here

sunilkunapareddy avatar Mar 30 '18 08:03 sunilkunapareddy

@Whhymee the link which you gave is not working dude... plz update with this error

sunilkunapareddy avatar Mar 30 '18 08:03 sunilkunapareddy

that doesn't work on browser, Only works on mobile device

PavaniDasari8 avatar Oct 16 '18 20:10 PavaniDasari8

hey guys i am having trouble while installing account kit plugin. can anyone help me ? screenshot 251

MUsman888 avatar Nov 08 '18 18:11 MUsman888

hey guys i am having trouble while installing account kit plugin. can anyone help me ? screenshot 251

please check the command that you have used to install

PavaniDasari8 avatar Nov 08 '18 18:11 PavaniDasari8