Window.plugins is undefined in ngcordova


#1

Hi,

I am using the cordova social share plugin in my app. Whenever I click on the share button (I’m calling shareAnywhere() on ng-click I get TypeError: Cannot read property 'socialsharing' of undefined and it occurs on line 6238 of ngcordova.js which is the following line:

$window.plugins.socialsharing.share(message, subject, file, link, function () {

Why is window.plugins undefined?


#2

Are you testing in a browser or on an actual device?


#3

Both. On browser I get the error message in console. On my Android device nothing happens when I click on the share button.


#4

Plugins will never work in the browser, so that error message is normal.

The fact that nothing happens on your device must mean you’ve done something wrong. Debug and check your code to see if everything is correct


#5

use this and then check, ionic state restore


#6

Hi Same issue is there with me. its not working.