From 731d616d16f3520d839568824cb8cc227aacb42a Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 21 Nov 2023 17:41:30 +0800 Subject: [PATCH] =?UTF-8?q?log=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/Api/MOP_registerExtensionApi.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ios/Classes/Api/MOP_registerExtensionApi.m b/ios/Classes/Api/MOP_registerExtensionApi.m index 04a5d99..943866a 100644 --- a/ios/Classes/Api/MOP_registerExtensionApi.m +++ b/ios/Classes/Api/MOP_registerExtensionApi.m @@ -15,15 +15,18 @@ { NSLog(@"MOP_registerExtensionApi"); FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; - [[FATClient sharedClient] registerExtensionApi:self.name handle:^(id param, FATExtensionApiCallback callback) { - NSLog(@"invoke ExtensionApi:"); - NSLog(@"%@",self.name); - NSLog(@"%@",param); - NSString* api = [@"extensionApi:" stringByAppendingString:self.name]; + [[FATClient sharedClient] registerExtensionApi:self.name handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) { + NSLog(@"channel:%@---invoke ExtensionApi:%@, param:%@", channel, self.name, param); + + NSString *invokeMessage = [NSString stringWithFormat:@"channel:[%@]---invoke ExtensionApi:[%@]", [channel description], self.name]; + [[FATClient sharedClient].toolManager addConsoleLog:invokeMessage consoleLevel:FATConsoleLevelLog appletId:appletInfo.appId completion:nil]; + + NSString *api = [@"extensionApi:" stringByAppendingString:self.name]; [channel invokeMethod:api arguments:param result:^(id _Nullable result) { NSLog(@"extensionApi reslut:%@",result); + NSString *callbackMessage = [NSString stringWithFormat:@"extensionApi [%@] callbck ",self.name]; + [[FATClient sharedClient].toolManager addConsoleLog:callbackMessage consoleLevel:FATConsoleLevelLog appletId:appletInfo.appId completion:nil]; // 先判断是否flutter发生错误 -// BOOL isFlutterError = [result isKindOfClass:[FlutterError class]] || result == FlutterMethodNotImplemented; BOOL isValid = [result isKindOfClass:[NSDictionary class]]; if (!isValid) { NSLog(@"extensionApi reslut is not NSDictionary");