Skip to content

iOS Upload Progress Events Do Not Fire #70

Open

Description

@mattsputnikdigital

The event is working on Android and I get multiple progress events as the file uploads, on iOS the only event that fires is once the file is uploaded.

version 2.0.4 (tested back to v2.0.0) and tested on iOS 26 simulator & device

{
    bytes: 21358080
    contentLength: 21358080
    lengthComputable: true
    type: "upload"
    url: "https:..."
}

I am using the standard request, not changing the header type etc... chunkedMode: false and progress: true

{
    chunkedMode: false,
    headers: {
      Authorization: `Bearer ${token}`,
    },
    path: request.data,
    progress: true,
    url: `${HOST}${request.uploadURL}`,
}

Activity

  1. evanlegamer commented on Jun 2, 2026

    @evanlegamer

    Got the same problem

  2. evanlegamer commented on Jun 2, 2026

    @evanlegamer

    Traced this to the underlying IONFileTransferLib. The gate is at IONFLTRUploadDelegate.swift:43-50:

    let response = task.response as? HTTPURLResponse
    let statusCode = response?.statusCode ?? 0
    if (200...299).contains(statusCode) {
        publisher.sendProgress(...)
    }

    During an upload, task.response is nil until the server replies — i.e. for every didSendBodyData callback fired while bytes are still being streamed — so statusCode is always 0 and progress is suppressed. The single event observers see ("only fires once the file is uploaded") isn't actually a didSendBodyData event; it's the forced progress tick the plugin emits from the .complete branch in FileTransferPlugin.swift:214-223 right before resolving the upload promise.

    Android works because the equivalent code doesn't have the gate. Downloads happen to work because for GETs the response arrives before the body, so task.response is populated by the time didWriteData fires.

    Opened a PR in the underlying lib that drops the gate: ionic-team/ion-ios-filetransfer#21. Once that's released and bumped here, this issue should be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions