A
A
Alexander Petrov2021-04-15 09:12:03
iOS
Alexander Petrov, 2021-04-15 09:12:03

How to get file system permission in ios in React-Native?

I made an application that will save files locally using react-native-fs .
In the simulator on the laptop, everything worked fine.
I threw the application on the phone, through the cord locally, when the phone connects to Metro, not through the app store.
When I try to save the file, I get the error You don't have permission to save the file 'name' in the folder 'AppName' .

How to get permission to use the file system?

I found "react-native-permissions" but there is no permission on FileSystem or anything like that.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Aleksandrovich, 2021-04-15
@RomReed

I think it saves either in MediaLibrary or PhotoLibrary.
IMPORTANT: when using ExternalStorageDirectoryPath it's necessary to request permissions (on Android) to read and write on the external storage, here an example: React Native Offical Doc from the react-native-fs docs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question