react-native-fs icon indicating copy to clipboard operation
react-native-fs copied to clipboard

save to "files" in IOS

Open roo12312 opened this issue 2 years ago • 2 comments

Hi, I'm unable to find a proper guide to storing a file in the "files app" in IOS Platform using RNFS. can someone help me, please?

roo12312 avatar Mar 22 '23 22:03 roo12312

If I am correct, you cannot directly save files to 'Files' app. You can only open 'Share'. https://reactnative.dev/docs/share From there the user have to click 'Save to Files'. iOS does not give access to Files

There is another option, but I have not used it. You have to first save the file in the app sandbox, then expose the folder to Files app.

ravirajn22 avatar Mar 27 '23 12:03 ravirajn22

Hi, I'm unable to find a proper guide to storing a file in the "files app" in IOS Platform using RNFS. can someone help me, please?

You need to setup your iOS project in Info.PLIST

Set those with YES: Application supports iTunes file sharing (YES) Supports opening documents in place (YES) Application requires iPhone environment (YES)

Also point in your code the right directory. Something like "RNFS.DocumentDirectoryPath" It will work like charm.

jrmendonca avatar Oct 31 '23 23:10 jrmendonca