//
//  FedTrackReactModule.m
//  RNFedTrackRn
//
//  Created by claudean on 2021/12/3.
//  Copyright © 2021 Facebook. All rights reserved.
//

#import "FedTrackReactModule.h"
#import <FedTrackManager.h>

@implementation FedTrackReactModule

RCT_EXPORT_MODULE()
RCT_EXPORT_METHOD(sentPageCreat:(NSString *)pageName) {
    [[FedTrackManager sharedFedTrackManager] createPageWithRN:pageName];
}

RCT_EXPORT_METHOD(sentAnalysisEvent:(NSString *)eventName
                  data:(NSString *)data
                  eventEx:(NSString *)eventEx
                  pageEx:(NSString *)pageEx) {
    [[FedTrackManager sharedFedTrackManager] eventRNActionWithRNEventId:eventName RNEvent_name:@"" RNEvent_dec:@"" RNData:data RNPage_ex:pageEx RNEvent_ex:eventEx];
}

RCT_EXPORT_METHOD(sentAnalysisPage:(NSString *)eventName
                  data:(NSString *)data
                  eventEx:(NSString *)eventEx
                  pageEx:(NSString *)pageEx) {
    [[FedTrackManager sharedFedTrackManager] pageRNActionWithRNEventId:eventName RNEvent_name:@"" RNEvent_dec:@"" RNData:data RNPage_ex:pageEx RNEvent_ex:eventEx];
}

RCT_EXPORT_METHOD(sentCrashInfo:(NSString *)crashName
                  crashStack:(NSString *)crashStack) {
    [[FedTrackManager sharedFedTrackManager] sentCrashInfoWithCrashName:crashName crashStack:crashStack];
}

@end
