Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

269
Visualizações
React-Native, iOS, XHR - XHR progress event not firing on iOS while downloading Blob/Arraybuffer response type

as title says I've noticed a strange behaviour while trying to subscribe to the "progress" event that should be fired by an XHR call.

NB: Links used below are just for testing purpose, I need to download a big file (about 100MB) and read how many bytes I've already downloaded from "progress" event. Sefram had some heavy file hosted online where I could test

export default function dlTest(dlCalled, nextTest, settings) {

  if (dlCalled) return;

  dlCalled = true;

  let xhr = new XMLHttpRequest();

  xhr.addEventListener("progress", (e) => console.log("progress", e.loaded));
  xhr.addEventListener("load", (e) => console.log("loaded", e.loaded));
  xhr.addEventListener("error", () => console.log("error"));

  let zipAddress = "https://www.sefram.com/images/products/photos/hi_res/BK1760A.zip";
  let jpgAddress = "https://www.sefram.com/images/products/photos/hi_res/207030301.jpg";
  let documentAddress = "https://www.sefram.com/en/download/high-resolution-images.html";

  xhr.open("GET", zipAddress, true); 
  xhr.responseType = "blob";

  xhr.send();
}

Basically I need to read how much bytes I've downloaded since the call started. To sum up my tests:

  • iOS:
    • Call documentAddress && Response-Type: document: It does fire progress event but doesn't update event.loaded (it remains 0). You can try this yourself with documentAddress.

    • Call documentAddress && Response-Type: blob/arraybuffer: It doesn't fire progress event at all

    • Call zipAddress && Response-Type: document It doesn't fire progress event at all

    • Call zipAddress && Response-Type: blob/arraybuffer It doesn't fire progress event at all

I can't really understand why this is happening. I couldn't find any other discussion about this kind of problems. Thanks in advance for your help.

React-Native version: 0.64.3

Slack Example Download Test

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda