Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best approach to pass data from web view to native app (Windows, iOS & Android)

Wondering what the best approach is to read HTML/JS within a webview in a native app that works for:

  • iOS
  • Android
  • Windows Phone

Can all three platforms read the content of a web view, or does the sandbox prevent that from happening?

like image 249
El-codino Avatar asked Jan 27 '14 10:01

El-codino


People also ask

How do you communicate with data between WebView in React Native?

Import the React Native WebView package in App. js . We will create a normal HTML page in WebView and use “script” tags to let the HTML page communicate with the React Native app. In the “script” tag, we are going to call a sendDataToReactNativeApp() function in which we will use a window property called window.

How do you communicate between WebView and native Android?

2 — Android: 2.1 To receive data from webview ,we can create an interface, which will enable webview to connect the native layer and pass data. From native layer, create a class and replicate the following. While configuring web view, we need to set JavaScript interface as above JSBridge class.

Does Apple allow WebView app?

Apple has decided to replace one type of web control with another. Merchants can switch to the new control or change to a mobile SDK to ensure applications continue to work as expected. Apple will no longer allow applications on the App Store that include the UIWebview control.


1 Answers

iOS:

More Details

passing-data-to-and-from-an-embedded-uiwebview

ios-pass-values-to-native-app-from

enter image description here

Android:

webkit-communication-with-native-environment

like image 74
codercat Avatar answered Oct 05 '22 21:10

codercat