kenwheeler / app-browser Goto Github PK
View Code? Open in Web Editor NEWnothing to see here
nothing to see here
Hi there,
Thanks for doing this great project!
I was trying to make it work and I got the message above.
Already tried yarn add react-native-wkwebview-reborn
but it didn't work.
Any thoughts welcome.
Here is my attempt at the android Frame native module.
package com.inceptionhost.rctframe;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.common.LifecycleState;
import com.facebook.react.ReactApplication;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.*;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactRootView;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
public class RCTFrameManager extends SimpleViewManager<ReactRootView> {
public static final String REACT_CLASS = "RCTFrame";
public String _bundlePath;
RCTFrameManager(){
String _bundlePath = "";
}
@Override
public String getName() {
// Tell React the name of the module
// https://facebook.github.io/react-native/docs/native-components-android.html#1-create-the-viewmanager-subclass
return REACT_CLASS;
}
@Override
public ReactRootView createViewInstance(ThemedReactContext context){
ReactInstanceManager mReactInstanceManager;
Application app = new Application();
Context appctx = app.getBaseContext();
ReactApplicationContext RCT_CTX = new ReactApplicationContext(appctx);
mReactInstanceManager = ReactInstanceManager
.builder()
.setApplication(app)
.setCurrentActivity(new Activity())
.setDefaultHardwareBackBtnHandler(new DefaultHardwareBackBtnHandler() {
@Override
public void invokeDefaultOnBackPressed() {
}
})
.setJSBundleFile(_bundlePath)// or
////.setJSMainModulePath("")
.build();
mReactInstanceManager.getDevSupportManager().setDevSupportEnabled(false);
mReactInstanceManager.createReactContextInBackground();
ReactRootView _rootView = new ReactRootView(context);
_rootView.startReactApplication(mReactInstanceManager, "ExampleApp");
return _rootView;
//maybe something like this?
//ReactRootView mReactRootView = new ReactRootView(app.getApplicationContext());
//mReactInstanceManager = ReactInstanceManager.builder()
// .setApplication(app)//getApplication()
// .setJSBundleFile(_bundlePath)
// .addPackage(new MainReactPackage())
// .setUseDeveloperSupport(BuildConfig.DEBUG)
// .setInitialLifecycleState(LifecycleState.RESUMED)
// .build();
// The string here (e.g. "MyReactNativeApp") has to match
// the string in AppRegistry.registerComponent() in index.js
//mReactRootView.startReactApplication(
// mReactInstanceManager,
// "ExampleApp",
// null
//);
//return mReactRootView;
}
@ReactProp(name = "bundle")
public void setBundle(ReactRootView view, String prop) {
// Set properties from React onto your native component via a setter method
// https://facebook.github.io/react-native/docs/native-components-android.html#3-expose-view-property-setters-using-reactprop-or-reactpropgroup-annotation
_bundlePath = prop;
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.