{"id":16407507,"url":"https://github.com/llitfkitfk/react-native-webview-android","last_synced_at":"2026-06-20T16:32:23.980Z","repository":{"id":68610854,"uuid":"130685656","full_name":"llitfkitfk/react-native-webview-android","owner":"llitfkitfk","description":null,"archived":false,"fork":false,"pushed_at":"2018-04-23T11:22:31.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-10-23T19:52:02.283Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llitfkitfk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-23T11:22:17.000Z","updated_at":"2018-04-23T11:22:37.000Z","dependencies_parsed_at":"2023-04-25T11:48:01.979Z","dependency_job_id":null,"html_url":"https://github.com/llitfkitfk/react-native-webview-android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/llitfkitfk/react-native-webview-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llitfkitfk%2Freact-native-webview-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llitfkitfk%2Freact-native-webview-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llitfkitfk%2Freact-native-webview-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llitfkitfk%2Freact-native-webview-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llitfkitfk","download_url":"https://codeload.github.com/llitfkitfk/react-native-webview-android/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llitfkitfk%2Freact-native-webview-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34578089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T06:14:08.157Z","updated_at":"2026-06-20T16:32:23.960Z","avatar_url":"https://github.com/llitfkitfk.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-webview-android\nSimple React Native Android module to use Android's WebView inside your app (with experimental html file input support to handle file uploads in forms).\n\n[![npm version](http://img.shields.io/npm/v/react-native-webview-android.svg?style=flat-square)](https://npmjs.org/package/react-native-webview-android \"View this project on npm\")\n[![npm downloads](http://img.shields.io/npm/dm/react-native-webview-android.svg?style=flat-square)](https://npmjs.org/package/react-native-webview-android \"View this project on npm\")\n[![npm licence](http://img.shields.io/npm/l/react-native-webview-android.svg?style=flat-square)](https://npmjs.org/package/react-native-webview-android \"View this project on npm\")\n\n### Installation\n\n```bash\nnpm install react-native-webview-android --save\n```\n\n### Add it to your android project\n\n* In `android/setting.gradle`\n\n```gradle\n...\ninclude ':RNWebView', ':app'\nproject(':RNWebView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview-android/android')\n```\n\n* In `android/app/build.gradle`\n\n```gradle\n...\ndependencies {\n  ...\n  compile project(':RNWebView')\n}\n```\n\n* Register Module - RN \u003e= 0.29 (in MainApplication.java)\n\n```java\nimport com.burnweb.rnwebview.RNWebViewPackage;  // \u003c--- import\n\npublic class MainApplication extends Application implements ReactApplication {\n  ......\n\n  @Override\n  protected List\u003cReactPackage\u003e getPackages() {\n    return Arrays.\u003cReactPackage\u003easList(\n        new MainReactPackage(),\n        new RNWebViewPackage()); // \u003c------ add this line to your MainApplication class\n  }\n\n  ......\n\n}\n```\n\nIf you need to see the install instructions for older React Native versions [look here](https://github.com/lucasferreira/react-native-webview-android/blob/react-native-older/README.md).\n\n\n## Example\n```javascript\nvar React = require('react-native');\nvar { StyleSheet } = React;\n\nvar WebViewAndroid = require('react-native-webview-android');\n\nvar SITE_URL = \"https://www.google.com\";\n\nvar WebViewAndroidExample = React.createClass({\n    getInitialState: function() {\n      return {\n        url: SITE_URL,\n        // OR\n        // you can use a source object like React Native Webview.\n        // source {uri: string, method: string, headers: object, body: string}, {html: string, baseUrl: string}\n        // Loads static html or a uri (with optional headers) in the WebView. \u003cJust like React Native's version\u003e\n        // source: {\n        //   uri: SITE_URL,\n        //   headers: {\n        //     ...\n        //   },\n        // },\n        status: 'No Page Loaded',\n        backButtonEnabled: false,\n        forwardButtonEnabled: false,\n        loading: true,\n      };\n    },\n    goBack: function() {\n      // you can use this callback to control web view\n      this.refs.webViewAndroidSample.goBack();\n    },\n    goForward: function() {\n      this.refs.webViewAndroidSample.goForward();\n    },\n    reload: function() {\n      this.refs.webViewAndroidSample.reload();\n    },\n    stopLoading: function() {\n      // stops the current load\n      this.refs.webViewAndroidSample.stopLoading();\n    },\n    postMessage: function(data) {\n      // posts a message to web view\n      this.refs.webViewAndroidSample.postMessage(data);\n    },\n    injectJavaScript: function(script) {\n      // executes JavaScript immediately in web view\n      this.refs.webViewAndroidSample.injectJavaScript(script);\n    },\n    onNavigationStateChange: function(event) {\n      console.log(event);\n\n      this.setState({\n        backButtonEnabled: event.canGoBack,\n        forwardButtonEnabled: event.canGoForward,\n        url: event.url,\n        status: event.title,\n        loading: event.loading\n      });\n    },\n    render: function() {\n      return (\n        \u003cWebViewAndroid\n          ref=\"webViewAndroidSample\"\n          javaScriptEnabled={true}\n          geolocationEnabled={false}\n          builtInZoomControls={false}\n          onNavigationStateChange={this.onNavigationStateChange}\n          url={SITE_URL} // or use the source(object) attribute...\n          style={styles.containerWebView} /\u003e\n      );\n\n      // other attributes: source(object), html(string), htmlCharset(string), baseUrl(string), injectedJavaScript(string), disableCookies(bool), disablePlugins(bool), userAgent(string)\n    }\n});\n\nvar styles = StyleSheet.create({\n  containerWebView: {\n    flex: 1,\n  }\n});\n```\n\n## Note about HTML file input (files upload)\n\nThis module implements an experimental support to handle file input in HTML forms for upload files. It was tested in some Android versions 4.1+, but it's possible that some device won't work OK with that *new* feature.\n\n![File input demo](http://i.imgur.com/5Fbaxfn.gif)\n\n## Tips for Video (HTML5) inside WebView\n\nTo work with some html5 video player inside your Webview, I recommend you to set the android:hardwareAccelerated=\"true\" in your AndroidManifest.xml file.\n\nMore info here: http://stackoverflow.com/questions/17259636/enabling-html5-video-playback-in-android-webview\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllitfkitfk%2Freact-native-webview-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllitfkitfk%2Freact-native-webview-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllitfkitfk%2Freact-native-webview-android/lists"}