fix:更新sendCustomEvent方法,新增appId参数

master
wangtao 2022-04-27 14:39:42 +08:00
parent 8e8a7a8f65
commit 9a84272f67
2 changed files with 18 additions and 7 deletions

View File

@ -10,6 +10,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MOP_sendCustomEvent : MOPBaseApi @interface MOP_sendCustomEvent : MOPBaseApi
@property (nonatomic, copy)NSString *appId;
@property (nonatomic, strong) NSDictionary *eventData; @property (nonatomic, strong) NSDictionary *eventData;
@end @end

View File

@ -15,7 +15,7 @@
failure(@{@"errMsg": @"sendCustomEvent:fail"}); failure(@{@"errMsg": @"sendCustomEvent:fail"});
return; return;
} }
if (!self.appId) {
[[FATClient sharedClient].nativeViewManager sendCustomEventWithDetail:self.eventData completion:^(id result, NSError *error) { [[FATClient sharedClient].nativeViewManager sendCustomEventWithDetail:self.eventData completion:^(id result, NSError *error) {
if (error) { if (error) {
failure(@{@"errMsg": @"sendCustomEvent:fail"}); failure(@{@"errMsg": @"sendCustomEvent:fail"});
@ -23,6 +23,16 @@
success(result); success(result);
} }
}]; }];
} else {
[[FATClient sharedClient].nativeViewManager sendCustomEventWithDetail:self.eventData applet:self.appId completion:^(id result, FATError *error) {
if (error) {
failure(@{@"errMsg": @"sendCustomEvent:fail"});
} else {
success(result);
}
}];
}
} }
@end @end