React Native Open Web Page in App Using WebView Android iOS Tutorial

WebView is the common component used in both android & iOS applications in react native to Open – Embed online website webpage using custom HTTP URL. Developer can modify the WebView settings according to their requirement. So in this tutorial we would going to create a react native app using WebView component and Load a webpage in WebView.

Contents in this project Open Web Page in App Using WebView Example:

1. Import StyleSheet, WebView and Platform component in your project.

2. Create WebView component inside render’s return block.

style : Call your custom style sheet class to modify the WebView.

source : Pass the website webpage HTTP URL using URL .

javaScriptEnabled : Enable or Disable JavaScript on your webpage. By default JavaScript is enabled.

domStorageEnabled : Enable the DOM Storage. This option works only in Android devices.

3. Create custom style sheet for WebView.

4. Complete source code for App.js File :

Screenshot in android mobile app :

Screenshot in iOS Mobile app :

WebView

2 Comments

  1. Hi dear, I prepared an sample app with my own html files inside it, generate an released apk and tried to publish it on play store but this app get suspended because of webview of spam affiliation. Even I made some research about it but not found any proper method to do so. Can you please suggest me the better solution to publish it.

    • Rohit i really have no idea about this because currently we do not have published any webview app on play store but you can raise a question in React Native’s community page on Github.

Leave a Reply

Your email address will not be published.