2017-01-23 7 views
0

whatsapp、facebookなどでCordova Social Sharingと製品のリストを共有しようとしています。 私は、私は多くのことを試してみましたが、何も動作するように見えない、それが送られた唯一のことは、常に「[]」CordovaソーシャルシェアリングでJson Arrayを共有する

であるので、ここで私のHTMLボタンを

<button id="comp-list" ng-click="OtherShare()" class="button button-block button-success item-icon-left" > 
      <i class="icon ion-share"></i> 
      Share 
    </button> 

だと、これは一部であり、それをStringfying試してみました私のコントローラで責任があります

for(var i=0; i<$scope.products.length; i++){ 
    var prodValue = {price:$scope.products[i].price, quantity:$scope.products[i].quantity}; 
    prodValue.price= $scope.products[i].price; 
    prodValue.quantity= $scope.products[i].quantity; 
    $scope.shareList[$scope.products[i].name] = prodValue; 
} 
$scope.OtherShare=function(){ 
    window.plugins.socialsharing.share($scope.shareList, null, null, 'www.google.com'); 
}; 

だから誰も私はこのプラグインを使用して "shareList"の配列を共有する必要があります知っている? whatsappでshareListのコンテンツを共有するのに役立つものは何でも構いません。 =)

感謝:)

答えて

0

ソーシャルメディアを経由して

window.plugins.socialsharing.share(JSON.stringify($scope.shareList), null, null, 'www.google.com'); 
を共有しながら、テキストを糸する必要があります