Share file with React Native

后端 未结 1 676
星月不相逢
星月不相逢 2021-02-14 15:14

I use { Share } from \'react-native\'. I shared message successfully, no problem.

Now, I generate dynamically a PDF and save it at local. Is it possible to share the PDF

相关标签:
1条回答
  • 2021-02-14 15:54

    I had the same problem with the share of react native. I just used this library React Native Share.

    And you can pass the url to the file in your file system and it will work properly:

     Share.open({
                    title: "This is my report ",
                    message: "Message:",
                    url: "file:///storage/emulated/0/demo/test.pdf",
                    subject: "Report",
                })
    
    0 讨论(0)
提交回复
热议问题