Browse Source

增加ios接入指南

pull/1/head
康伟丁 3 years ago
parent
commit
abd795a25f
1 changed files with 99 additions and 0 deletions
  1. 99
    0
      AI/IOS接入指南.md

+ 99
- 0
AI/IOS接入指南.md View File

@@ -0,0 +1,99 @@
1
+# IOS接入指南
2
+
3
+## 引入cepmSdk.farmework
4
+
5
+将cepmSdk.farmework文件夹复制到项目文件中,此framework包含最基础的实体类和通讯方法
6
+
7
+双击项目文件,选择targets 点击 General 标签 在 Frameworks,Libraies,and Embedded Content点击加号,选择add files,选择复制进来的cepmSdk.framework
8
+
9
+![image-20210122162135571](/Users/dylan/Library/Application Support/typora-user-images/image-20210122162135571.png)
10
+
11
+![image-20210122162239159](/Users/dylan/Library/Application Support/typora-user-images/image-20210122162239159.png)
12
+
13
+![image-20210122162321663](/Users/dylan/Library/Application Support/typora-user-images/image-20210122162321663.png)
14
+
15
+在Build Phases中,Link Binary With Libraries中加入cepmSdk.farmework
16
+
17
+![image-20210125105515756](/Users/dylan/Library/Application Support/typora-user-images/image-20210125105515756.png)
18
+
19
+
20
+
21
+## 引入UI,Sdks界面文件夹
22
+
23
+将UI和Sdks文件夹,复制到项目目录下,然后在xcode里对项目最外层点击add File to xxx,xxx为你的项目名
24
+
25
+![image-20210125103719891](/Users/dylan/Library/Application Support/typora-user-images/image-20210125103719891.png)
26
+
27
+然后再设置里,引入以下framework包
28
+
29
+![image-20210125105206483](/Users/dylan/Library/Application Support/typora-user-images/image-20210125105206483.png)
30
+
31
+再将Build Setting中的Other Linker Flags设置为-ObjC
32
+
33
+![image-20210125105317171](/Users/dylan/Library/Application Support/typora-user-images/image-20210125105317171.png)
34
+
35
+最后在Build Settings中,将Validate Workspace设置为YES
36
+
37
+![image-20210125105642191](/Users/dylan/Library/Application Support/typora-user-images/image-20210125105642191.png)
38
+
39
+## 人脸采集接口
40
+
41
+Sdks/Face/BDFaceFaceSDKUI/UI/Controller中,ViewController中有如下3个方法
42
+
43
+对比验证成功回调
44
+
45
+\- (**void**) verifySuccess;
46
+
47
+对比验证失败回调
48
+
49
+\- (**void**) verifyFail;
50
+
51
+活体检测完成回调(包含通讯,将自己的sysName,secret,userName填入即可)
52
+
53
+\- (**void**) verifyComplete;
54
+
55
+## OCR识别接口
56
+
57
+Sdks/OCR/AipOcrService中
58
+
59
+身份证正面识别
60
+
61
+\- (IdCardFrontResponse *)detectIdCardFrontFromImage:(UIImage *)image;
62
+
63
+身份证背面识别
64
+
65
+\- (IdCardBackResponse *)detectIdCardBackFromImage:(UIImage *)image;
66
+
67
+银行卡识别
68
+
69
+\- (BankCardResponse *) detectBankCardFromImage: (UIImage*)image;
70
+
71
+获取实例
72
+
73
+\+ (**instancetype**)shardService;
74
+
75
+设置秘钥
76
+
77
+\+ (**void**)setCredential:(Credential *)credential;
78
+
79
+## Tts接口使用方式
80
+
81
+获取合成的语音
82
+
83
+DhccTtsClient.doTts方法,此方法已设置OC及Swift都可调用,参数传递TtsRequest即可
84
+
85
+播放语音
86
+
87
+DhccTtsClient.play方法可以播放获取到的声音,此方法已设置OC及Swift都可调用,参数传递TtsRequest即可
88
+
89
+## 界面Swift App
90
+
91
+可以直接使用UI文件夹下对应功能的文件夹中的界面,对应OcrTest,FaceTest,TtsView三个界面
92
+
93
+## 界面OC Storyboard
94
+
95
+人脸在Sdks/UI/BDFaceFaceSDKUI/UI/Controller中使用ViewController即可
96
+
97
+OCR在/UI/OCR中直接使用Main.storyboard和OcrViewController即可
98
+
99
+Tts只需一个文本框或无需界面,自己实现获取文本内容,调用DhccTtsClient.doTts方法即可,DhccTtsClient.play即可播放声音

Loading…
Cancel
Save