接入文档![](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxnIGZpbGw9IiM3MDcwNzgiPgogIDxwb2x5Z29uIHBvaW50cz0iOC4zOTc3NzgwMzQyMTAyMDUsMCA5LjQzNTgwMzg5MDIyODI3MSwwIDQuNzE3ODc3Mzg4MDAwNDg4LDEyIDMuNjg0MDMzMzkzODU5ODYzMywxMiAiLz4KIDwvZz4KPC9zdmc+Cg==)
FaceID海外基础版(中文)![](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxnIGZpbGw9IiM3MDcwNzgiPgogIDxwb2x5Z29uIHBvaW50cz0iOC4zOTc3NzgwMzQyMTAyMDUsMCA5LjQzNTgwMzg5MDIyODI3MSwwIDQuNzE3ODc3Mzg4MDAwNDg4LDEyIDMuNjg0MDMzMzkzODU5ODYzMywxMiAiLz4KIDwvZz4KPC9zdmc+Cg==)
APP接入![](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxnIGZpbGw9IiM3MDcwNzgiPgogIDxwb2x5Z29uIHBvaW50cz0iOC4zOTc3NzgwMzQyMTAyMDUsMCA5LjQzNTgwMzg5MDIyODI3MSwwIDQuNzE3ODc3Mzg4MDAwNDg4LDEyIDMuNjg0MDMzMzkzODU5ODYzMywxMiAiLz4KIDwvZz4KPC9zdmc+Cg==)
SDK集成![](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxnIGZpbGw9IiM3MDcwNzgiPgogIDxwb2x5Z29uIHBvaW50cz0iOC4zOTc3NzgwMzQyMTAyMDUsMCA5LjQzNTgwMzg5MDIyODI3MSwwIDQuNzE3ODc3Mzg4MDAwNDg4LDEyIDMuNjg0MDMzMzkzODU5ODYzMywxMiAiLz4KIDwvZz4KPC9zdmc+Cg==)
ios![](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxnIGZpbGw9IiM3MDcwNzgiPgogIDxwb2x5Z29uIHBvaW50cz0iOC4zOTc3NzgwMzQyMTAyMDUsMCA5LjQzNTgwMzg5MDIyODI3MSwwIDQuNzE3ODc3Mzg4MDAwNDg4LDEyIDMuNjg0MDMzMzkzODU5ODYzMywxMiAiLz4KIDwvZz4KPC9zdmc+Cg==)
集成
集成
# 添加Framework文件到项目
在Xcode工具中点击TARGETS->Build Phases-> Link Binary With Libaries中点击“+”按钮,在弹出的窗口中点击“Add Other”按钮,选择 MGFaceIDBaseKit.framework和MGFaceIDLiveDetect.framework 同时添加到工程中。
注:静态库中采用Objective-C++实现,因此需要您保证您工程中至少有一个.mm后缀的源文件(您可以将任意一个.m后缀的文件改名为.mm),或者在工程属性中指定编译方式,即在Xcode的Project -> Edit Active Target -> Build Setting 中找到 Compile Sources As,并将其设置为"Objective-C++"。
# 引入所需的系统库
需要在您的Xcode工程中引入AVFoundation.framework、CoreMedia.framework、CoreMotion.framework、SystemConfiguration.framework、WebKit.framework系统库。
# 引入 .bundle 资源文件(非必选)
选中工程名,在右键菜单中选择Add Files to “工程名”…,选择 bundle文件,并勾选“Copy items if needed”复选框,单击“Add”按钮,将资源文件添加到工程中,需要勾选 (Add to targets)
到指定的 target
。
# 添加硬件权限
因相机需要,请在 info.plist
中添加 Privacy - Camera Usage Description
权限。
该文档未解决您的疑问?
查看常见问题