0
I have a mobile app and am using the plugin ngcordova
, the cordovaSocialSharing
. But when I did like the documentation, when I click to share nothing happens.
Controller
.controller('ShareCtrl', function($ionicPlatform, $scope, $cordovaSocialSharing) {
$ionicPlatform.ready(function() {
var message = 'This is a demo message';
var subject = 'This is a demo message';
var link = 'http://somerandom.link/image.png'; // fake image
$scope.nativeShare = function() {
$cordovaSocialSharing
.share(message, subject, link); // Share via native share sheet
};
//checkout http://ngcordova.com/docs/plugins/socialSharing/
// for other sharing options
});
})
Knob
<div ng-click="shareAnywhere()" ng-controller="ExampleController" style="text-align: center">
<i style="font-size: xx-large" class="ion-android-share-alt"></i><br>
Partilhar
</div>
Did you start the app variable? Another thing, put ng-controller before ng-click. Can you share this source somewhere?
– Emir Marques
ng-controller is already up there and the app variable is initialized
– César Sousa
Even put the ng-app tag in html?
– Emir Marques
Has no index.html ng-app="Starter"
– César Sousa
index.html is the same as your html with controller?
– Emir Marques
The controller is not on another page but I am using Routes
– César Sousa
Try to put everything on the same page
– Emir Marques