I’m in an infinite loop here trying to figure out a very simple procedure.
I have 1000 images in a folder on my desktop.
I want to use a cloud storage/database (Firebase/Firestore) to hold just the images. I don’t want to have the user add images, or delete images or react with the images in any way. No text. No data. No login. No user verification. Just images. When a user starts the app and they go to a screen there is an image on the screen that comes from a server, not from “inside” the app.
Then, when I run my app, I can have my images uri/url pointing to the images on the sever.
So, currently I have a .js component that has an object:
const Images = {
Inset5_1: require("./img/Inset5_1.jpg"),
Main5_1: require("./img/Main5_1.jpg"),
Inset6_1: require("./img/Inset6_1.jpg"),
Main6_1: require("./img/Main6_1.jpg"),
Inset6_2: require("./img/Inset6_2.jpg"),
Main6_2: require("./img/Main6_2.jpg"),
etc...
};
export default Images;
which I want to change to:
const Images = {
Inset5_1: require("./firebaseUrl/Inset5_1.jpg"),
Main5_1: require("./firebaseUrl/Main5_1.jpg"),
etc
For example, currently my Image source looks like this: source={Images[imageName]}
Then I can dump the entire images folder onto my ftp web site and change the app uri to:
<Image style={styles.img} source={{uri: `https://mydomainname.com/appImageFolder/${imageName}.jpg`}} />
and that works just fine and dandy.
But, when using firebase everything I am finding is assuming you want a user to take a photo or select a photo and upload it when all I want is to reference image files in cloud storage. It’s all very messy and unnecessarily complicated with functionality I don’t need.
Can someone point me in the direction of where I can find a simple example to just get images, after uploading them once, without using the app as the upload device.