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

390
Visualizações
Problem to identify when a WebView Downloads a file

I have been faced a problem in React Native (environment android) to identify when a WebView downloads a file.

The current version of WebView is "react-native-webview": "^11.15.0"

The WebView component charges an url, this url redirects to some web sites and finally downloads a pdf file.

<WebView
   onNavigationStateChange={handleWebViewNavigationStateChange}
   source={{uri: my_url_link}}
   style={styles.webviewStyles}
/>

And I have a function that triggers when the url link changes, so my question is how can i handle the download event

const handleWebViewNavigationStateChange = (newNavState: any) => {
  // url from the webview state
  const {url} = newNavState;

  // Handler PDFView
  if (url.includes('.pdf')) {
    console.log('Its a PDF');
  }
};

I have been tried with onFileDownload WebView method but only works for IOS platforms. So i want to tried with some native solution, any idea of how can I could handle the download event?

about 4 years ago · Santiago Gelvez
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