Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def enableSeparateBuildPerCPUArchitecture = false
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
def jscFlavor = 'org.webkit:android-jsc-intl:+'



/**
* The preferred build flavor of JavaScriptCore.
Expand All @@ -109,7 +112,7 @@ def enableProguardInReleaseBuilds = false
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
// def jscFlavor = 'org.webkit:android-jsc:+'

/**
* Whether to enable the Hermes VM.
Expand Down
677 changes: 677 additions & 0 deletions android/app/src/assets/index.android.bundle

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions android/app/src/main/java/com/rncodetest/FetchKeyANDROID.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.rncodetest;

import android.content.Context;

import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import java.util.Map;
import java.util.HashMap;
import com.facebook.react.bridge.Callback;

import android.util.Log;

public class FetchKeyANDROID extends ReactContextBaseJavaModule {
private Context context = null;
FetchKeyANDROID(ReactApplicationContext context) {
super(context);
this.context=context;
}

@ReactMethod
public void getKey(Callback keyCallback) {
// boolean isDebuggable = ( 0 != ( getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE ) );
// if (isDebuggable) {
// String key = context.getString(R.string.service_key);
// keyCallback.invoke(key);
// }
// else {
// String key = context.getString(R.string.production_service_key);
// keyCallback.invoke(key);
// }
Log.d("myTag", "This is my message" + context.getString(R.string.service_key));
String key = context.getString(R.string.service_key);
keyCallback.invoke(key);

}

@Override
public String getName() {
return "FetchKeyANDROID";
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new MyAppPackage());
return packages;
}

Expand Down
28 changes: 28 additions & 0 deletions android/app/src/main/java/com/rncodetest/MyAppPackage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.rncodetest;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class MyAppPackage implements ReactPackage {

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}

@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();

modules.add(new FetchKeyANDROID(reactContext));

return modules;
}

}
4 changes: 4 additions & 0 deletions android/app/src/main/res/raw/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "RNCodeTest",
"displayName": "RNCodeTest"
}
Loading