提交 55d37a92 authored 作者: 祁增奎's avatar 祁增奎

iOS人脸识别问题

上级 fb2fae44
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
@implementation AliyunFacePlugin @implementation AliyunFacePlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FlutterMethodChannel* channel = [FlutterMethodChannel FlutterMethodChannel* channel = [FlutterMethodChannel
methodChannelWithName:@"aliyun_face_plugin" methodChannelWithName:@"aliyun_face_plugin"
binaryMessenger:[registrar messenger]]; binaryMessenger:[registrar messenger]];
AliyunFacePlugin* instance = [[AliyunFacePlugin alloc] init]; AliyunFacePlugin* instance = [[AliyunFacePlugin alloc] init];
[registrar addMethodCallDelegate:instance channel:channel]; [registrar addMethodCallDelegate:instance channel:channel];
[AliyunFaceAuthFacade init];
} }
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
...@@ -50,14 +51,17 @@ ...@@ -50,14 +51,17 @@
NSLog(@"useVideo: %@.", useVideo); NSLog(@"useVideo: %@.", useVideo);
if(useVideo!=nil && [useVideo isEqual:@"1"]){ if(useVideo!=nil && [useVideo isEqual:@"1"]){
[extParams setValue:@"true" forKey:@"returnVideo"]; [extParams setValue:@"true" forKey:@"returnVideo"];
[extParams setValue:@"true" forKey:ZIM_EXT_PARAMS_KEY_USE_VIDEO_UPLOAD]; [extParams setValue:@"true" forKey:ZIM_EXT_PARAMS_KEY_USE_VIDEO];
} }
[AliyunFaceAuthFacade verifyWith:certifyId [AliyunFaceAuthFacade verifyWith:certifyId
extParams:extParams extParams:extParams
onCompletion:^(ZIMResponse *response) { onCompletion:^(ZIMResponse *response) {
result([NSString stringWithFormat:@"%lu,%@", response.code, response.reason,response.videoFilePath]); result([NSString stringWithFormat:@"%lu,%@",
response.code,
response.reason,
response.videoFilePath]);
}]; }];
return; return;
...@@ -71,8 +75,8 @@ ...@@ -71,8 +75,8 @@
- (NSString *)convertToJsonData:(NSDictionary *) dict { - (NSString *)convertToJsonData:(NSDictionary *) dict {
NSError *error; NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict
options:NSJSONWritingSortedKeys options:NSJSONWritingSortedKeys
error:&error]; error:&error];
NSString *jsonString; NSString *jsonString;
if (!jsonData) { if (!jsonData) {
NSLog(@"Error: %@", error); NSLog(@"Error: %@", error);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论