Telerik-Verified-Plugins / SocialSharing

This PhoneGap plugin allows you to share text, an image, or a URL (or all three) via the native sharing widget of your Android, iOS or WP8 device.
27 stars 6 forks source link

TypeError: window.plugins is undefined #12

Closed diazpaul closed 8 years ago

diazpaul commented 8 years ago

I installed this plugin by telerik platform, I don't know if it need more configuration. i just write this code :

<a href="#" class="icono-navbar" onclick="window.plugins.socialsharing.share('Message only')"> <i class="fa fa-share-alt" aria-hidden="true"></i> </a>

Regards

EddyVerbruggen commented 8 years ago

How are you running the app? Web, simulator, companion app, real device? And is this iOS or Android?

diazpaul commented 8 years ago

Hi, in web simulator and real device, Android.

diazpaul commented 8 years ago

Is there any way to solve it?

EddyVerbruggen commented 8 years ago

Share your entire index.html and I may take a look.

diazpaul commented 8 years ago

it's all in spanish

index.txt

EddyVerbruggen commented 8 years ago
diazpaul commented 8 years ago

This is the repository: https://github.com/diazpaul/efecto_cocuyo_app i installed the plugin again, but now the error is this: Uncaught TypeError: Cannot read property 'socialsharing' of undefined

EddyVerbruggen commented 8 years ago

i don't see SocialSharing in the list of plugin in your project

diazpaul commented 8 years ago

that's weird!, i reinstalled the plugin, then the error was other, Uncaught TypeError: Cannot read property 'socialsharing' of undefined, then i replaced var cordova = require('cordova'); to var cordova = window.cordova; and it works now. Thanks for answer.

praveen-vasudhaika commented 6 years ago

@diazpaul, the same change worked for me as well!!