-
Notifications
You must be signed in to change notification settings - Fork 970
Closed
Labels
bugos: androidstaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Steps to reproduce
- Install react-native-share
- Copy paste this code - https://github.com/react-native-community/react-native-share#example-code
- Run; and try this
shareImagemethod -
const shareImageBase64 = {
title: 'React native',
// message: 'Test 1 2 3',
type: 'image/png',
};
const shareImage = (
fileUrl = 'https://yt3.ggpht.com/a/AGF-l7-BBIcC888A2qYc3rB44rST01IEYDG3uzbU_A=s900-mo-c-c0xffffffff-rj-k-no',
type = 'image/png',
) => {
let filePath = null;
// let fileUrlLength = fileUrl.length;
const configOptions = { fileCache: true };
RNFetchBlob.config(configOptions)
.fetch('GET', fileUrl)
.then((resp) => {
filePath = resp.path();
return resp.readFile('base64');
})
.then(async (base64Data) => {
const imageBase64 = `data:${type};base64,${base64Data}`;
await Share.open({ ...shareImageBase64, url: imageBase64 });
// console.log(imageBase64, { ...shareImageBase64, url: imageBase64 });
// remove the image or pdf from device's storage
await RNFetchBlob.fs.unlink(filePath);
});
};Actual behaviour
Messenger: https://imgur.com/a6IgLTg
Whatsapp: https://imgur.com/E8PAVlh
Environment
- React Native version: 0.59.9
- React Native platform + platform version: Android 8.1
react-native-share
Version: npm version 1.2.1
Metadata
Metadata
Assignees
Labels
bugos: androidstaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.