我正在Ionic Framework中构建一个应用程序,您可以将图片发布到Feed,然后将其分享给Social Media . 我使用Cordova插件SocialSharing . 在Android上,与WhatsApp共享图片工作正常 . 在iPhone上,它只与图像共享文本,但不与图像本身共享 . 共享到Facebook(例如)在两个设备上都正常工作 .
知道为什么它不能在iPhone上运行WhatsApp吗?
这是在controllers.js中的代码:
$scope.shareImage = function (item) {
$cordovaSocialSharing
.share(item.note.text, null, item.image, null)
.then(function (result) {
}, function (err) {
console.log(err);
});
};
并且视图中的HTML:
<div class="share-image" ng-click="shareImage(item)">
Share this picture
</div>
1 回答
我在我的一个项目中使用了这段代码(我将其修改为使用与您相同的变量):
你的看法
你的控制器