FirebaseStorage Framework Reference

FIRStorage


@interface FIRStorage : 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 of Storage are not thread-safe, but can be accessed from any thread. If you call Storage.storage(), the instance will initialize with the default FirebaseApp, FirebaseApp.app(), and the storage location will come from the provided GoogleService-Info.plist. If you provide a custom instance of FirebaseApp, the storage location will be specified via the FirebaseOptions.storageBucket property.

  • The default Storage instance.

    returns: An instance of Storage, configured with the default FirebaseApp.

    Declaration

    Objective-C

    + (FIRStorage *_Nonnull)storage;
  • A method used to create Storage instances initialized with a custom storage bucket URL. Any StorageReferences generated from this instance of Storage will reference files and directories within the specified bucket. \param url The gs:// URL to your Firebase Storage bucket.

    returns: A Storage instance, configured with the custom storage bucket.

    Declaration

    Objective-C

    + (FIRStorage *_Nonnull)storageWithURL:(NSString *_Nonnull)url;
  • Creates an instance of Storage, configured with a custom FirebaseApp. StorageReferences generated from a resulting instance will reference files in the Firebase project associated with custom FirebaseApp. \param app The custom FirebaseApp used for initialization.

    returns: A Storage instance, configured with the custom FirebaseApp.

    Declaration

    Objective-C

    + (FIRStorage *_Nonnull)storageForApp:(FIRApp *_Nonnull)app;
  • Creates an instance of Storage, configured with a custom FirebaseApp and a custom storage bucket URL. \param app The custom FirebaseApp used for initialization.

    \param url The gs:// url to your Firebase Storage bucket.

    returns: the Storage instance, configured with the custom FirebaseApp and storage bucket URL.

    Declaration

    Objective-C

    + (FIRStorage *_Nonnull)storageForApp:(FIRApp *_Nonnull)app
                                      URL:(NSString *_Nonnull)url;
  • app

    The FirebaseApp associated with this Storage instance.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) FIRApp *_Nonnull app;
  • The maximum time in seconds to retry an upload if a failure occurs. Defaults to 10 minutes (600 seconds).

    Declaration

    Objective-C

    @property (nonatomic) NSTimeInterval maxUploadRetryTime;
  • The maximum time in seconds to retry a download if a failure occurs. Defaults to 10 minutes (600 seconds).

    Declaration

    Objective-C

    @property (nonatomic) NSTimeInterval maxDownloadRetryTime;
  • The maximum time in seconds to retry operations other than upload and download if a failure occurs. Defaults to 2 minutes (120 seconds).

    Declaration

    Objective-C

    @property (nonatomic) NSTimeInterval maxOperationRetryTime;
  • Specify the maximum upload chunk size. Values less than 256K (262144) will be rounded up to 256K. Values above 256K will be rounded down to the nearest 256K multiple. The default is no maximum.

    Declaration

    Swift

    @objc
    public var uploadChunkSizeBytes: Int64
  • A DispatchQueue that all developer callbacks are fired on. Defaults to the main queue.

    Declaration

    Objective-C

    @property (nonatomic, strong) dispatch_queue_t _Nonnull callbackQueue;
  • Creates a StorageReference initialized at the root Firebase Storage location.

    returns: An instance of StorageReference referencing the root of the storage bucket.

    Declaration

    Objective-C

    - (FIRStorageReference *_Nonnull)reference;
  • Creates a StorageReference given a gs://, http://, or https:// URL pointing to a Firebase Storage location. For example, you can pass in an https:// download URL retrieved from StorageReference.downloadURL(completion:) or the gs:// URL from StorageReference.description. \param url A gs // or https:// URL to initialize the reference with.

    throws: Throws a fatal error if url is not associated with the FirebaseApp used to initialize this Storage instance.

    returns: An instance of StorageReference at the given child path.

    Declaration

    Objective-C

    - (FIRStorageReference *_Nonnull)referenceForURL:(NSString *_Nonnull)url;
  • Creates a StorageReference initialized at a location specified by the path parameter. \param path A relative path from the root of the storage bucket, for instance @“path/to/object”.

    returns: An instance of StorageReference pointing to the given path.

    Declaration

    Objective-C

    - (FIRStorageReference *_Nonnull)referenceWithPath:(NSString *_Nonnull)path;
  • Configures the Storage SDK to use an emulated backend instead of the default remote backend. This method should be called before invoking any other methods on a new instance of Storage.

    Declaration

    Objective-C

    - (void)useEmulatorWithHost:(NSString *_Nonnull)host port:(NSInteger)port;
  • Undocumented

    Declaration

    Objective-C

    - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT;
  • Undocumented

    Declaration

    Objective-C

    - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSUInteger hash
  • Undocumented

    Declaration

    Objective-C

    - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");