Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

389
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!