I am using Ionic with Typescript. I need to access the following api:
load(key, successCallback/*(value)*/, failCallback)
In Typescript I do the following:
cordova.plugins.icloudkv.load('key').then((data) => {
console.log(data);
alert('load key: ' + JSON.stringify(data));
});
}
}).catch((e) => {
console.error(JSON.stringify(e));
this.doAlert('iCloud: ' + JSON.stringify(e));
});
However, the alert is never getting fired.
Question
Please can someone advise what's the best way to invoke the javascript function using typescript?
Thanks
cordova.plugins.icloudkv.load('key', () =>{}, () =>{})??cordova.plugins.icloudkv.load('key', this.someClassMethod, this.someOtherClassMethod);thismay behave in unexpected ways if you do so.