Giter Club home page Giter Club logo

Comments (14)

itinance avatar itinance commented on May 12, 2024 4

Merged. Sorry for being late, didn't get a notice on this PR. I came across this one while reading thru recent pull request. Please upgrade to v2.13.

from react-native-fs.

lefoy avatar lefoy commented on May 12, 2024 2

@itinance can you please merge my PR?

from react-native-fs.

johanneslumpe avatar johanneslumpe commented on May 12, 2024

@paulondc Is there anything we can do here?

from react-native-fs.

paulondc avatar paulondc commented on May 12, 2024

Hi @johanneslumpe,

I believe by having a way to trigger the mediascanner through native-fs would be beneficial for the library, I can see this feature being useful for any application that create files under shared places which are meant to be shared across different apps (like pictures), therefore this feature would be in line with the library, since this just makes the files generated by them available in android's mediastore:

I was thinking something like:

  @ReactMethod
  public void updateMediaStore(String path, Callback callback) {
    ...
  }

What do you think about it ?

from react-native-fs.

johanneslumpe avatar johanneslumpe commented on May 12, 2024

@paulondc I'm not sure that this really belongs into the library. I'd kind of like to open this one up for discussion and see if other people think it's useful before we make a decision on this.

from react-native-fs.

pewh avatar pewh commented on May 12, 2024

+1 this is very useful for me. I cannot see downloaded image at Gallery unless restart the device

from react-native-fs.

havir avatar havir commented on May 12, 2024

+1

from react-native-fs.

hellomaya avatar hellomaya commented on May 12, 2024

When I used Android File Transfer to check the files on Android, and the folder wasn't there after mkdirs, due to this reason. It's necessary to show the folder to user, somehow, they can download their assets directly there, or the app will be complex to have function to be the same for them.

If the folder or file changes can be shown after it created, or even after the device reboot, will be good, looks like it can't for now.

Anyway, to build a native module by adding MTP scan API out of this lib is also possible, but if this lib can provide this as separate API sets, will be very helpful.

I believe this problem also happened in deleting a file, for example Image, then we can't see this change in system gallery or else.

from react-native-fs.

phillmill avatar phillmill commented on May 12, 2024

+1

from react-native-fs.

lefoy avatar lefoy commented on May 12, 2024

This is still an issue. This library needs scanFile function like rnfetchblob https://github.com/wkh237/react-native-fetch-blob/wiki/File-System-Access-API#scanfilepathstringpromise-android-only. I currently need to use both libraries only for this function. PR #155 Added this function but it was closed.

from react-native-fs.

itinance avatar itinance commented on May 12, 2024

Hm... seems that we should reactivate this mentioned PR, @lefoy
Do you want to do another PR with that?

from react-native-fs.

lefoy avatar lefoy commented on May 12, 2024

PR #544 should solve this issue. Using this method I can save images to my gallery and see them immediately. Thank you for your quick reply @itinance .

from react-native-fs.

Fsarmento avatar Fsarmento commented on May 12, 2024

Please please @itinance merge @lefoy PR. I also need to have rn-fetch-blob installed to only use scanFile.

from react-native-fs.

imamrobani avatar imamrobani commented on May 12, 2024

If you have saved the file, but it doesn't appear in the gallery, just add scanFile after success

RNFS.copyFile(imageUrl, newPath)
      .then(() => {
        RNFS.scanFile(RNFS.PicturesDirectoryPath); // add this
      })
      .catch(err => {
        const message = err?.message;
      });

it works for me, and the image immediately appears in the gallery

from react-native-fs.

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.