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

161
Vistas
How to display pop up tab in react native webview?

I have a web page that loads a book if the user is subscribed otherwise if the subscription is expired it loads this page :

enter image description here

I load the page in a variable before rendering to make the user Experience go smoothly and then I append the variable to the HTML of webview. the load works fine but when I click the following buttons nothing happens and I want to have the same interaction as on the web. how can I achieve that using react native webview.

enter image description here

here s the webview code:

<WebView 
 key={this.state.value}
 ref={webview => this.setState({WebViewRef:webview})}
 javaScriptEnabled={true}
 domStorageEnabled={true}
 scalesPageToFit={false}
 onLoadEnd={
   this.setState({
   visibleBack:false
  })
 }
 automaticallyAdjustContentInsets={false}
 source={{ html:htmlString,}} style={{height : this.state.webViewHeight, width: this.state.notSubbedHeight== 1 ? Dimensions.get('window').width-20 :Dimensions.get('window').width-40, justifyContent:'center' ,alignItems:'center',marginTop:20}}
 key={this.state.key}
 injectedJavaScript={jsBeforeLoad}
 onMessage= {this.onMessage}
 scrollEnabled={false}
/>

and here is how I get the htmlString

 getProductsummary = async (product) => {

    this.setState({ loading: true });
    const username = await AsyncStorage.getItem('username');
    if(username !== undefined){
      fetch(Config.backendAPI+`/cleanbook_mobile.php?idbook=${product.id}&username=${username}`)
      .then((response) =>{
          return response.text();
        }
      ).then((result)=>{
        let resp = result;
          if (resp == null || resp == "") {
            resp = "<div style=\"font-family :Georgia\" >" + Languages.SummaryVide + "</div>";
          }
          if(resp.includes("paypal-button-container-P")){
            this.setState({notSubbedHeight:1})
          }
          this.setState({ summary: resp, loading: false });
      }).catch((error) => console.log(error));
    }else{
      this.setState({
        notSubbed: 1,
      })
    }
  };

var htmlString = `<div id="summaryDiv"> ${this.state.summary} </div>`;

about 4 years ago · Juan Pablo Isaza
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