人脸识别登陆

作者: 何年何月 | 来源:发表于2016-04-21 18:52 被阅读1015次

今天介绍一个非常简单的人脸识别SDK,一登官网,非常方便快捷!虽然功能不太完善,有兴趣的同僚可以研究一下,下面切入主题

导入类库###

pod "SuperID"

AppDelegate中引入头文件#import "SuperID.h"###

    [[SuperID sharedInstance]registerAppWithAppID:@"51fd8946d072a54727ead360" withAppSecret:@"985d924b84435a0daff478fa"];
    
    //开启SuperID SDK的调试模式,开发者在Release时,将该模式设置为NO.
    [SuperID setDebugMode:YES];
    //设置一登 SDK 的语言模式,默认为自动模式。
    [SuperID setLanguageMode:SIDAutoMode];

在ViewController中遵循协议SuperIDDelegate设置代理###

-(void)viewWillAppear:(BOOL)animated{
    
    [SuperID sharedInstance].delegate = self;
    
}

实现代理方法

/**
 *  添加一登 SDK 的委托方法
 */
- (void)superID:(SuperID *)sender userDidFinishLoginWithUserInfo:(NSDictionary *)userInfo withOpenId:(NSString *)openId error:(NSError *)error{
    
    if (!error) {
        
        //授权登录成功
        NSLog(@"userInfo:%@", userInfo);
        NSLog(@"openId = %@", openId);
        
        /**
         userInfo:{
         avatar = "xxxxx.jpg";
         name = "\U5f90\U9a8f\U6770V1\Uff01";
         persona = {
         character = reserved;
         gender = male;
         generation = 90s;
         location = {
         city = "\U6df1\U5733";
         country = CN;
         province = "\U5e7f\U4e1c";
         };
         tags = (
         eyeglasses
         );
         };
         phone = 136xxxx9914;
         }
         openId = xxxxxxxxxxxxxx
         
         */
        
        // 识别成功的处理事件
        TableViewController *tableVC = [[TableViewController alloc]init];
        tableVC.userInfo = userInfo;
        tableVC.openId = openId;
        tableVC.navigationItem.hidesBackButton = YES;
        [self.navigationController pushViewController:tableVC animated:YES];

        
        
    }else{
        
        //授权登录失败
        NSLog(@"Login Fail Error =%ld,%@",(long)[error code],[error localizedDescription]);
    }
    
}


人脸识别按钮事件###


- (IBAction)faceLoginBtn:(UIButton *)sender {
    
    NSError *error = nil;
    
    id SIDLoginViewController = [[SuperID sharedInstance]obtainLoginViewControllerWithError:&error];
    
    if (SIDLoginViewController) {
        
        [self presentViewController:SIDLoginViewController animated:YES completion:nil];
        
    }else{
        
        NSLog(@"Error =%ld,%@",(long)[error code],[error localizedDescription]);
    }

}

就这么几句代码非常便捷:Demo下载地址

相关文章

  • 人脸识别登陆

    今天介绍一个非常简单的人脸识别SDK,一登官网,非常方便快捷!虽然功能不太完善,有兴趣的同僚可以研究一下,下面切入...

  • 人脸识别技术 通识

    人脸识别技术 通识 1 人脸识别概要 2 人脸识别工作原理 3 人脸识别技术分类 4 人脸识别技术优缺点 5 人脸...

  • 都在说人脸识别有Bug,是真的吗?

    “人脸识别破解”“反人脸识别技术”“人脸识别漏洞”“人脸识别失误”“尽量不要用人脸识别”….网上N多这样的信息铺天...

  • 2020-06-09

    云卡通人脸识别系统含盖:动态人脸识别门禁管理系统、动态人脸识别消费系统、动态人脸识别考勤系统。其中动态人脸识别消费...

  • 人脸识别闸机安装知识

    随着人脸识别技术的成熟,人脸识别闸机越来越受欢迎,在选型上也丰富多样。人脸识别闸机包含人脸识别摆闸、人脸识别翼闸、...

  • 2020-07-28

    一、人脸识别系统具有广泛的应用:包括人脸识别出入管理系统、人脸识别门禁考勤系统、人面识别消费管理系统、人脸识别通道...

  • 人脸识别 -- 活体检测(张嘴摇头识别)

    一:简介 最近项目在做了身份证银行卡识别之后,开始实现人脸识别和活体识别,其中人脸识别包括人脸入库、人脸查找、人脸...

  • facexx解析:人脸识别技术市场在哪些领域?

    人脸识别技术经历了可见光图像人脸识别、三维图像人脸识别/热成像人脸识别、基于主动近红外图像的多光源人脸识别三层进化...

  • Android实现人脸识别(人脸检测)初识

    title: Android实现人脸识别(人脸检测)初识categories: Androidtags: 人脸识别...

  • h

    # 多人脸识别系统 [^]: by CathyZhang ## 背景 > 多人脸识别,又称为M:N人脸识别,主要用...

网友评论

  • 风规自远:不用pod怎么需要添加哪些库?
    何年何月:@二的拾次方 哈哈,我也是之前玩玩的,并没有上项目
    风规自远:@何年何月 昨天我下载你的demo 然后重新把里面的SDK直接导入到项目中就行了
    何年何月:@二的拾次方 http://www.superid.me/developer/document-ios/ios_quickstart.html去官方文档看吧,很详细的,下个demo看看有哪些也行
  • 左左4143:吊吊吊

本文标题:人脸识别登陆

本文链接:https://www.haomeiwen.com/subject/vqctrttx.html