Window.plugin is always undefined


#1

Hi,
I’m getting window.plugin as undefined all the time. I’ve tried both ionic.Platform.ready() and $ionicPlatform.ready() but still no luck :frowning:

 $ionicPlatform.ready(function() {
    console.log(window.plugin);
    if (window.plugin) 
    {
      var div = document.getElementById("map_canvas");
    }
});

I/Web Console(10313): undefined at file:///android_asset/www/js/app.js:15

#2

Thats because your browsers does not support the window plugins, if you launch it on your device it probably will


#3

you could take a look at Ripple emulator for chrome on desktop: https://chrome.google.com/webstore/detail/ripple-emulator-beta/geelfhphabnejjhdalkjhgipohgpdnoc

But i recommend testing on real devices really, ripple is great, but it kinda sucks if you comapre it to real devices


#4

Actually I’ve tried it on my andrdoid device and I got this error using logcat.


#5

Oh strange, i’ll try to recreate the bug.