0.0.8 • Published 5 years ago

mobile-rn-webview v0.0.8

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

mobile-rn-webview

WebView with onShouldStartLoadWithRequest method supported on Android platform

Getting started

$ npm install mobile-rn-webview --save

Mostly automatic installation

$ react-native link mobile-rn-webview

Manual installation

iOS

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNMobileRnWebviewPackage; to the imports at the top of the file
  • Add new RNMobileRnWebviewPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':mobile-rn-webview'
    project(':mobile-rn-webview').projectDir = new File(rootProject.projectDir, 	'../node_modules/mobile-rn-webview/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':mobile-rn-webview')

Usage

import WebView from 'mobile-rn-webview';

onShouldStartLoadWithRequest(event) {
    const { url } = event;
    ...
}

...

<WebView style={{flex: 1}}
        source={{html: html}}
        onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}
/>
...
0.0.8

5 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago