Working Android example

This commit is contained in:
Aleksei Androsov 2017-09-30 16:47:58 +03:00
parent a98401d47b
commit b50bfb1fc8
4 changed files with 7 additions and 2 deletions

View File

@ -133,6 +133,7 @@ android {
} }
dependencies { dependencies {
compile project(':react-native-appmetrica')
compile fileTree(dir: "libs", include: ["*.jar"]) compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1" compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules compile "com.facebook.react:react-native:+" // From node_modules

View File

@ -3,6 +3,7 @@ package com.rnappmetrika;
import android.app.Application; import android.app.Application;
import com.facebook.react.ReactApplication; import com.facebook.react.ReactApplication;
import com.aandrosov.AppMetrica.AppMetricaPackage;
import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage; import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage; import com.facebook.react.shell.MainReactPackage;
@ -22,7 +23,8 @@ public class MainApplication extends Application implements ReactApplication {
@Override @Override
protected List<ReactPackage> getPackages() { protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList( return Arrays.<ReactPackage>asList(
new MainReactPackage() new MainReactPackage(),
new AppMetricaPackage()
); );
} }
}; };

View File

@ -1,3 +1,5 @@
rootProject.name = 'RNAppMetrika' rootProject.name = 'RNAppMetrika'
include ':react-native-appmetrica'
project(':react-native-appmetrica').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-appmetrica/android')
include ':app' include ':app'

View File

@ -20,7 +20,7 @@ class Page2 extends React.PureComponent {
} }
handlePress() { handlePress() {
appNavigator.push({ id: 'page2' }); appNavigator.pop();
} }
} }