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");