Firebase Storage provides secure file uploads and downloads for your Firebase apps, regardless of network quality. You can use it to store images, audio, video, or other user-generated content. Firebase Storage is backed by Google Cloud Storage, a powerful, simple, and cost-effective object storage service.
Firebase Storage stores your files in a Google Cloud Storage bucket shared with the default Google App Engine app, making them accessible through both Firebase and Google Cloud APIs. This allows you the flexibility to upload and download files from mobile clients via Firebase and do server-side processing such as image filtering or video transcoding using Google Cloud Platform. Firebase Storage scales automatically, meaning that there's no need to migrate from Firebase Storage to Google Cloud Storage or any other provider.
This integration makes files accessible directly from the Google Cloud Storage gcloud client libraries, so you can use Firebase Storage with your favorite server-side languages. For more control, you can also use the Google Cloud Storage XML and JSON APIs.
Firebase Storage integrates seamlessly with Firebase Authentication to identify users, and provides a declarative security language that lets you set access controls on individual files or groups of files, so you can make files as public or private as you want.
See the public docs for Firebase Storage for the most up to date APIs, samples, and example apps.
Getting started on iOS
- Create a new project and add an iOS app to that project in the Firebase Console.
- Download and include
GoogleServices-Info.plistin your application.
Add Firebase Storage to your app
Add the following dependency to your project's
pod install and open the created
Follow these instructions to install Firebase without CocoaPods
Set up Firebase Storage
You must initialize Firebase before any Firebase app reference is created or used. If you have already done this for another Firebase feature, you can skip the following two steps.
Import the Firebase module:
FIRApp shared instance, typically in your application's
Get a reference to the storage service, using the default Firebase App:
Create a reference to a file in Firebase Storage:
Upload a file to Firebase Storage: