Background Video Upload to Firebase Storage with Flutter. Seems like the Firebase team are planning on adding this feature. We’ll use the flutter_uploader plugin to perform the background uploads. It’s based on WorkManager in Android and NSURLSessionUploadTask in iOS, which are the platform specific ways to perform upload tasks that continue in the background, even after exiting the app.
I’ve written a few posts about video uploading to Firebase Storage from Flutter.
One thing that I have found really missing is background uploads — a way to upload large video files that will continue uploading even if the app is closed.
Seems like the Firebase team are planning on adding this feature, but in the meanwhile, here is an alternative way to accomplish it.
We’ll use the flutter_uploader plugin to perform the background uploads. It’s based on WorkManager in Android and NSURLSessionUploadTask in iOS, which are the platform specific ways to perform upload tasks that continue in the background, even after exiting the app.
The plugin can only upload via a URL though, which is something that the Firebase client SDKs don’t provide. So we’ll outsource generating the upload URL to a Cloud Function.
These are the steps each video will go through:
1. Client creates a new doc in Firestore, with the raw video path.
uploadNewVideo Cloud Function is triggered by document creation.
3. The Cloud Function generates a resumable upload url pointing to a new file in Cloud Storage.
4. The Cloud Function updates the Firestore doc with the upload url.
5. Client receives updated doc with upload url, generates thumbnails, and uploads video in the background.
6. On upload complete, the newStorageFile Cloud Function is triggered, setting the uploadComplete field in Firestore to true.
7. Client generates a permanent download url and saves it to Firestore.
Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web
Are you looking for next-generation mobile applications to increase business benefits? **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")** is one of the most reputable mobile app development company, which provides Flutter...
Are you planning for creating a native-like cross-platform app for your venture? **[Hire Dedicated Flutter Developer](https://hourlydeveloper.io/hire-dedicated-flutter-app-developer/ "Hire Dedicated Flutter Developer")** to develop cross-platform...
Mismanagement of multi-cloud expense costs an arm and leg to business and its management has become a major pain point. Here we break down some crucial tips to take some of the management challenges off your plate and help you optimize your cloud spend.
Hire Flutter Developers from foremost Flutter app development company, Skenix Infotech to get a full spectrum of cross-platform flutter development services.