@ming-cordova:
Thank you. I’ll try
Precisions about the d.ts file :
In order to access to “window.plugins
” with TypeScript you have to add a definition :
in :
typings/globals/window/index.d.ts
(create “window
” folder and “index.d.ts
” file)
and write in index.d.ts
:
interface Window {
plugins: any;
}
This allows you to use “window.plugins” with typescript.
see my response on this thread for a more complete answer :
I’ve tried that and didn’t work, maybe it depends of the plugin
Ok nice to know this for next ones !
@MASG, Did you try this method?
success(results) {
console.log(JSON.stringify(results));
};
err(e) {
console.log(JSON.stringify(e));
};
(window as any).WifiInfo.getWifiInfo(this.success,this.err);
This method helped me to use non ionic-native plugins in my project.
Let us know if this works!
yes, I have used google maps sdk, and SQL lite plugin and some others I don’t remember. Also external libraries like JQuery for SignalR and LokiJS. Everything JS work on this to be honest. You just have to declare it on a .d.ts file or just on the .js (or.ts) file you’re gonna use.
juste use (window).plugins instead of window.plugins
Using (window as any).plugins worked for me
are you running your app in the browser…if you most plugins wont run in the browser…Plugins mostly run on the emulator or real device