2

I'm writing a React Native native module for Android (I'll need to do this for iOS later, so am also interested in how to do it there, but right now I only need to do this on Android), and I have a requirement to take a URI and use it to fetch an image (which I need to get as a Bitmap, because it needs to be passed to the system for display in a notification). I have good reason to believe that the image in question is likely to have previously been displayed in a standard React Native <Image/> component, so rather than download it again I'd ideally like to get it out of the cache.

I understand that React Native uses Fresco to perform image loading and caching, and can see instructions on how to get a Bitmap from Fresco ... but Fresco's a large, complicated library, and I'm not really sure how to get access to the (presumably) already instantiated and configured pipeline. Is there any sample code available that shows how to do this?

Jules
  • 14,841
  • 9
  • 83
  • 130

0 Answers0