FirebaseStorage Framework Reference Stay organized with collections Save and categorize content based on your preferences.
FIRStorage
@interfaceFIRStorage:NSObjectFirebase 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.
The default
Storageinstance.returns:An instance of
Storage, configured with the defaultFirebaseApp.Declaration
Objective-C
+(FIRStorage*_Nonnull)storage;A method used to create
Storageinstances initialized with a custom storage bucket URL.AnyStorageReferencesgenerated from this instance ofStoragewill reference filesand directories within the specified bucket.\param url Thegs://URL to your Firebase Storage bucket.returns:A
Storageinstance, configured with the custom storage bucket.Declaration
Objective-C
+(FIRStorage*_Nonnull)storageWithURL:(NSString*_Nonnull)url;Creates an instance of
Storage, configured with a customFirebaseApp.StorageReferencesgenerated from a resulting instance will reference files in the Firebase projectassociated with customFirebaseApp.\param app The customFirebaseAppused for initialization.returns:A
Storageinstance, configured with the customFirebaseApp.Declaration
Objective-C
+(FIRStorage*_Nonnull)storageForApp:(FIRApp*_Nonnull)app;Creates an instance of
Storage, configured with a customFirebaseAppand a custom storagebucket URL.\param app The customFirebaseAppused for initialization.\param url The
gs://url to your Firebase Storage bucket.returns:the
Storageinstance, configured with the customFirebaseAppand storage bucket URL.Declaration
Objective-C
+(FIRStorage*_Nonnull)storageForApp:(FIRApp*_Nonnull)appURL:(NSString*_Nonnull)url;The
FirebaseAppassociated with this Storage instance.Declaration
Objective-C
@property(nonatomic,strong,readonly)FIRApp*_Nonnullapp;The maximum time in seconds to retry an upload if a failure occurs.Defaults to 10 minutes (600 seconds).
Declaration
Objective-C
@property(nonatomic)NSTimeIntervalmaxUploadRetryTime;The maximum time in seconds to retry a download if a failure occurs.Defaults to 10 minutes (600 seconds).
Declaration
Objective-C
@property(nonatomic)NSTimeIntervalmaxDownloadRetryTime;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)NSTimeIntervalmaxOperationRetryTime;Specify the maximum upload chunk size. Values less than 256K (262144) will be rounded up to 256K. Valuesabove 256K will be rounded down to the nearest 256K multiple. The default is no maximum.
Declaration
Swift
@objcpublicvaruploadChunkSizeBytes:Int64A
DispatchQueuethat all developer callbacks are fired on. Defaults to the main queue.Declaration
Objective-C
@property(nonatomic,strong)dispatch_queue_t_NonnullcallbackQueue;Creates a
StorageReferenceinitialized at the root Firebase Storage location.returns:An instance of
StorageReferencereferencing the root of the storage bucket.Declaration
Objective-C
-(FIRStorageReference*_Nonnull)reference;Creates a StorageReference given a
gs://,http://, orhttps://URL pointing to aFirebase Storage location. For example, you can pass in anhttps://download URL retrieved fromStorageReference.downloadURL(completion:)or thegs://URL fromStorageReference.description.\param url A gs // or https:// URL to initialize the reference with.throws:Throws a fatal error if
urlis not associated with theFirebaseAppused to initializethis Storage instance.returns:An instance of StorageReference at the given child path.
Declaration
Objective-C
-(FIRStorageReference*_Nonnull)referenceForURL:(NSString*_Nonnull)url;Creates a
StorageReferenceinitialized at a location specified by thepathparameter.\param path A relative path from the root of the storage bucket, for instance @“path/to/object”.returns:An instance of
StorageReferencepointing 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)hostport:(NSInteger)port;Undocumented
Declaration
Objective-C
-(id_Nonnull)copySWIFT_WARN_UNUSED_RESULT;Undocumented
Declaration
Objective-C
-(BOOL)isEqual:(id_Nullable)objectSWIFT_WARN_UNUSED_RESULT;Undocumented
Declaration
Objective-C
@property(nonatomic,readonly)NSUIntegerhashUndocumented
Declaration
Objective-C
-(nonnullinstancetype)initSWIFT_UNAVAILABLE;Undocumented
Declaration
Objective-C
+(nonnullinstancetype)newSWIFT_UNAVAILABLE_MSG("-init is unavailable");
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 2023-08-23 UTC.