增加自定义api返回值不是字典类型的判断

master
wanghualei 2022-11-15 22:05:00 +08:00
parent d2262be6f1
commit 73f3a24e55
1 changed files with 4 additions and 3 deletions

View File

@ -23,9 +23,10 @@
[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);
// flutter // flutter
BOOL isFlutterError = [result isKindOfClass:[FlutterError class]] || result == FlutterMethodNotImplemented; // BOOL isFlutterError = [result isKindOfClass:[FlutterError class]] || result == FlutterMethodNotImplemented;
if (isFlutterError) { BOOL isValid = [result isKindOfClass:[NSDictionary class]];
NSLog(@"extensionApi reslut:fail"); if (!isValid) {
NSLog(@"extensionApi reslut is not NSDictionary");
callback(FATExtensionCodeFailure,nil); callback(FATExtensionCodeFailure,nil);
return; return;
} }