-
Notifications
You must be signed in to change notification settings - Fork 28
Firebase Storage API
Luis Rodriguez edited this page Aug 2, 2018
·
1 revision
Note: The Firebase Storage API is not yet completed. Help is more than welcomed.
As always, include the Firebase libraries in your .unoproj
"Projects": [
"../src/Firebase/Firebase.unoproj",
"../src/Firebase.Database/Firebase.Database.unoproj"
]
Add the storage library
"Projects": [
"../src/Firebase.Storage/Firebase.Storage.unoproj"
]
Require it in your JS file
var Storage = require("Firebase/Storage");
Currently, you can upload an image and it will return the url
var Storage = require("Firebase/Storage");
var CameraRoll = require("FuseJS/CameraRoll");
function uploadPicture(){
CameraRoll.getImage()
.then(function(image) {
var path = "pictures/myPicture.jpg";
var img = image.path;
Storage.upload(path,img)
.then(function(res){
console.log(res)
}).catch(function(err){
console.log(err)
})
});
}