Hi Guys, I’m using the plugin cordovaSocialShare of NgCordova to make sharing on social networks in my application. The problem is that I don’t have actions returned, and when analyzing the ADB logs, it returns me the following error:
I / chromium (3635): [INFO: ISLAND (20306)] "TypeError: Can not call method 'canShareVia' of undefined
I / chromium (3635): Scope at $ scope.shareViaWhatsapp. (File: ///android_asset/www/js/app.js: 22: 31)
Look at the code:
HTML:
<ion-option-button class="button-dark button-facebook" ng-click="shareAnywhere()">
<i class="icon ion-social-facebook icon-facebook"></i>
</ion-option-button>
AngularJS:
$ionicPlatform.ready(function(){
$scope.shareViaWhatsapp = function(message, image, link) {
$cordovaSocialSharing.canShareVia("whatsapp", message, image, link).then(function(result) {
$cordovaSocialSharing.shareViaWhatsapp(message, image, link);
}, function(error) {
alert("Cannot share on Whatsapp");
});
}
$scope.shareAnywhere = function() {
$cordovaSocialSharing.share("This is your message", "This is your subject", "www/imagefile.png", "http://blog.nraboy.com");
}
});
Help me please?