I use the react-native-file-viewer directory I want to know how to add the option to my code to Prompt the user to choose an app to open the file with .. does anyone know how to do it ?
import FileViewer from 'react-native-file-viewer';
import RNFS from 'react-native-fs';
const file = 'actions-for-db.xls';
// feel free to change main path according to your requirements
const dest = `${RNFS.DocumentDirectoryPath}/${file}`;
RNFS.copyFileAssets(file, dest)
.then(() => {
FileViewer.open(dest)
.then(() => { })
.catch(() => { })
console.log(dest);
})
.then(() => {
// success
console.log('success');
})
.catch(error => {
/* */
console.log('error');
});