2016-05-30 136 views
1

我正在處理React Native應用程序中的一個選項,以便從Realm數據庫獲取數據,將其轉換爲csv並通過電子郵件發送。 我打算使用react-native-mail來發送帶附件的電子郵件。用反應保存文件原生

如何在用戶的設備上保存文本文件,以便我可以使用react-native-mail(或用於任何其他目的)將其提供給本機電子郵件應用程序?

回答

1

我還沒有嘗試過,但你有看看:https://github.com/Murriouz/react-native-file-manager?如果這不符合您的需求,並且您無法在其中找到其他選項,那麼最好的辦法就是編寫您自己的本地模塊。該文檔有這樣做的一些細節:http://facebook.github.io/react-native/docs/native-modules-ios.html#content

+1

看起來像這個模塊是關聯到這一個:https://github.com/johanneslumpe/react-native-fs(它有更多和最近提交) – amirfl

+0

啊好找。我通常使用http://react.parts來搜索反應原生插件。無論如何,它有一個體面的名單。 – agmcleod

+0

@amirfl似乎react-native-fs已經停產。請改用[https://github.com/wkh237/react-native-fetch-blob](https://github.com/wkh237/react-native-fetch-blob)。 –