Closed Septias closed 2 years ago
Workaround:
Even though the method does not exist on the instance, you can use native-api and its method getDownloadUrl
to retrieve it. I don't know if this the intended way to do it so I'll keep this issue open.
import { storage } from "@nativescript/firebase/app";
import { firebase } from "@nativescript/firebase";
import { ObservableArray } from "@nativescript/core";
const storage_instance = storage();
export default {
props: ["offer"],
data() {
return {
pictures: [],
};
},
mounted() {
storage_instance
.ref()
.child(String(this.offer.order))
.listAll()
.then((result) => {
result.items.forEach(function (item) {
firebase.storage
.getDownloadUrl({
remoteFullPath: item.fullPath,
})
.then(
function (url) {
console.log("Remote URL: " + url);
pictures.push(url);
},
function (error) {
console.log("Error: " + error);
}
);
});
})
.catch((err) => console.log(err));
},
};
Hey there,
I want to get the download URL's of some pictures from firebase-storage and I went with the naive approache to do it like this:
I looked into the firebase/storage References and some threads on Stack-overflow and this method seems to exist on
Reference
, but I somehow can't use it. What shall I do to fix this?