如何通过离子应用分享WhatsApp的图像

问题描述:

需要对cordovaSocialShare插件 我想分享通过WhatsApp的这是在我的应用离子选择图像有点帮助,但我不能够共享图像如何通过离子应用分享WhatsApp的图像

<form name = myForm controller="ExampleController" ng- 
submit="ShareAnywhere(myForm)"> 
<div class="myDivClass"> 
<input type="file" ng-model="share.shareImage"> 
<button ng-click="Submitted=true">Share</button> 
</div> 
<form> 

和下面进入我的控制器

app.controller('ExampleController',function($scope, $cordovaSocialSharing, $filter){ 
$scope.shareAnywhere=function(myForm){ 


    var eDate = new Date(); 
    var message = "Hi! this is an wahtsapp msg"; 
    var image = this.share.shareImage; 
    var link = 'http://myAwsomeWebsite.com'; 
    var subject = 'My Subject'; 
    $cordovaSocialSharing.share(message, subject, image, link); 
} 
}); 

我能够共享文本,但它不会与它添加图像

我可能会做它完全WR ong请让我知道什么是正确的方式来做到这一点在此先感谢

参数图像应该是图像的路径(URL)。而不是图像数据。

+0

感谢您的回复enRaiser请你让我知道如何获取文件的URL? – Ravi

+0

https://*.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav – enRaiser

+0

Please accept and upvote for我的答案。 – enRaiser