mop-flutter-sdk/ios/Classes/Api/MOP_sendCustomEvent.m

29 lines
708 B
Dart
Raw Normal View History

//
// MOP_sendCustomEvent.m
// mop
//
// Created by 王滔 on 2021/12/21.
//
#import "MOP_sendCustomEvent.h"
@implementation MOP_sendCustomEvent
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel
{
if (!self.eventData ) {
failure(@{@"errMsg": @"sendCustomEvent:fail"});
return;
}
[[FATClient sharedClient].nativeViewManager sendCustomEventWithDetail:self.eventData completion:^(id result, NSError *error) {
if (error) {
failure(@{@"errMsg": @"sendCustomEvent:fail"});
} else {
success(result);
}
}];
}
@end