0
I searched for examples but found nothing to clarify my doubt, I have no experience with Cordova (maybe that’s why I don’t know how to use the cordova-plugin-accountkit
).
this is the file code index.js
(practically 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 what my file should look like index.js
and how to call it in the index.html
Mark the answer as a solution to the problem... = D
– h3nr1ke