图像+消息未在社交媒体上共享IOS反应原生

时间:2019-05-23 10:13:02

标签: react-native

我尝试使用react-native-share和Share类的react native,但是image(base64)和消息一起不共享,仅适用于IOS WhatsApp。

这是我的代码

_captureScreenIos(itemId) {
    this.changeLoaderStatus();
    var thisFun = this;
    var viewShotRef = itemId;
     captureRef(this.screenshot[itemId],{format: 'jpg',quality: 0.8}).then(res => {
       RNFetchBlob.fs.readFile(res, 'base64').then((base64data) => {
         console.log("base64data",base64data)
         let base64Image = `data:image/jpeg;base64,${base64data}`;
         const shareOptions = {
           title: "My Beauty Squad",
           //message: "Download my beauty squad with below link."+ "\n" + "https://itunes.apple.com/uk/app/my-beauty-squad/id1454212046?mt=8"+ "\n" +base64Image ,
           url: base64Image,
           subject: "Share news feed"
         };
         Share.share(shareOptions);
         thisFun.changeLoaderStatus();
       })
     }).catch(error => {
       console.log(error, 'this is error');
       this.changeLoaderStatus();
     })
    }

如果有人有相同的解决方案,请帮助我...谢谢。

0 个答案:

没有答案