Commit a946b5d0 authored by Travis Nuttall's avatar Travis Nuttall Committed by GitHub

Merge pull request #12 from newyankeecodeshop/support-rn-0.50

Fix compile error from change to JavaScriptExecutorFactory constructor
parents 122a66a4 65a72548
...@@ -5,7 +5,7 @@ buildscript { ...@@ -5,7 +5,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:1.3.1' classpath 'com.android.tools.build:gradle:2.2.3'
} }
} }
......
package com.reactlibrary; package com.reactlibrary;
import android.content.Context; import android.content.Context;
import android.net.Uri;
import com.facebook.react.NativeModuleRegistryBuilder; import com.facebook.react.NativeModuleRegistryBuilder;
import com.facebook.react.ReactPackage; import com.facebook.react.ReactPackage;
...@@ -20,6 +21,8 @@ import com.facebook.soloader.SoLoader; ...@@ -20,6 +21,8 @@ import com.facebook.soloader.SoLoader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import static com.facebook.react.modules.systeminfo.AndroidInfoHelpers.getFriendlyDeviceName;
public class ReactContextBuilder { public class ReactContextBuilder {
private Context parentContext; private Context parentContext;
...@@ -54,7 +57,10 @@ public class ReactContextBuilder { ...@@ -54,7 +57,10 @@ public class ReactContextBuilder {
} }
public ReactApplicationContext build() throws Exception { public ReactApplicationContext build() throws Exception {
JavaScriptExecutor jsExecutor = new JSCJavaScriptExecutorFactory().create(); String appName = Uri.encode(parentContext.getPackageName());
String deviceName = Uri.encode(getFriendlyDeviceName());
JavaScriptExecutor jsExecutor = new JSCJavaScriptExecutorFactory(appName, deviceName)
.create();
// fresh new react context // fresh new react context
final ReactApplicationContext reactContext = new ReactApplicationContext(parentContext); final ReactApplicationContext reactContext = new ReactApplicationContext(parentContext);
......
...@@ -23,6 +23,6 @@ ...@@ -23,6 +23,6 @@
"index.js" "index.js"
], ],
"peerDependencies": { "peerDependencies": {
"react-native": "~0.49.0" "react-native": ">=0.50.0"
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment