Update Android YandexMetrica.activate for SDK 3
This commit is contained in:
parent
e7e00e0c92
commit
95573ee4b3
@ -16,6 +16,7 @@ import java.lang.Exception;
|
|||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import com.yandex.metrica.YandexMetrica;
|
import com.yandex.metrica.YandexMetrica;
|
||||||
|
import com.yandex.metrica.YandexMetricaConfig;
|
||||||
|
|
||||||
public class AppMetricaModule extends ReactContextBaseJavaModule {
|
public class AppMetricaModule extends ReactContextBaseJavaModule {
|
||||||
final static String ModuleName = "AppMetrica";
|
final static String ModuleName = "AppMetrica";
|
||||||
@ -32,8 +33,8 @@ public class AppMetricaModule extends ReactContextBaseJavaModule {
|
|||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void activateWithApiKey(String key) {
|
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();
|
Activity activity = getCurrentActivity();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
Application application = activity.getApplication();
|
Application application = activity.getApplication();
|
||||||
|
Loading…
Reference in New Issue
Block a user