Challenge
I am facing an issue trying to send an array of locally saved images from the JavaScript side (stored in an assets folder) to both iOS and Android native sides. The native code processes the images and returns a new image successfully when using internet-based image URLs instead of local images. However, downloading each image individually is slow, especially when dealing with multiple images.
I believe the best solution would be to send the absolute paths of the images stored on the device.
What I've Attempted:
- Sending image URLs (Works but not ideal as it involves downloading each image)
Potential Solutions:
One option could be to obtain an array of base64 strings for each image. However, this process seems time-consuming as the native side would need to convert each base64 string into data and then into images.
An alternative approach could involve sending the absolute URI path for each asset. Unfortunately, finding a method to retrieve this path has proved challenging, as only relative paths have been discovered so far (e.g., './assets/myImage.png')
As per the React Native documentation (https://facebook.github.io/react-native/docs/native-modules-ios.html), the native side supports JSON standard formats, including strings, numbers, booleans, arrays, objects of any type, and React callbacks/promises.