Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

react native - How to add a prompt option to the user while choosing an app to open the file with?

$
0
0

I use the react-native-file-viewer directoryI want to know how to add the option to my code toPrompt 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');            });

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>