add getToken
This commit is contained in:
parent
d8f32092e8
commit
052c8cf31c
@ -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
|
||||
|
4
index.js
4
index.js
@ -70,6 +70,10 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
getToken(){
|
||||
return AppMetrica.getToken();
|
||||
},
|
||||
|
||||
reportUserProfile(config: UserProfileConfig){
|
||||
AppMetrica.reportUserProfile(config);
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "react-native-appmetrica-next",
|
||||
"title": "Yandex AppMetrica React Native Plugin && AppMetricaPushSDK (fireBase CloudMessage)",
|
||||
"version": "1.0.9",
|
||||
"version": "1.0.10",
|
||||
"description": "React Native plugin for AppMetrica analytics tool",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user