update for iOS

This commit is contained in:
Andrey Bondarenko 2021-01-21 16:27:28 +10:00
parent 35dda6dbdf
commit 8a0af3388d
2 changed files with 7 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#import "AppMetrica.h" #import "AppMetrica.h"
#import "AppMetricaUtils.h" #import "AppMetricaUtils.h"
#import <YandexMobileMetricaPush/YMPYandexMetricaPush.h>
static NSString *const kYMMReactNativeExceptionName = @"ReactNativeException"; static NSString *const kYMMReactNativeExceptionName = @"ReactNativeException";
@ -22,6 +23,11 @@ RCT_EXPORT_METHOD(activate:(NSDictionary *)configDict)
[YMMYandexMetrica activateWithConfiguration:[AppMetricaUtils configurationForDictionary:configDict]]; [YMMYandexMetrica activateWithConfiguration:[AppMetricaUtils configurationForDictionary:configDict]];
} }
RCT_EXPORT_METHOD(initPush:(NSString *)deviceToken)
{
[YMPYandexMetricaPush setDeviceTokenFromData:deviceToken];
}
RCT_EXPORT_METHOD(getLibraryApiLevel) RCT_EXPORT_METHOD(getLibraryApiLevel)
{ {
// It does nothing for iOS // It does nothing for iOS

View File

@ -9,6 +9,7 @@
#import <CoreLocation/CoreLocation.h> #import <CoreLocation/CoreLocation.h>
#import <YandexMobileMetrica/YandexMobileMetrica.h> #import <YandexMobileMetrica/YandexMobileMetrica.h>
@interface AppMetricaUtils : NSObject @interface AppMetricaUtils : NSObject
+ (YMMYandexMetricaConfiguration *)configurationForDictionary:(NSDictionary *)configDict; + (YMMYandexMetricaConfiguration *)configurationForDictionary:(NSDictionary *)configDict;