From 95573ee4b3bf0e8c62afb7310e7b29a38e6415a5 Mon Sep 17 00:00:00 2001 From: Danil Karpov Date: Sun, 5 Aug 2018 20:26:13 +0300 Subject: [PATCH] Update Android YandexMetrica.activate for SDK 3 --- .../main/java/com/doochik/RNAppMetrica/AppMetricaModule.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/doochik/RNAppMetrica/AppMetricaModule.java b/android/src/main/java/com/doochik/RNAppMetrica/AppMetricaModule.java index c507721..9fa9d64 100644 --- a/android/src/main/java/com/doochik/RNAppMetrica/AppMetricaModule.java +++ b/android/src/main/java/com/doochik/RNAppMetrica/AppMetricaModule.java @@ -16,6 +16,7 @@ import java.lang.Exception; import org.json.JSONObject; import com.yandex.metrica.YandexMetrica; +import com.yandex.metrica.YandexMetricaConfig; public class AppMetricaModule extends ReactContextBaseJavaModule { final static String ModuleName = "AppMetrica"; @@ -32,8 +33,8 @@ public class AppMetricaModule extends ReactContextBaseJavaModule { @ReactMethod public void activateWithApiKey(String key) { - YandexMetrica.activate(getReactApplicationContext().getApplicationContext(), key); - + YandexMetricaConfig.Builder configBuilder = YandexMetricaConfig.newConfigBuilder(key); + YandexMetrica.activate(getReactApplicationContext().getApplicationContext(), configBuilder.build()); Activity activity = getCurrentActivity(); if (activity != null) { Application application = activity.getApplication();