Firebase Storage Plugin

This plugin allows you store files though firebase storage for iOS(8+), MacOS(10.13+), and Android(4.0 +)

Functions:

firebaseStorage.init(bucketUrl)

-- initialize firebase storage

bucketUrl(string)(optional) bucket to use( note no bucket url with result in using deafult bucket)

firebaseStorage.upload(filePath, pathInFirebase, listener)

filePath(path) path to file you want to upload via system.pathForFile()

pathInFirebase(string) where you want to put file in firebase

listener(function) returns event.isError(boolean), event.error(string), and event.downloadURL(string, returned on successful upload)

firebaseStorage.getDownloadURL(pathInFirebase, listener)

pathInFirebase(string) where you want to get file url in firebase

listener(function) returns event.isError(boolean), event.error(string), and event.downloadURL(string, returned if url is found)

firebaseStorage.delete(pathInFirebase, listener)

pathInFirebase(string) where you want to delete file in firebase

listener(function) returns event.isError(boolean) and event.error(string)

How do I download a file:

Setup:

Please go to your firebase console. Go to Storage>Rules and copy paste the rules in below. Make sure you download and include GoogleServices-Info.plist and put in root folder of corona project. Also add your google-services.json to your root folder and useGoogleServicesJson = true in build.settings.

Helpful Links:

Get Plugin

Example

Support