I added a method to a plugin in the plugins folder. I already tested it on native cordova project. It works great. But the ionic has a wrapper for this plugin. Now I just want to bypass the ionic wrapper and access the cordova js API to call a method.
Ok, to ignore the typescript errors you can just declare an any variable like let myPlugin: any = ionicPlugin; and you be able to call whatever you want. It’s an ugly way, necessary for special reasons.
Now I found out, that the ble variable es accessible in global scope (window).
console.log(Object.keys((<any>window).ble));
result: All original methods, but not my custom added. In a native cordova project it worked. Maybe the ionic has to re-build it. But how? The changes are not yet built on installed app. (using ionic cordova run android -lc)
I’ll test to reinstall the android platform.
Right, I already using it. But the wrapper is not actual up to date. Because I’ve just updated the cordova plugin. To test the new method, I easiely bypass the ionic wrapper. In up coming releases (if my pull-request gonna be merged), the ionic wrapper should be updated too.
In this case I just updated the source files in the ionic project /plugins/ble/ folder (www for the JS API and src/android test it.
Otherwise I have to wait until the the ionic wrapper is updated. Or I have to fork it, publish to npm and update my packages. A long way. Actually I have no idea how the workflow is until ionic updated the wrapper to the latest plugin version.