GithubHelp home page GithubHelp logo

jlvhangzhou / react-native-webkitdemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hayeah/react-native-webkitdemo

0.0 2.0 0.0 89 KB

Java 20.20% JavaScript 27.98% Objective-C 44.11% CSS 0.48% HTML 7.23%

react-native-webkitdemo's Introduction

An experiment of using ReactNative as HTML5 hybrid wrapper, in place of PhoneGap.

iOS

The react-js-navigation custom URL scheme prevents a page from loading. It triggers the onNavigationStateChange event.

Use this to trigger native actions or view transition.

Could also capture current URL of there's navigation in the WebView HTML5 app.

Android

Allow Android virtual machine to read from port 8080 of development machine by creating a reverse proxy:

adb reverse tcp:8080 tcp:8080

Hmmm. Android's side is still a piece of crap.

There's no custom url scheme, but a hack is to use the url hash to send trigger onNavigationStateChange. This could trigger a view change or whatever.

  • need to figure out how to compile ReactNative Android.

Android Problems

  • Double loading: 393adacfa61d6500f8ad285ed136320cf713fcbd
    • wtf? It does happen, and randomly.
  • Custom URL scheme is not yet implemented:
public void setUrl(WebView view, @Nullable String url) {
  if(url != null) {
      view.loadUrl(url);
  } else {
      view.loadUrl("about:blank");
  }
}

Could maybe override url loading? Or it's probably easier to modify setUrl, since it interfaces with React property setting.

WebViewClient.shouldOverrideUrlLoading

Message Bridge

Right now you could sort of communicate with the ReactNative side from WebView by changing (and detecting) URL changes.

People have experimented with a message passing bridge:

facebook/react-native#586 https://github.com/alinz/react-native-webview-bridge

No idea if it's any good.

react-native-webkitdemo's People

Contributors

hayeah avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.