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.facebook.react:react-native:+' // From node_modules
|
||||||
implementation 'com.yandex.android:mobmetricalib:3.18.0'
|
implementation 'com.yandex.android:mobmetricalib:3.18.0'
|
||||||
implementation "com.yandex.android:mobmetricapushlib:1.10.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.android.installreferrer:installreferrer:1.1.2'
|
||||||
implementation "com.google.firebase:firebase-messaging:21.0.0"
|
implementation "com.google.firebase:firebase-messaging:21.0.0"
|
||||||
implementation "com.google.android.gms:play-services-base:17.5.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.facebook.react.bridge.ReadableMap;
|
||||||
import com.yandex.metrica.YandexMetrica;
|
import com.yandex.metrica.YandexMetrica;
|
||||||
import com.yandex.metrica.push.YandexMetricaPush;
|
import com.yandex.metrica.push.YandexMetricaPush;
|
||||||
import com.yandex.appmetrica.push.firebase.FirebasePushServiceControllerProvider;
|
|
||||||
|
|
||||||
public class AppMetricaModule extends ReactContextBaseJavaModule {
|
public class AppMetricaModule extends ReactContextBaseJavaModule {
|
||||||
|
|
||||||
@ -54,9 +53,12 @@ public class AppMetricaModule extends ReactContextBaseJavaModule {
|
|||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void initPush() {
|
public void initPush() {
|
||||||
// YandexMetricaPush.init(reactContext);
|
YandexMetricaPush.init(reactContext);
|
||||||
YandexMetricaPush.init(reactContext,
|
}
|
||||||
new FirebasePushServiceControllerProvider(reactContext));
|
|
||||||
|
@ReactMethod
|
||||||
|
public void getToken(Promise promise) {
|
||||||
|
promise.resolve(YandexMetricaPush.getToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
|
4
index.js
4
index.js
@ -70,6 +70,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getToken(){
|
||||||
|
return AppMetrica.getToken();
|
||||||
|
},
|
||||||
|
|
||||||
reportUserProfile(config: UserProfileConfig){
|
reportUserProfile(config: UserProfileConfig){
|
||||||
AppMetrica.reportUserProfile(config);
|
AppMetrica.reportUserProfile(config);
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-appmetrica-next",
|
"name": "react-native-appmetrica-next",
|
||||||
"title": "Yandex AppMetrica React Native Plugin && AppMetricaPushSDK (fireBase CloudMessage)",
|
"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",
|
"description": "React Native plugin for AppMetrica analytics tool",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
Reference in New Issue
Block a user