Reputation: 53
I'm building an app in Ionic Framework where you can post pictures to a feed and then share them to Social Media. I use the Cordova plugin SocialSharing. On Android, sharing a picture to WhatsApp works fine. On iPhone it only shares the text with the image but not the image itself. Sharing to Facebook (for example) is working fine on both devices.
Any idea why it's not working in WhatsApp on an iPhone?
This is the code that's in controllers.js:
$scope.shareImage = function (item) {
$cordovaSocialSharing
.share(item.note.text, null, item.image, null)
.then(function (result) {
}, function (err) {
console.log(err);
});
};
And the HTML in the view:
<div class="share-image" ng-click="shareImage(item)">
Share this picture
</div>
Upvotes: 2
Views: 993
Reputation: 1654
I used this peace of code in one of my projects (I modified it to use same variables as yours):
Your view
<div class="share-image" ng-click="shareImage(item)">
Share this picture
</div>
Your controller
$scope.shareImage = function(item){
window.plugins.socialsharing.share(null, null, 'item.image', null)"
};
Upvotes: 0