Here is the link: https://github.com/Uepaa-AG/p2pkit-cordova
I am facing a challenge in calling onEnabled
function while working with TypeScript. The code example works perfectly without TypeScript.
However, with TypeScript, I am struggling to properly call nested functions.
This is what I have currently:
cordova.plugins.p2pkit.enable("xyzzy", this.p2pkitCallback, function...
p2pkitCallback() {
onEnabled() {
console.log('p2pkit enabled');
cordova.plugins.p2pkit.enableProximityRanging()
cordova.plugins.p2pkit.startDiscovery('', cordova.plugins.p2pkit.HIGH_PERFORMANCE) // base64 encoded Data (bytes)=
}
The line containing 'onEnabled()' is highlighted in red. How can I refactor the code to resolve this issue?
Thank you!