# WebView

### React Native

Once you will have widget URL from [this endpoint](https://docs.enabl3.io/enabl3/tech/endpoints#widget-url) - you can use [React Native WebView](https://github.com/react-native-webview/react-native-webview) library for opening it in the WebView.

If a 401 error is returned in the mobile application when opening the URL in the WebView (that is, the token has expired), repeat this request to get a new URL.

```
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { WebView } from 'react-native-webview';

// ...
const MyWebComponent = () => {
  return <WebView source={{ uri: 'https://app.enable3.io/?token=xxx' }} style={{ flex: 1 }} />;
}
```

### Android

Once you will have widget URL from [this endpoint](https://docs.enabl3.io/enabl3/tech/endpoints#widget-url) - you can use Android WebView for opening it

```
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        WebView webView = findViewById(R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("https://www.example.com");
    }
}
```

### iOS

Documentation coming soon


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.enable3.io/enable3/tech/integration/webview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
