How to implement cordova-plugin-accountkit in my cordova project?

0

I searched for examples but found nothing to elucidate my doubt, I have no experience with cordova (maybe that's why I do not know how to use cordova-plugin-accountkit ).

This is the code for the file index.js (pretty much the way it was downloaded):

var app = {
// Application Constructor
initialize: function() {
    document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},

// deviceready Event Handler
//
// Bind any cordova events here. Common events are:
// 'pause', 'resume', etc.
onDeviceReady: function() {
    this.receivedEvent('deviceready');
},

// Update DOM on a Received Event
receivedEvent: function(id) {
    var parentElement = document.getElementById(id);
    var listeningElement = parentElement.querySelector('.listening');
    var receivedElement = parentElement.querySelector('.received');

    listeningElement.setAttribute('style', 'display:none;');
    receivedElement.setAttribute('style', 'display:block;');

    console.log('Received Event: ' + id);

//código do account kit que eu não sei o que fazer com ele

    loginWithPhoneNumber: function(options, onSuccess, onFailure) {
        options = {
            defaultCountryCode: "BR",
            facebookNotificationsEnabled: true,
            initialPhoneNumber: ["55", "123456789"]
        };
        function sucess(params){
            console.log(params);
        }
        function failure(params){
            console.log(params);
        }
        AccountKitPlugin.loginWithPhoneNumber(options, onSuccess, onFailure);
    },

   },
};

app.initialize();

I just wanted to know how my file index.js should be and how to call it in index.html

    
asked by anonymous 30.05.2017 / 19:03

1 answer

0

I decided to change the plugin I used this one and only needed the documentation;

link

I left my question here if anyone encountered the same problem.

    
31.05.2017 / 20:41