Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
How to close webview all together in React JS

I am making a website in React JS.The website will work like a webview as it will be attached to android/IOS application. In the website i have a cross button. On that button press i want to trigger native bridge event which will close whole webview all together. Let me know how can i achieve same. Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Mhmm, android and iOS are creating a special object on window when loading a website in a webview.. in Android it is called window.android, in iOS it's window.webkit and a special userAgent agent which matches like

navigator.userAgent.match("CriOS") === null // detects chrome on iOS

In Android, it is possible to create "callbacks" on this android object which can be called from the websites ReactJS code like:

window.android?.share(content)

In iOS, you can go with messageHandlers and it will look something like this:

window.webkit?.messageHandlers?.showSharing?.postMessage(url)

I cannot show you the native App code for these two examples as i'm the Frontend-Developer in our company and not the App-Developer ^^

But, i would assume that's the way to achieve this. You need a way to call a method directly in your native app code to have the ability to actually close the webview - the website itself cannot achieve this.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda