How can I download files from 'react-native' or 'Expo' to 'icloud drive'?

I am trying to create a file and download it to the device directory.

I use react-native-fetch-blob Also I had react-native-fs

It is easy to download from Android and can check and read files directly from the actual device.

The file I’m talking about is a string file made of json, not a picture or video.

The directory path I use in Android:

const dirs = RNFetchBlob.fs.dirs
dirs.DownloadDir
...
 RNFetchBlob.fs
    .writeFile(path, data, "utf8")
    .then(success => {
      console.log("FILE WRITTEN!");
    })
    .catch(err => {
      console.log(err.message);
    });

But the problem is the iPhone. I have already checked the cloud documents and CloudKit through the developer account in Xcode.

Although it succeeded in using dirs.DocumentDir to execute the download, it ran the file app from the actual device and tried to go inside by clicking on icloud drive but the file was not visible, just empty.

How can I download to Icloud Drive?

Also How do I create a file from ‘react-native’ to ‘On my iPhone’ as shown in the picture below?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.