log 日志

phiz_2.42.1.3
Sean 2023-11-21 17:41:30 +08:00
parent 1b566ef884
commit 731d616d16
1 changed files with 9 additions and 6 deletions

View File

@ -15,15 +15,18 @@
{ {
NSLog(@"MOP_registerExtensionApi"); NSLog(@"MOP_registerExtensionApi");
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
[[FATClient sharedClient] registerExtensionApi:self.name handle:^(id param, FATExtensionApiCallback callback) { [[FATClient sharedClient] registerExtensionApi:self.name handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) {
NSLog(@"invoke ExtensionApi:"); NSLog(@"channel:%@---invoke ExtensionApi:%@, param:%@", channel, self.name, param);
NSLog(@"%@",self.name);
NSLog(@"%@",param); NSString *invokeMessage = [NSString stringWithFormat:@"channel:[%@]---invoke ExtensionApi:[%@]", [channel description], self.name];
NSString* api = [@"extensionApi:" stringByAppendingString: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) { [channel invokeMethod:api arguments:param result:^(id _Nullable result) {
NSLog(@"extensionApi reslut:%@",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 // flutter
// BOOL isFlutterError = [result isKindOfClass:[FlutterError class]] || result == FlutterMethodNotImplemented;
BOOL isValid = [result isKindOfClass:[NSDictionary class]]; BOOL isValid = [result isKindOfClass:[NSDictionary class]];
if (!isValid) { if (!isValid) {
NSLog(@"extensionApi reslut is not NSDictionary"); NSLog(@"extensionApi reslut is not NSDictionary");