FIRStorage


@interface FIRStorage : NSObject

FirebaseStorage is a service that supports uploading and downloading binary objects, such as images, videos, and other files to Google Cloud Storage.

If you call [FIRStorage storage], the instance will initialize with the default FIRApp, [FIRApp defaultApp], and the storage location will come from the provided GoogleService-Info.plist.

If you call [FIRStorage storageForApp:] and provide a custom instance of FIRApp, the storage location will be specified via the FIROptions#storageBucket property.

  • Creates an instance of FIRStorage, configured with the default FIRApp.

    Declaration

    Swift

    class func storage() -> Self

    Objective-C

    + (nonnull instancetype)storage;

    Return Value

    the FIRStorage instance, initialized with the default FIRApp.

  • Creates an instance of FIRStorage, configured with the custom FIRApp @a app.

    Declaration

    Swift

    class func storage(app: FIRApp) -> Self

    Objective-C

    + (nonnull instancetype)storageForApp:(nonnull FIRApp *)app;

    Parameters

    app

    The custom FIRApp used for initialization.

    Return Value

    the FIRStorage instance, initialized with the custom FIRApp.

  • Creates an instance of FIRStorage, configured with a custom storage bucket @a url.

    Declaration

    Swift

    class func storage(url: String) -> Self

    Objective-C

    + (nonnull instancetype)storageWithURL:(nonnull NSString *)url;

    Parameters

    url

    The gs:// url to your Firebase Storage Bucket.

    Return Value

    the FIRStorage instance, initialized with the custom FIRApp.

  • Creates an instance of FIRStorage, configured with a custom FIRApp @a app and a custom storage bucket @a url.

    Declaration

    Swift

    class func storage(app: FIRApp, url: String) -> Self

    Objective-C

    + (nonnull instancetype)storageForApp:(nonnull FIRApp *)app
                                      URL:(nonnull NSString *)url;

    Parameters

    app

    The custom FIRApp used for initialization.

    url

    The gs:// url to your Firebase Storage Bucket.

    Return Value

    the FIRStorage instance, initialized with the custom FIRApp.

  • app

    The Firebase App associated with this Firebase Storage instance.

    Declaration

    Swift

    var app: FIRApp { get }

    Objective-C

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

    Declaration

    Swift

    var maxUploadRetryTime: TimeInterval { get set }

    Objective-C

    @property (assign, readwrite, atomic) NSTimeInterval maxUploadRetryTime;
  • Maximum time in seconds to retry a download if a failure occurs. Defaults to 10 minutes (600 seconds).

    Declaration

    Swift

    var maxDownloadRetryTime: TimeInterval { get set }

    Objective-C

    @property (assign, readwrite, atomic) NSTimeInterval maxDownloadRetryTime;
  • Maximum time in seconds to retry operations other than upload and download if a failure occurs. Defaults to 2 minutes (120 seconds).

    Declaration

    Swift

    var maxOperationRetryTime: TimeInterval { get set }

    Objective-C

    @property (assign, readwrite, atomic) NSTimeInterval maxOperationRetryTime;
  • Queue that all developer callbacks are fired on. Defaults to the main queue.

    Declaration

    Swift

    var callbackQueue: DispatchQueue { get set }

    Objective-C

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

    Declaration

    Swift

    func reference() -> FIRStorageReference

    Objective-C

    - (nonnull FIRStorageReference *)reference;

    Return Value

    An instance of FIRStorageReference initialized at the root.

  • Creates a FIRStorageReference given a gs:// or https:// URL pointing to a Firebase Storage location. For example, you can pass in an https:// download URL retrieved from [FIRStorageReference downloadURLWithCompletion] or the gs:// URI from [FIRStorageReference description].

    Declaration

    Swift

    func reference(forURL string: String) -> FIRStorageReference

    Objective-C

    - (nonnull FIRStorageReference *)referenceForURL:(nonnull NSString *)string;

    Parameters

    string

    A gs:// or https:// URL to initialize the reference with.

    Return Value

    An instance of FIRStorageReference at the given child path. @throws Throws an exception if passed in URL is not associated with the FIRApp used to initialize this FIRStorage.

  • Creates a FIRStorageReference initialized at a child Firebase Storage location.

    Declaration

    Swift

    func reference(withPath string: String) -> FIRStorageReference

    Objective-C

    - (nonnull FIRStorageReference *)referenceWithPath:(nonnull NSString *)string;

    Parameters

    string

    A relative path from the root to initialize the reference with, for instance @path/to/object.

    Return Value

    An instance of FIRStorageReference at the given child path.