iOS SDK API

SDK接口说明

  1. JVERIFICATIONService,包含SDK所有接口
  2. JVAuthConfig类,应用配置信息类
  3. JVUIConfig类,登录界面UI配置基类
  4. JVLayoutConstraint类,认证界面控件布局类
  5. JVLayoutItem,布局参照枚举

SDK初始化(新增回调参数)

支持的版本

开始支持的版本 2.3.6

接口定义

  • + setupWithConfig:(JVAuthConfig * )config;

    • 接口说明:
      • 初始化接口
    • 参数说明
      • config 配置类
    • 调用示例:
    // 如需使用 IDFA 功能请添加此代码并在初始化配置类中设置 advertisingId
    NSString *idfaStr = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];

    JVAuthConfig *config = [[JVAuthConfig alloc] init];
    config.appKey = @"AppKey copied from JiGuang Portal application";
    config.advertisingId = idfaStr;
    config.authBlock = ^(NSDictionary *result) {
        NSLog(@"初始化结果 result:%@", result);
    };
    [JVERIFICATIONService setupWithConfig:config];

SDK初始化

支持的版本

开始支持的版本 1.0.0

接口定义

  • + setupWithConfig:(JVAuthConfig * )config;

    • 接口说明:
      • 初始化接口
    • 参数说明
      • config 配置类
    • 调用示例:
    // 如需使用 IDFA 功能请添加此代码并在初始化配置类中设置 advertisingId
    NSString *idfaStr = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];

    JVAuthConfig *config = [[JVAuthConfig alloc] init];
    config.appKey = @"a0e6ace8d5b3e0247e3f58db";
    config.advertisingId = idfaStr;
    [JVERIFICATIONService setupWithConfig:config];

SDK获取初始化状态

支持的版本

开始支持的版本 2.3.2

  • + (BOOL)isSetupClient

    • 接口说明:
      • 初始化是否成功
    • 返回值说明
      • YES 初始化成功
      • NO 初始化失败
    • 调用示例:
BOOL isSetupClient = [JVERIFICATIONService isSetupClient];
if (isSetupClient) {
//初始化完成,可以进行后续操作
}

SDK设置debug模式

支持的版本

开始支持的版本 1.0.0

接口定义

  • + (void)setDebug:(BOOL)enable;
    • 接口说明:
      • 开启debug模式
    • 参数说明
      • enable 是否开启debug模式

SDK判断网络环境是否支持

支持的版本

开始支持的版本 1.1.2

接口定义

  • + (BOOL)checkVerifyEnable;

    • 接口说明:
      • 判断当前网络环境是否可以发起认证
    • 返回值说明

      • YES 可以认证
      • NO 不可以认证
    • 调用示例:

    if(![JVERIFICATIONService checkVerifyEnable]) {
        NSLog(@"当前网络环境不支持认证!");
        return;
    }
    //继续获取token操作
    ...

SDK获取号码认证token(新)

支持的版本

开始支持的版本 2.2.0

  • + (void)getToken:(NSTimeInterval)timeout completion:(void (^)(NSDictionary * result))completion;

    • 接口说明:
      • 获取手机号校验token
    • 参数说明

      • completion 参数是字典 返回token 、错误码等相关信息,token有效期1分钟, 一次认证后失效
      • result 字典 获取到token时key有operator、code、token字段,获取不到token是key为code和content字段
      • timeout 超时时间(毫秒),有效取值范围(0,10000]. 为保证获取token的成功率,建议设置为3000-5000ms.
    • 调用示例:

    [JVERIFICATIONService getToken:(NSTimeInterval)timeout completion:^(NSDictionary *result) {
        NSLog(@"getToken result:%@", result)
        //TODO:获取token后相关操作
    }];

SDK获取号码认证token(旧)

支持的版本

开始支持的版本 1.0.0

接口定义

  • + (void)getToken:(void (^)(NSDictionary * result))completion;

    • 接口说明:
      • 获取号码认证token,此接口已废弃,建议使用新接口
    • 参数说明

      • completion 参数是字典 返回token、错误码等相关信息,token一次认证后失效
      • result 字典 获取到token时key有operator、code、token字段,获取不到token时key为code和content字段
    • 调用示例:

    [JVERIFICATIONService getToken:^(NSDictionary *result) {
        NSLog(@"getToken result:%@", result)
        //TODO:获取token后相关操作
    }];

说明:开发者可以通过SDK获取token接口的回调信息来选择验证方式,若成功获取到token则可以继续使用极光认证进行号码验证;若获取token失败,需要换用短信验证码等方式继续完成验证。

SDK发起号码认证

2.4.3版本开始,此接口已移除

支持的版本

开始支持的版本 1.0.0

接口定义

  • + (void)verifyNumber:(JVAuthEntity * )entity result:(void (^)(NSDictionary * result))completion;

    • 接口说明:
      • 发起号码认证,验证手机号码和本机SIM卡号码是否一致
    • 参数说明:

      • completion 认证结果
      • result 字典 key为code和content两个字段
      • entity 认证实体类
    • 调用示例:

    JVAuthEntity *entity = [[JVAuthEntity alloc] init];
    entity.number = @"phone number";
    entity.token = @"your token";
    [JVERIFICATIONService verifyNumber:entity result:^(NSDictionary *result) {
        NSLog(@"verify result:%@", result);
    }];

说明:开发者调用该接口,需要在管理控制台找到该应用,并在[认证设置]-[其他设置]中开启[SDK发起认证],建议从开发者服务端发起号码认证。

SDK登录预取号

支持的版本

开始支持的版本 2.2.0

  • + (void)preLogin:(NSTimeInterval)timeout completion:(void (^)(NSDictionary *result))completion

    • 接口说明:
      • 验证当前运营商网络是否可以进行一键登录操作,该方法会缓存取号信息,提高一键登录效率。建议发起一键登录前先调用此方法。
    • 参数说明:

      • completion 预取号结果
      • result 字典 key为code和message两个字段
      • timeout 超时时间(毫秒),有效取值范围(0,10000]. 为保证获取token的成功率,建议设置为3000-5000ms.
    • 调用示例:

    [JVERIFICATIONService preLogin:5000 completion:^(NSDictionary *result) {
        NSLog(@"登录预取号 result:%@", result);
    }];

SDK清除预取号缓存

  • + (BOOL)clearPreLoginCache;

    • 接口说明:

      • 清除预取号缓存
    • 调用示例:

   [JVERIFICATIONService clearPreLoginCache]; 

SDK请求授权一键登录(新)

支持的版本

开始支持的版本 2.4.0

  • + (void)getAuthorizationWithController:(UIViewController *)vc hide:(BOOL)hide completion:(void (^)(NSDictionary *result))completion actionBlock:(void(^)(NSInteger type, NSString *content))actionBlock

    • 接口说明:
      • 授权登录
    • 参数说明:

      • completion 登录结果
      • result 字典 获取到token时key有operator、code、loginToken字段,获取不到token是key为code和content字段
      • vc 当前控制器
      • hide 完成后是否自动隐藏授权页。
      • actionBlock 授权页事件触发回调。包含type和content两个参数,type为事件类型,content为事件描述。 type = 1,授权页被关闭;type=2,授权页面被拉起;type=3,运营商协议被点击;type=4,自定义协议1被点击;type=5,自定义协议2被点击;type=6,checkBox变为选中;type=7,checkBox变为未选中;type=8,登录按钮被点击
    • 调用示例:

    [JVERIFICATIONService getAuthorizationWithController:self hide:YES completion:^(NSDictionary *result) {
        NSLog(@"一键登录 result:%@", result);
    } actionBlock:^(NSInteger type, NSString *content) {
        NSLog(@"一键登录 actionBlock :%ld %@", (long)type , content);
    }];

SDK请求授权一键登录(旧)

支持的版本

开始支持的版本 2.3.0

  • + (void)getAuthorizationWithController:(UIViewController *)vc hide:(BOOL)hide completion:(void (^)(NSDictionary *result))completion

    • 接口说明:
      • 授权一键登录
    • 参数说明:

      • completion 登录结果
      • result 字典 获取到token时key有operator、code、loginToken字段,获取不到token是key为code和content字段
      • vc 当前控制器
      • hide 完成后是否自动隐藏授权页,默认YES。若此字段设置为NO,请在收到一键登录回调后调用SDK提供的关闭授权页面方法。
    • 调用示例:

    [JVERIFICATIONService getAuthorizationWithController:self hide:YES completion:^(NSDictionary *result) {
        NSLog(@"一键登录 result:%@", result);
    }];

说明:获取到一键登录的loginToken后,将其返回给应用服务端,从服务端调用REST API来获取手机号码

SDK请求授权一键登录(旧)

支持的版本

开始支持的版本 2.0.0

接口定义

  • + (void)getAuthorizationWithController:(UIViewController *)vc completion:(void (^)(NSDictionary *result))completion

    • 接口说明:
      • 授权一键登录
    • 参数说明:

      • completion 登录结果
      • result 字典 获取到loginToken时key有operator、code、loginToken字段,获取不到loginToken时key为code和content字段
      • vc 当前控制器
    • 调用示例:

    [JVERIFICATIONService getAuthorizationWithController:self completion:^(NSDictionary *result) {
        NSLog(@"一键登录 result:%@", result);
    }];

SDK关闭授权页面

支持的版本

开始支持的版本 2.3.0

  • + (void)dismissLoginController;

    • 接口说明:

      • 关闭授权页
    • 调用示例:

    [JVERIFICATIONService dismissLoginController];

SDK自定义授权页面UI样式

开发者不得通过任何技术手段将授权页面的隐私协议栏、slogan隐藏或者覆盖,对于接入极光认证SDK并上线的应用,我方会对上线的应用授权页面做审查,如果发现未按要求设计授权页面,将关闭应用的一键登录服务。

支持的版本

开始支持的版本 2.0.0

接口定义

  • + (void)customUIWithConfig:(JVUIConfig *)UIConfig;

    • 接口说明:
      • 自定义登录页UI样式
    • 参数说明:
      • UIConfig JVUIConfig对象
    JVUIConfig *config = [[JVUIConfig alloc] init];
    config.navCustom = NO;
//    config.prefersStatusBarHidden = YES;
    config.shouldAutorotate = YES;
    config.autoLayout = YES;
//    config.orientation =  UIInterfaceOrientationPortrait;

    config.navReturnHidden = NO;
    config.privacyTextFontSize = 12;
    config.navText = [[NSAttributedString alloc]initWithString:@"登录统一认证" attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:18]}];
//    config.navColor = [UIColor redColor];
//    config.navBarBackGroundImage = [UIImage imageNamed:@"cmccLogo"];
    config.privacyTextAlignment = NSTextAlignmentLeft;
//    config.numberFont = [UIFont systemFontOfSize:10];
//    config.logBtnFont = [UIFont systemFontOfSize:5];
//    config.privacyShowBookSymbol = YES;
//    config.privacyLineSpacing = 5;
//    config.agreementNavBackgroundColor = [UIColor redColor];
//    config.sloganFont = [UIFont systemFontOfSize:30];
//    config.checkViewHidden = YES;
    config.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

    /*
    config.customLoadingViewBlock = ^(UIView *View) {
        MBProgressHUD *hub = [MBProgressHUD showHUDAddedTo:View animated:YES];
        hub.backgroundColor = [UIColor clearColor];
        hub.label.text = @"正在登录..";
        [hub showAnimated:YES];
    };
    */

    /*
    config.customPrivacyAlertViewBlock = ^(UIViewController *vc) {
        UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"请点击同意协议" message:nil preferredStyle:UIAlertControllerStyleAlert];
        [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]];
        [vc presentViewController:alert animated:true completion:nil];
    };
    */


    //logo
    config.logoImg = [UIImage imageNamed:@"cmccLogo"];
    CGFloat logoWidth = config.logoImg.size.width?:100;
    CGFloat logoHeight = logoWidth;
    JVLayoutConstraint *logoConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *logoConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:-90];
    JVLayoutConstraint *logoConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:logoWidth];
    JVLayoutConstraint *logoConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:logoHeight];
    config.logoConstraints = @[logoConstraintX,logoConstraintY,logoConstraintW,logoConstraintH];
    config.logoHorizontalConstraints = config.logoConstraints;



    //号码栏
    JVLayoutConstraint *numberConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *numberConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:-55];
    JVLayoutConstraint *numberConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:130];
    JVLayoutConstraint *numberConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:25];
    config.numberConstraints = @[numberConstraintX,numberConstraintY, numberConstraintW, numberConstraintH];
    config.numberHorizontalConstraints = config.numberConstraints;

    //slogan展示
    JVLayoutConstraint *sloganConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *sloganConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:-20];
    JVLayoutConstraint *sloganConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:130];
    JVLayoutConstraint *sloganConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:20];
    config.sloganConstraints = @[sloganConstraintX,sloganConstraintY, sloganConstraintW, sloganConstraintH];
    config.sloganHorizontalConstraints = config.sloganConstraints;


    //登录按钮
    UIImage *login_nor_image = [self imageNamed:@"loginBtn_Nor"];
    UIImage *login_dis_image = [self imageNamed:@"loginBtn_Dis"];
    UIImage *login_hig_image = [self imageNamed:@"loginBtn_Hig"];
    if (login_nor_image && login_dis_image && login_hig_image) {
        config.logBtnImgs = @[login_nor_image, login_dis_image, login_hig_image];
    }
    CGFloat loginButtonWidth = login_nor_image.size.width?:100;
    CGFloat loginButtonHeight = login_nor_image.size.height?:100;
    JVLayoutConstraint *loginConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *loginConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:30];
    JVLayoutConstraint *loginConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:loginButtonWidth];
    JVLayoutConstraint *loginConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:loginButtonHeight];
    config.logBtnConstraints = @[loginConstraintX,loginConstraintY,loginConstraintW,loginConstraintH];
    config.logBtnHorizontalConstraints = config.logBtnConstraints;

    //勾选框
    UIImage * uncheckedImg = [self imageNamed:@"checkBox_unSelected"];
    UIImage * checkedImg = [self imageNamed:@"checkBox_selected"];
    CGFloat checkViewWidth = uncheckedImg.size.width;
    CGFloat checkViewHeight = uncheckedImg.size.height;
    config.uncheckedImg = uncheckedImg;
    config.checkedImg = checkedImg;
    JVLayoutConstraint *checkViewConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeLeft multiplier:1 constant:20];
    JVLayoutConstraint *checkViewConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemPrivacy attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
    JVLayoutConstraint *checkViewConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:checkViewWidth];
    JVLayoutConstraint *checkViewConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:checkViewHeight];
    config.checkViewConstraints = @[checkViewConstraintX,checkViewConstraintY,checkViewConstraintW,checkViewConstraintH];
    config.checkViewHorizontalConstraints = config.checkViewConstraints;


    //隐私
    CGFloat spacing = checkViewWidth + 20 + 5;
    config.privacyState = YES;

    JVLayoutConstraint *privacyConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeLeft multiplier:1 constant:spacing];
    JVLayoutConstraint *privacyConstraintX2 = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeRight multiplier:1 constant:-spacing];
    JVLayoutConstraint *privacyConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeBottom multiplier:1 constant:-10];
    JVLayoutConstraint *privacyConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:50];
    config.privacyConstraints = @[privacyConstraintX,privacyConstraintX2,privacyConstraintY,privacyConstraintH];
    config.privacyHorizontalConstraints = config.privacyConstraints;


    //loading
    JVLayoutConstraint *loadingConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *loadingConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
    JVLayoutConstraint *loadingConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:30];
    JVLayoutConstraint *loadingConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:30];
    config.loadingConstraints = @[loadingConstraintX,loadingConstraintY,loadingConstraintW,loadingConstraintH];
    config.loadingHorizontalConstraints = config.loadingConstraints;


    /*
    config.authPageBackgroundImage = [UIImage imageNamed:@"背景图"];
    config.navColor = [UIColor redColor];
    config.preferredStatusBarStyle = 0;
    config.navText = [[NSAttributedString alloc] initWithString:@"自定义标题"];
    config.navReturnImg = [UIImage imageNamed:@"自定义返回键"];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, 0, 44, 44);
    button.backgroundColor = [UIColor greenColor];
    config.navControl = [[UIBarButtonItem alloc] initWithCustomView:button];
    config.logoHidden = NO;
    config.logBtnText = @"自定义登录按钮文字";
    config.logBtnTextColor = [UIColor redColor];
    config.numberColor = [UIColor blueColor];
    config.appPrivacyOne = @[@"应用自定义服务条款1",@"https://www.jiguang.cn/about"];
    config.appPrivacyTwo = @[@"应用自定义服务条款2",@"https://www.jiguang.cn/about"];
    config.privacyComponents = @[@"文本1",@"文本2",@"文本3",@"文本4"];
    config.appPrivacyColor = @[[UIColor redColor], [UIColor blueColor]];
    config.sloganTextColor = [UIColor redColor];
    config.navCustom = NO;
    config.numberSize = 24;
    config.privacyState = YES;
     */
    [JVERIFICATIONService customUIWithConfig:config customViews:nil];


SDK授权页面添加自定义控件

支持的版本

开始支持的版本 2.1.0

接口定义

  • + (void)customUIWithConfig:(JVUIConfig *)UIConfig customViews:(void(^)(UIView *customAreaView))customViewsBlk;

    • 接口说明:
      • 自定义授权页面UI样式,并添加自定义控件
    • 参数说明:

      • UIConfig JVUIConfig的子类
      • customViewsBlk 添加自定义视图的block
    • 调用示例:


    JVUIConfig *config = [[JVUIConfig alloc] init];
    config.navCustom = NO;
//    config.prefersStatusBarHidden = YES;
    config.shouldAutorotate = YES;
    config.autoLayout = YES;
//    config.orientation =  UIInterfaceOrientationPortrait;

    config.navReturnHidden = NO;
    config.privacyTextFontSize = 12;
    config.navText = [[NSAttributedString alloc]initWithString:@"登录统一认证" attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:18]}];
//    config.navColor = [UIColor redColor];
//    config.navBarBackGroundImage = [UIImage imageNamed:@"cmccLogo"];
    config.privacyTextAlignment = NSTextAlignmentLeft;
//    config.numberFont = [UIFont systemFontOfSize:10];
//    config.logBtnFont = [UIFont systemFontOfSize:5];
//    config.privacyShowBookSymbol = YES;
//    config.privacyLineSpacing = 5;
//    config.agreementNavBackgroundColor = [UIColor redColor];
//    config.sloganFont = [UIFont systemFontOfSize:30];
//    config.checkViewHidden = YES;
    config.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

    /*
    config.customLoadingViewBlock = ^(UIView *View) {

        //https://github.com/jdg/MBProgressHUD
        MBProgressHUD *hub = [MBProgressHUD showHUDAddedTo:View animated:YES];
        hub.backgroundColor = [UIColor clearColor];
        hub.label.text = @"正在登录..";
        [hub showAnimated:YES];
    };
    */

    /*
    config.customPrivacyAlertViewBlock = ^(UIViewController *vc) {
        UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"请点击同意协议" message:nil preferredStyle:UIAlertControllerStyleAlert];
        [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]];
        [vc presentViewController:alert animated:true completion:nil];
    };
    */


    //logo
    config.logoImg = [UIImage imageNamed:@"cmccLogo"];
    CGFloat logoWidth = config.logoImg.size.width?:100;
    CGFloat logoHeight = logoWidth;
    JVLayoutConstraint *logoConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *logoConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:-90];
    JVLayoutConstraint *logoConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:logoWidth];
    JVLayoutConstraint *logoConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:logoHeight];
    config.logoConstraints = @[logoConstraintX,logoConstraintY,logoConstraintW,logoConstraintH];
    config.logoHorizontalConstraints = config.logoConstraints;



    //号码栏
    JVLayoutConstraint *numberConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *numberConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:-55];
    JVLayoutConstraint *numberConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:130];
    JVLayoutConstraint *numberConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:25];
    config.numberConstraints = @[numberConstraintX,numberConstraintY, numberConstraintW, numberConstraintH];
    config.numberHorizontalConstraints = config.numberConstraints;

    //slogan展示
    JVLayoutConstraint *sloganConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *sloganConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:-20];
    JVLayoutConstraint *sloganConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:130];
    JVLayoutConstraint *sloganConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:20];
    config.sloganConstraints = @[sloganConstraintX,sloganConstraintY, sloganConstraintW, sloganConstraintH];
    config.sloganHorizontalConstraints = config.sloganConstraints;


    //登录按钮
    UIImage *login_nor_image = [self imageNamed:@"loginBtn_Nor"];
    UIImage *login_dis_image = [self imageNamed:@"loginBtn_Dis"];
    UIImage *login_hig_image = [self imageNamed:@"loginBtn_Hig"];
    if (login_nor_image && login_dis_image && login_hig_image) {
        config.logBtnImgs = @[login_nor_image, login_dis_image, login_hig_image];
    }
    CGFloat loginButtonWidth = login_nor_image.size.width?:100;
    CGFloat loginButtonHeight = login_nor_image.size.height?:100;
    JVLayoutConstraint *loginConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *loginConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:30];
    JVLayoutConstraint *loginConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:loginButtonWidth];
    JVLayoutConstraint *loginConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:loginButtonHeight];
    config.logBtnConstraints = @[loginConstraintX,loginConstraintY,loginConstraintW,loginConstraintH];
    config.logBtnHorizontalConstraints = config.logBtnConstraints;

    //勾选框
    UIImage * uncheckedImg = [self imageNamed:@"checkBox_unSelected"];
    UIImage * checkedImg = [self imageNamed:@"checkBox_selected"];
    CGFloat checkViewWidth = uncheckedImg.size.width;
    CGFloat checkViewHeight = uncheckedImg.size.height;
    config.uncheckedImg = uncheckedImg;
    config.checkedImg = checkedImg;
    JVLayoutConstraint *checkViewConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeLeft multiplier:1 constant:20];
    JVLayoutConstraint *checkViewConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemPrivacy attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
    JVLayoutConstraint *checkViewConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:checkViewWidth];
    JVLayoutConstraint *checkViewConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:checkViewHeight];
    config.checkViewConstraints = @[checkViewConstraintX,checkViewConstraintY,checkViewConstraintW,checkViewConstraintH];
    config.checkViewHorizontalConstraints = config.checkViewConstraints;


    //隐私
    CGFloat spacing = checkViewWidth + 20 + 5;
    config.privacyState = YES;

    JVLayoutConstraint *privacyConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeLeft multiplier:1 constant:spacing];
    JVLayoutConstraint *privacyConstraintX2 = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeRight multiplier:1 constant:-spacing];
    JVLayoutConstraint *privacyConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeBottom multiplier:1 constant:-10];
    JVLayoutConstraint *privacyConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:50];
    config.privacyConstraints = @[privacyConstraintX,privacyConstraintX2,privacyConstraintY,privacyConstraintH];
    config.privacyHorizontalConstraints = config.privacyConstraints;


    //loading
    JVLayoutConstraint *loadingConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *loadingConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
    JVLayoutConstraint *loadingConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:30];
    JVLayoutConstraint *loadingConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:30];
    config.loadingConstraints = @[loadingConstraintX,loadingConstraintY,loadingConstraintW,loadingConstraintH];
    config.loadingHorizontalConstraints = config.loadingConstraints;


    /*
    config.authPageBackgroundImage = [UIImage imageNamed:@"背景图"];
    config.navColor = [UIColor redColor];
    config.preferredStatusBarStyle = 0;
    config.navText = [[NSAttributedString alloc] initWithString:@"自定义标题"];
    config.navReturnImg = [UIImage imageNamed:@"自定义返回键"];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, 0, 44, 44);
    button.backgroundColor = [UIColor greenColor];
    config.navControl = [[UIBarButtonItem alloc] initWithCustomView:button];
    config.logoHidden = NO;
    config.logBtnText = @"自定义登录按钮文字";
    config.logBtnTextColor = [UIColor redColor];
    config.numberColor = [UIColor blueColor];
    config.appPrivacyOne = @[@"应用自定义服务条款1",@"https://www.jiguang.cn/about"];
    config.appPrivacyTwo = @[@"应用自定义服务条款2",@"https://www.jiguang.cn/about"];
    config.privacyComponents = @[@"文本1",@"文本2",@"文本3",@"文本4"];
    config.appPrivacyColor = @[[UIColor redColor], [UIColor blueColor]];
    config.sloganTextColor = [UIColor redColor];
    config.navCustom = NO;
    config.numberSize = 24;
    config.privacyState = YES;
     */
    [JVERIFICATIONService customUIWithConfig:config customViews:^(UIView *customAreaView) {
        /*
        //添加一个自定义label
        UILabel *lable  = [[UILabel alloc] init];
        lable.text = @"这是一个自定义label";
        [lable sizeToFit];
        lable.center = customAreaView.center;
        [customAreaView addSubview:lable];
         */

    }];

JVLayoutItem枚举

枚举值 枚举说明
JVLayoutItemNone 不参照任何item。可用来直接设置width、height
JVLayoutItemLogo 参照logo视图
JVLayoutItemNumber 参照号码栏
JVLayoutItemSlogan 参照标语栏
JVLayoutItemLogin 参照登录按钮
JVLayoutItemCheck 参照隐私选择框
JVLayoutItemPrivacy 参照隐私栏
JVLayoutItemSuper 参照父视图

JVLayoutConstraint类

属性说明:

参数名称 参数类型 参数说明
firstAttribute NSLayoutAttribute 约束类型
relation NSLayoutRelation 与参考视图之间的约束关系
item JVLayoutItem 参照item
attr2 NSLayoutAttribute 参照item约束类型
multiplier CGFloat 乘数
c CGFloat 常量

创建JVLayoutConstraint布局对象

  • + (instancetype)constraintWithAttribute:(NSLayoutAttribute)attr1
                                                       relatedBy:(NSLayoutRelation)relation
                                                            toItem:(JVLayoutItem)item
                                                        attribute:(NSLayoutAttribute)attr2
                                                      multiplier:(CGFloat)multiplier
                                                       constant:(CGFloat)c;

  • 接口说明:

    • 创建JVLayoutConstraint布局对象
  • 接口说明:

    • attr1 约束类型
    • relation 与参照视图之间的约束关系
    • item 参照item
    • attr2 参照item约束类型
    • multiplier 乘数
    • c 常量
  • 调用示例:

    CGFloat windowW = 300;
    CGFloat windowH = 300;
    JVLayoutConstraint *windowConstraintX = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
    JVLayoutConstraint *windowConstraintY = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemSuper attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
    JVLayoutConstraint *windowConstraintW = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeWidth multiplier:1 constant:windowW];
    JVLayoutConstraint *windowConstraintH = [JVLayoutConstraint constraintWithAttribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:JVLayoutItemNone attribute:NSLayoutAttributeHeight multiplier:1 constant:windowH];
    config.windowConstraints = @[windowConstraintX,windowConstraintY,windowConstraintW,windowConstraintH];

JVAuthConfig类

应用配置信息类。以下是属性说明:

参数名称 参数类型 参数说明
AppKey NSString 极光系统应用唯一标识,必填
channel NSString 应用发布渠道,可选
advertisingId NSString 广告标识符,可选
timeout NSTimeInterval 设置初始化超时时间,单位毫秒,合法范围是(0,30000],推荐设置为5000-10000,默认值为10000
isProduction BOOL 是否生产环境。如果为开发状态,设置为NO;如果为生产状态,应改为YES。可选,默认为NO
authBlock Block 初始化回调,包含code和content两个参数。在timeout时间内未完成则返回超时

JVUIConfig类

授权界面UI配置基类。以下是属性说明:

  • 授权页面设置
参数名称 参数类型 参数说明
authPageBackgroundImage UIImage 授权界面背景图片
autoLayout BOOL 是否使用autoLayout,默认YES,
shouldAutorotate BOOL 是否支持自动旋转 默认YES
orientation UIInterfaceOrientation 设置进入授权页的屏幕方向,不支持UIInterfaceOrientationPortraitUpsideDown
modalTransitionStyle UIModalTransitionStyle 授权页弹出方式,弹窗模式下不支持 UIModalTransitionStylePartialCurl
  • 导航栏
参数名称 参数类型 参数说明
navCustom BOOL 是否隐藏导航栏(适配全屏图片)
navColor UIColor 导航栏颜色
barStyle UIBarStyle 此方法从v2.5.0版本开始已废弃。建议使用preferredStatusBarStyle控制状态栏。preferredStatusBarStyle默认为UIStatusBarStyleDefault,当barStyle的效果和preferredStatusBarStyle冲突时,barStyle的效果会失效。
preferredStatusBarStyle UIStatusBarStyle 授权页 preferred status bar style,取代barStyle参数
navText NSAttributedString 导航栏标题
navReturnImg UIImage 导航返回图标
navControl UIBarButtonItem 导航栏右侧自定义控件
prefersStatusBarHidden BOOL *竖屏情况下,是否隐藏状态栏。默认NO.在项目的Info.plist文件里设置UIViewControllerBasedStatusBarAppearance为YES.注意:弹窗模式下无效,是否隐藏由外部控制器控制
navTransparent BOOL 导航栏是否透明,默认不透明。此参数和navBarBackGroundImage冲突,应避免同时使用
navReturnHidden BOOL 导航栏默认返回按钮隐藏,默认不隐藏
navReturnImageEdgeInsets UIEdgeInsets 导航栏返回按钮图片缩进,默认为UIEdgeInsetsZero
navDividingLineHidden BOOL 导航栏分割线是否隐藏,默认隐藏
navBarBackGroundImage UIImage 导航栏背景图片.此参数和navTransparent冲突,应避免同时使用
  • LOGO
参数名称 参数类型 参数说明
logoImg UIImage LOGO图片
logoWidth CGFloat LOGO图片宽度
logoHeight CGFloat LOGO图片高度
logoOffsetY CGFloat LOGO图片偏移量
logoConstraints NSArray LOGO图片布局对象
logoHorizontalConstraints NSArray LOGO图片 横屏布局,横屏时优先级高于logoConstraints
logoHidden BOOL LOGO图片隐藏
  • 登录按钮
参数名称 参数类型 参数说明
logBtnText NSString 登录按钮文本
logBtnOffsetY CGFloat 登录按钮Y偏移量
logBtnConstraints NSArray 登录按钮布局对象
logBtnHorizontalConstraints NSArray 登录按钮 横屏布局,横屏时优先级高于logBtnConstraints
logBtnTextColor UIImage 登录按钮文本颜色
logBtnFont UIFont 登录按钮字体,默认跟随系统
logBtnImgs UIColor 登录按钮背景图片添加到数组(顺序如下) @[激活状态的图片,失效状态的图片,高亮状态的图片]
  • 手机号码
参数名称 参数类型 参数说明
numberColor UIColor 手机号码字体颜色
numberSize CGFloat 手机号码字体大小
numberFont UIFont 手机号码字体,优先级高于numberSize
numFieldOffsetY CGFloat 号码栏Y偏移量
numberConstraints NSArray 号码栏布局对象
numberHorizontalConstraints NSArray 号码栏 横屏布局,横屏时优先级高于numberConstraints
  • checkBox
参数名称 参数类型 参数说明
uncheckedImg UIImage checkBox未选中时图片
checkedImg UIImage checkBox选中时图片
checkViewConstraints NSArray checkBox布局对象
checkViewHorizontalConstraints NSArray checkBox横屏布局,横屏优先级高于checkViewConstraints
checkViewHidden BOOL checkBox是否隐藏,默认不隐藏
privacyState BOOL 隐私条款check框默认状态 默认:NO
  • 隐私协议栏
参数名称 参数类型 参数说明
appPrivacyOne NSArray 隐私条款一:数组(务必按顺序)@[条款名称,条款链接]
appPrivacyTwo NSArray 隐私条款二:数组(务必按顺序)@[条款名称,条款链接]
appPrivacyColor UIImage 隐私条款名称颜色 @[基础文字颜色,条款颜色]
privacyTextFontSize CGFloat 隐私条款字体大小,默认12
privacyOffsetY CGFloat 隐私条款Y偏移量(注:此属性为与屏幕底部的距离)
privacyComponents NSArray 隐私条款拼接文本数组
privacyConstraints NSArray 隐私条款布局对象
privacyHorizontalConstraints NSArray 隐私条款 横屏布局,横屏下优先级高于privacyConstraints
privacyTextFontSize CGFloat 隐私条款字体大小,默认12
privacyTextAlignment NSTextAlignment 隐私条款文本对齐方式,目前仅支持 left、center
privacyShowBookSymbol BOOL 隐私条款是否显示书名号,默认不显示
privacyLineSpacing CGFloat 隐私条款行距,默认跟随系统
customPrivacyAlertViewBlock Block类型 当自定义Alert view,当隐私条款未选中时,点击登录按钮时回调,当此参数存在时,未选中隐私条款的情况下,登录按钮可以被点击block内部参数为自定义Alert view可被添加的控制器,详细用法可参见示例demo
  • 隐私协议页面
参数名称 参数类型 参数说明
agreementNavBackgroundColor UIColor 协议页导航栏背景颜色
agreementNavText NSAttributedString 协议页导航栏标题
agreementNavReturnImage UIImage 协议页导航栏返回按钮图片
  • slogan
参数名称 参数类型 参数说明
sloganOffsetY CGFloat slogan偏移量Y
sloganConstraints NSArray slogan布局对象
sloganHorizontalConstraints NSArray slogan 横屏布局,横屏下优先级高于sloganConstraints
sloganTextColor UIColor slogan文字颜色
sloganFont UIFont slogan文字font,默认12
  • loading
参数名称 参数类型 参数说明
loadingConstraints NSArray loading布局对象
loadingHorizontalConstraints NSArray 默认loading 横屏布局,横屏下优先级高于loadingConstraints
customLoadingViewBlock Block类型 自定义loading view,当授权页点击登录按钮时回调。当此参数存在时,默认loading view不会显示,需开发者自行设计loading view。block内部参数为自定义loading view可被添加的父视图,详细用法可参见示例demo
  • 弹窗
参数名称 参数类型 参数说明
showWindow BOOL 是否弹窗,默认no
windowBackgroundImage UIImage 弹框内部背景图片
windowBackgroundAlpha CGFloat 弹窗外侧 透明度 0~1.0
windowCornerRadius CGFloat 弹窗圆角数值
windowConstraints NSArray 弹窗布局对象
windowHorizontalConstraints NSArray 弹窗横屏布局,横屏下优先级高于windowConstraints
windowCloseBtnImgs NSArray 弹窗close按钮图片 @[普通状态图片,高亮状态图片]
windowCloseBtnConstraints NSArray 弹窗close按钮布局
windowCloseBtnHorizontalConstraints NSArray 弹窗close按钮 横屏布局,横屏下优先级高于windowCloseBtnConstraints

JVerification

JVMobileUIConfig类

移动登录界面UI配置类,JVUIConfig的子类。

JVUnicomUIConfig类

联通登录界面UI配置类,JVUIConfig的子类。

JVTelecomUIConfig类

电信登录界面UI配置类,JVUIConfig的子类。

错误码列表

code 描述 备注
1000 verify consistent 手机号验证一致
1001 verify not consistent 手机号验证不一致
1002 unknown result 未知结果
1003 token expired token失效
1004 sdk verify has been closed SDK发起认证未开启
1005 AppKey 不存在 请到官网检查 Appkey 对应的应用是否已被删除
1006 frequency of verifying single number is beyond the maximum limit 同一号码自然日内认证消耗超过限制
1007 beyond daily frequency limit appKey自然日认证消耗超过限制
1008 AppKey 非法 请到官网检查此应用详情中的 Appkey,确认无误
1009 当前的 Appkey 下没有创建 iOS 应用;你所使用的 JCore 版本过低 请到官网检查此应用的应用详情;更新应用中集成的 JCore 至最新。
1010 verify interval is less than the minimum limit 同一号码连续两次提交认证间隔过短
2000 token request success 获取token 成功
2001 fetch token error 获取token失败
2002 sdk init failed sdk初始化失败
2003 netwrok not reachable 网络连接不通
2004 get uid failed 极光服务注册失败
2005 request timeout 请求超时
2006 fetch config failed 获取配置失败
2008 Token requesting, please wait 正在获取token中,稍后再试
2009 verifying, please try again later 正在认证中,稍后再试
2014 internal error while requesting token 请求token时发生内部错误
2015 rsa encode failed rsa加密失败
2016 network type not supported 当前网络环境不支持认证
2017 carrier config invalid 运营商配置无效
4001 参数错误。请检查参数,比如是否手机号格式不对
4009 解密rsa失败
4018 没有足够的余额
4031 不是认证用户
4032 获取不到用户配置
4033 Login feature is not available 未开启一键登录
6000 loginToken request success 获取loginToken成功
6001 fetch loginToken failed 获取loginToken失败
6002 login cancel 用户取消登录
6003 UI load error UI加载异常
6004 authorization requesting, please try again later 正在登录中,稍候再试
6006 prelogin scrip expired 预取号信息过期,请重新预取号
7000 preLogin success 预取号成功
7001 preLogin failed 预取号失败
7002 preLogin requesting, please try again later 取号中
8000 init success 初始化成功
8004 init failed 初始化失败
8005 init timeout 初始化超时

Copyright 2011-2019, jiguang.cn, All Rights Reserved.
粤ICP备12056275号-13 深圳市和讯华谷信息技术有限公司

Documentation built with MkDocs.