- 下载一登SDK iOS SDK下载
- 复制文件夹
SuperID-SDK-iOS
至 Sample 工程文档目录下。 - 开始调试运行
在工程的Bridging_Header
头文件中添加
#import "SuperID.h"
#import "SuperIDDelegate.h"
#import "SIDFaceFeatureViewController.h"
确保已经引入下列框架,否则可能会出错:
AVFoundation.framework
CoreMedia.framework
CoreTelephony.framework
同时确保在 Build Setting
的 Other Linker Flags
中添加以下代码:
-lstdc++
-Objc
-force_load
$(PROJECT_DIR)/SuperID_SDK/libSuperIDSDK.a
如果遇到下面的错误:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
需要在 Info.plist
添加摄像头与相册权限描述(用于选择用户头像):
<key>NSPhotoLibraryUsageDescription </key>
<string>SuperID需要访问你的相册</string>
<key>NSCameraUsageDescription</key>
<string>SuperID需要访问你的摄像头</string>