从本机反应与其他应用程序共享多个图像

时间:2019-01-13 09:14:48

标签: react-native

我尝试以本机方式与其他应用(电报,Instagram等)共享多张照片,但我不知道如何在通话时共享多张图片。任何建议都会有所帮助, 谢谢

1 个答案:

答案 0 :(得分:0)

我使用此库将一个以上的图像共享到另一个应用程序。react-native-share。 这是在react native上执行此操作的简单方法。

shareImage(images) {
    const shareOptions = {
      title: 'Share file',
          urls:images,
        };
    return Share.open(shareOptions);
};

_renderShareIt(base64Items){
   let selectedImages=[]
   base64Items.map((images)=>{
      // push selected images on an array
   });
   if(selectedImages.length > 0){
        this.shareImage(selectedImages)
     }else{
        // show an alert, no image selected
     }
}

希望它是有用的:)

相关问题