EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

Expose OnProgress function for Storage on WebApi flavor #1627

Open nampil opened 4 years ago

nampil commented 4 years ago

Hello Eddy Verbruggen, thanks for this great plugin.

I am building my app and since I come from the javascript world, I prefer to use the webApi version of your plugin. However, when trying to upload a file to Storage, I couldn't find a way to use the OnProgres function that is defined in the NativeApi.

For now, what I did was modify the file where the put method is defined and added a reference to an onProgress function. Screen Shot 2020-06-29 at 3 46 10 PM

Then I used this way: `let file = file let metadata = { contentType: image/jpeg } function onProgress(progress){ // Change UI with progress }

avatarRef.put(file, metadata, onProgress)`

Do you see any problem in using the plugin in this way?