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

157
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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