FirebaseStorage Framework Reference

Classes

The following classes are available globally.

  • StorageReference represents a reference to a Google Cloud Storage object. Developers canupload and download objects, as well as get/set object metadata, and delete an object at thepath. See theCloud docs for more details.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageReference)openclassStorageReference:NSObject
  • Firebase Storage is a service that supports uploading and downloading binary objects,such as images, videos, and other files to Google Cloud Storage. Instances ofStorageare not thread-safe, but can be accessed from any thread.

    If you callStorage.storage(), the instance will initialize with the defaultFirebaseApp,FirebaseApp.app(), and the storage location will come from the providedGoogleService-Info.plist.

    If you provide a custom instance ofFirebaseApp,the storage location will be specified via theFirebaseOptions.storageBucket property.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorage)openclassStorage:NSObject
  • StorageDownloadTask implements resumable downloads from an object in Firebase Storage.

    Downloads can be returned on completion with a completion handler, and can be monitored by attaching observers, or controlled by callingpause(),resume(), orcancel().

    Downloads can currently be returned asData in memory, or as aURL to a file on disk.

    Downloads are performed on a background queue, and callbacks are raised on the developer specifiedcallbackQueue in Storage, or the main queue if left unspecified.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageDownloadTask)openclassStorageDownloadTask:StorageObservableTask,StorageTaskManagement
  • Contains the prefixes and items returned by aStorageReference.list() call.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageListResult)openclassStorageListResult:NSObject
  • Class which represents the metadata on an object in Firebase Storage.

    This metadata is returned on successful operations, and can be used to retrieve download URLs, content types, and a Storage reference to the object in question. Full documentation can be found in theGCS documentation

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageMetadata)openclassStorageMetadata:NSObject
  • An extendedStorageTask providing observable semantics that can be used for responding to changes in task state.

    Observers produce aStorageHandle, which is used to keep track of and remove specific observers at a later date.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageObservableTask)openclassStorageObservableTask:StorageTask
  • A superclass to all Storage tasks, includingStorageUploadTask andStorageDownloadTask, to provide state transitions, event raising, and common storage for metadata and errors.

    Callbacks are always fired on the developer-specified callback queue. If no queue is specified, it defaults to the main queue. This class is thread-safe.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageTask)openclassStorageTask:NSObject
  • StorageTaskSnapshot represents an immutable view of a task.A snapshot contains a task, storage reference, metadata (if it exists),progress, and an error (if one occurred).

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageTaskSnapshot)openclassStorageTaskSnapshot:NSObject
  • StorageUploadTask implements resumable uploads to a file in Firebase Storage.

    Uploads can be returned on completion with a completion callback, and can be monitored by attaching observers, or controlled by callingpause(),resume(), orcancel().

    Uploads can be initialized fromData in memory, or a URL to a file on disk.

    Uploads are performed on a background queue, and callbacks are raised on the developer specifiedcallbackQueue in Storage, or the main queue if unspecified.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageUploadTask)openclassStorageUploadTask:StorageObservableTask,StorageTaskManagement

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-07-30 UTC.