OGeek|极客世界-中国程序员成长平台

标题: IOS 图像共享到 WhatsApp 不起作用 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 17:21
标题: IOS 图像共享到 WhatsApp 不起作用

我正在 Ionic 框架中构建一个应用程序,您可以在其中将图片发布到提要,然后将它们分享到社交媒体。我使用 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);
        });
};

以及 View 中的 HTML:

<div class="share-image" ng-click="shareImage(item)">
    Share this picture
</div>



Best Answer-推荐答案


我在我的一个项目中使用了这种和平的代码(我对其进行了修改以使用与您的相同的变量):

你的看法

<div class="share-image" ng-click="shareImage(item)">
    Share this picture
</div>

你的 Controller

$scope.shareImage = function(item){
    window.plugins.socialsharing.share(null, null, 'item.image', null)"
};

关于IOS 图像共享到 WhatsApp 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39130284/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4