I have a custom file something like file.myext
wich I create it using rn-fetch-blob
:
RNFetchBlob.fs.writeFile(path, JSON.stringify(data), 'utf8')
And I'm using react-native-share
to share the file,
I tried both:
Share.open({type: 'text/plain', url: 'file://'+path})
and
RNFetchBlob.fs.readFile(path, 'base64')
.then((data) => {
Share.open({url: 'data:text/plain;base64,'+data})
})
but doesn't work, the second one share .txt
file.
anyway to solve this?