diff --git a/ios/Classes/Api/MOP_sendCustomEvent.h b/ios/Classes/Api/MOP_sendCustomEvent.h index 39436be..973b754 100644 --- a/ios/Classes/Api/MOP_sendCustomEvent.h +++ b/ios/Classes/Api/MOP_sendCustomEvent.h @@ -10,6 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @interface MOP_sendCustomEvent : MOPBaseApi +@property (nonatomic, copy)NSString *appId; @property (nonatomic, strong) NSDictionary *eventData; @end diff --git a/ios/Classes/Api/MOP_sendCustomEvent.m b/ios/Classes/Api/MOP_sendCustomEvent.m index 4642b06..85b760a 100644 --- a/ios/Classes/Api/MOP_sendCustomEvent.m +++ b/ios/Classes/Api/MOP_sendCustomEvent.m @@ -15,14 +15,24 @@ failure(@{@"errMsg": @"sendCustomEvent:fail"}); return; } + if (!self.appId) { + [[FATClient sharedClient].nativeViewManager sendCustomEventWithDetail:self.eventData completion:^(id result, NSError *error) { + if (error) { + failure(@{@"errMsg": @"sendCustomEvent:fail"}); + } else { + 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); + } + }]; + } - [[FATClient sharedClient].nativeViewManager sendCustomEventWithDetail:self.eventData completion:^(id result, NSError *error) { - if (error) { - failure(@{@"errMsg": @"sendCustomEvent:fail"}); - } else { - success(result); - } - }]; } @end