From b50bfb1fc85ca1900af58ccb584f321c7a21cc1f Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Sat, 30 Sep 2017 16:47:58 +0300 Subject: [PATCH] Working Android example --- example/android/app/build.gradle | 1 + .../app/src/main/java/com/rnappmetrika/MainApplication.java | 4 +++- example/android/settings.gradle | 2 ++ example/src/Page2.js | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index e72d6d8..f0efc37 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -133,6 +133,7 @@ android { } dependencies { + compile project(':react-native-appmetrica') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules diff --git a/example/android/app/src/main/java/com/rnappmetrika/MainApplication.java b/example/android/app/src/main/java/com/rnappmetrika/MainApplication.java index 6f8a2c4..3645026 100644 --- a/example/android/app/src/main/java/com/rnappmetrika/MainApplication.java +++ b/example/android/app/src/main/java/com/rnappmetrika/MainApplication.java @@ -3,6 +3,7 @@ package com.rnappmetrika; import android.app.Application; import com.facebook.react.ReactApplication; +import com.aandrosov.AppMetrica.AppMetricaPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; @@ -22,7 +23,8 @@ public class MainApplication extends Application implements ReactApplication { @Override protected List getPackages() { return Arrays.asList( - new MainReactPackage() + new MainReactPackage(), + new AppMetricaPackage() ); } }; diff --git a/example/android/settings.gradle b/example/android/settings.gradle index c9b233b..1418b74 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,3 +1,5 @@ rootProject.name = 'RNAppMetrika' +include ':react-native-appmetrica' +project(':react-native-appmetrica').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-appmetrica/android') include ':app' diff --git a/example/src/Page2.js b/example/src/Page2.js index c930638..4ad7cc7 100644 --- a/example/src/Page2.js +++ b/example/src/Page2.js @@ -20,7 +20,7 @@ class Page2 extends React.PureComponent { } handlePress() { - appNavigator.push({ id: 'page2' }); + appNavigator.pop(); } }