React Native Firebase
    Preparing search index...

    Represents the process of uploading an object. Allows you to monitor and manage the upload.

    Note: React Native Firebase returns Promises for pause/resume/cancel to communicate with native iOS/Android.

    interface UploadTask {
        snapshot: UploadTaskSnapshot;
        cancel(): Promise<boolean>;
        catch(
            onRejected: (error: ReactNativeFirebase.NativeFirebaseError) => unknown,
        ): Promise<unknown>;
        on(
            event: "state_changed",
            nextOrObserver?:
                | StorageObserver<UploadTaskSnapshot>
                | ((snapshot: UploadTaskSnapshot) => unknown)
                | null,
            error?:
                | ((error: ReactNativeFirebase.NativeFirebaseError) => unknown)
                | null,
            complete?: CompleteFn | null,
        ): Unsubscribe | Subscribe<UploadTaskSnapshot>;
        pause(): Promise<boolean>;
        resume(): Promise<boolean>;
        then(
            onFulfilled?: ((snapshot: UploadTaskSnapshot) => unknown) | null,
            onRejected?:
                | ((error: ReactNativeFirebase.NativeFirebaseError) => unknown)
                | null,
        ): Promise<unknown>;
    }
    Index

    Methods

    Properties

    Methods

    • Cancels a running task. Has no effect on a complete or failed task.

      Returns Promise<boolean>

      True if the cancel had an effect.

    • Pauses a currently running task. Has no effect on a paused or failed task.

      Returns Promise<boolean>

      True if the operation took effect, false if ignored.

    • Resumes a paused task. Has no effect on a currently running or failed task.

      Returns Promise<boolean>

      True if the operation took effect, false if ignored.

    Properties

    A snapshot of the current task state.