add getToken
This commit is contained in:
@@ -83,6 +83,7 @@ dependencies {
|
||||
implementation 'com.facebook.react:react-native:+' // From node_modules
|
||||
implementation 'com.yandex.android:mobmetricalib:3.18.0'
|
||||
implementation "com.yandex.android:mobmetricapushlib:1.10.0"
|
||||
implementation "com.android.support:support-compat:28.0.0"
|
||||
implementation 'com.android.installreferrer:installreferrer:1.1.2'
|
||||
implementation "com.google.firebase:firebase-messaging:21.0.0"
|
||||
implementation "com.google.android.gms:play-services-base:17.5.0"
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.yandex.metrica.YandexMetrica;
|
||||
import com.yandex.metrica.push.YandexMetricaPush;
|
||||
import com.yandex.appmetrica.push.firebase.FirebasePushServiceControllerProvider;
|
||||
|
||||
public class AppMetricaModule extends ReactContextBaseJavaModule {
|
||||
|
||||
@@ -54,9 +53,12 @@ public class AppMetricaModule extends ReactContextBaseJavaModule {
|
||||
|
||||
@ReactMethod
|
||||
public void initPush() {
|
||||
// YandexMetricaPush.init(reactContext);
|
||||
YandexMetricaPush.init(reactContext,
|
||||
new FirebasePushServiceControllerProvider(reactContext));
|
||||
YandexMetricaPush.init(reactContext);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void getToken(Promise promise) {
|
||||
promise.resolve(YandexMetricaPush.getToken());
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
|
||||
Reference in New Issue
Block a user