Code Monkey home page Code Monkey logo

Comments (10)

RonRadtke avatar RonRadtke commented on July 20, 2024 1

Yes there is. createFile will resolve the promise upon file creation.
So you can use another library e.g. https://github.com/zo0r/react-native-push-notification to create a notification on promise resolve.

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 20, 2024 1

The documentDir refers to the apps internal directory so you can't see it from any other app. You would need root access for that

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 20, 2024 1

We will run into a problem here.
In general with Android 10 / 11, following Apps are not allowed to access files outside of their scope anymore.
So we would be able to store the files outside of the apps directory (e.g. in the public Download directory) but the App would not be able to access it without a user opening it over a file picker.
Only exception would be using certain media file collections like the gallery for images.
One reason for this is exactly what you want to mitigate - that data the app created gets deleted when the app is uninstalled. The best probably would be to first store the file in the apps scope and then copy / move it to another, public location. But currently the app can't do the last part.

from react-native-blob-util.

arunahuja94 avatar arunahuja94 commented on July 20, 2024

Hi @RonRadtke Thanks,

Whenever I create a Directory using

ReactNativeBlobUtil.fs.mkdir(ReactNativeBlobUtil.fs.dirs.DocumentDir + '/foldername')

Directory is created and I am able to check that by

ReactNativeBlobUtil.fs.exists

But I am not able to see that directory in physical device

from react-native-blob-util.

arunahuja94 avatar arunahuja94 commented on July 20, 2024

Is there a way or a workaround to create file anywhere else other than apps internal storage , as whenever I clear data of my app those files also gets deleted

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 20, 2024

Yes, you can use the downloadDir or the external storage directly. But keep in mind that you might need to request additional permissions for that.

from react-native-blob-util.

arunahuja94 avatar arunahuja94 commented on July 20, 2024

Can you please share a snippet for that

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 20, 2024

Tested it myself first. Seems like there are some problems with Android 10 / 11 at the moment.
For these Android versions all paths will be in the apps directory.
Some changes to use the media files api would be required here, so we can use predefined, global locations.
But I'm not sure yet when exactly I will get to implement this

from react-native-blob-util.

arunahuja94 avatar arunahuja94 commented on July 20, 2024

Okay thanks

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 20, 2024

0.14.0 was released yesterday implementing the possibility to store files in e.g. the download collection.

from react-native-blob-util.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.