react-nativephotokitcamera-roll

React-Native: How do I find file info for a ph:// uri?


I'm using the CameraRoll in React-Native 0.59.3 to fetch photos from the library. I get back the following information:

height: 3024
isStored: true
playableDuration: 0
uri: "ph://CC95F08C-88C3-4012-9D6D-64A413D254B3/L0/001"
width: 4032

How do I get the filename, filesize, mimetype, and normal URI from this information? What is the purpose of this new ph:// uri?


Solution

  • once you get those details successfully you can return promise to set the uri to your local state so you can use it.

    something like:

    this.setState({imageSrc: uri})