From 9a84272f6781e4fc5d7528adeb377a976885fa34 Mon Sep 17 00:00:00 2001 From: wangtao Date: Wed, 27 Apr 2022 14:39:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=9B=B4=E6=96=B0sendCustomEvent?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E6=96=B0=E5=A2=9EappId=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/Api/MOP_sendCustomEvent.h | 1 + ios/Classes/Api/MOP_sendCustomEvent.m | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) 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