文档

iOS客户端接入

更新时间:

本文为您介绍iOS客户端一键登录的集成方法及接口的功能示例。

说明

在使用过程中如有疑问,可以提交工单联系阿里云技术工程师处理。

下载SDK

登录号码认证产品控制台,在概览页面右侧API&SDK区域,单击立即下载,进入API&SDK页面,根据页面提示下载并解压对应SDK。

创建认证方案

您导入项目或调用API接口时,会用到方案Code等参数信息,请先在号码认证产品控制台创建认证方案,获取方案Code等参数信息。

集成方式

集成分动态库静态库ATAuthSDK_D.frameworkATAuthSDK.framework不能同时集成到工程里,两者是同一个SDK,前者是动态库,后者是静态库。

  • 若您集成静态库,则需要集成以下组件:

    ATAuthSDK.frameworkYTXMonitor.frameworkYTXOperators.framework

  • 若您集成动态库,则需要集成以下组件:

    ATAuthSDK_D.framework

集成静态库操作

  1. 创建工程。

    下载并安装Xcode,点击Create a new Xcode project,根据页面引导创建一个新工程。

  2. 添加主库和系统库。

    方式一:

    在菜单栏选择Targets > Build Phases > Linked Frameworks and Libraries,添加主库ATAuthSDK.frameworkYTXMonitor.frameworkYTXOperators.framework,添加系统库Network.framework33

    方式二:

    在Xcode中Targets > General > Frameworks,Libraries, and Embedded Content,添加主库ATAuthSDK.frameworkYTXMonitor.frameworkYTXOperators.framework,添加系统库Network.framework

    说明

    添加主库时Embed选择Do Not Embed类型。

    35iOS12.0版本开始支持Network.framework,请在菜单栏选择Targets > Build Phases > Linked Frameworks and Libraries > Status,将Status设置为弱依赖关系。

  3. BuildSettings设置。

    在菜单栏选择Targets > BuildSettings > Other Linker Flags

    Other Linker Flags增加-ObjC-framework"YTXOperators"image

  4. 添加ATAuthSDK.bundle资源文件。

    主项目右键添加ATAuthSDK.framework > ATAuthSDK.bundle资源⽂件,否则⼀键登录授权页面默认的图片或icon不显示。

    或在Targets > Build Phases > Copy Bundle Resources,添加ATAuthSDK.bundleimage

集成动态库操作

  • 动态库不一定包含模拟器架构,可使用lipo -info指令查询动态库支持的模拟器架构。若因包含模拟器架构而导致编译报错,请使用lipo -thin指令剔除可执行文件中的模拟器架构。

  • 无需将动态库解压文件直接拖到工程中,因解压包含有ATAuthSDK_D.framework.dSYM符号文件,该文件是线上crash符号翻译专用,如果放到工程中会影响App上架审核,只需将ATAuthSDK_D.framework拖进工程即可。

  1. 添加主库。

    方式一:

    在Xcode中Targets > General > Frameworks,Libraries, and Embedded Content,添加主库ATAuthSDK_D.framework

    说明

    添加主库时Embed选择Embed & Sign类型。

    image

    方式二:

    Targets > Build Phases > Linked Frameworks and LibrariesEmbed Frameworks,添加主库ATAuthSDK_D.frameworkimage

  2. 添加ATAuthSDK.bundle资源文件。

    主项目右键添加ATAuthSDK.framework > ATAuthSDK.bundle资源⽂件,否则⼀键登录授权页面默认的图片或icon不显示。

    或在Targets > Build Phases > Copy Bundle Resources,添加ATAuthSDK.bundleimage

交互流程详解

完整的功能交互流程请参见一键登录交互流程

SDK方法说明

获取认证实例(sharedInstance)

/**
 *  获取该类的单例实例对象
 *  @return 单例实例对象
 */
+ (instancetype _Nonnull )sharedInstance;

使用示例

TXCommonHandler *handller = [TXCommonHandler sharedInstance];

必调方法:设置SDK密钥(setAuthSDKInfo)

/**
 *  初始化SDK调用参数,App生命周期内调用一次
 *  @param  info app对应的密钥
 *  @param  complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, msg:...},其他情况时"resultCode"值请参考PNSReturnCode
 */
- (void)setAuthSDKInfo:(NSString * _Nonnull)info complete:(void(^_Nullable)(NSDictionary * _Nonnull resultDic))complete;

使用示例

    [[TXCommonHandler sharedInstance] setAuthSDKInfo:@"xxxx"
        complete:^(NSDictionary * _Nonnull resultDic) {
        NSLog(@"设置密钥结果:%@", resultDic);
    }];

必调方法:一键登录获取Token(getLoginTokenWithTimeout)

/**
 *  获取一键登录Token,调用该接口首先会弹起授权页,点击授权页的登录按钮获取Token
 *  @warning 注意的是,如果前面没有调用 accelerateLoginPageWithTimeout:complete: 接口,该接口内部会自动先帮我们调用,成功后才会弹起授权页,所以有一个明显的等待过程
 *  @param  timeout 接口超时时间,单位s,默认为3.0s
 *  @param  controller 唤起自定义授权页的容器,内部会对其进行验证,检查是否符合条件
 *  @param  model 自定义授权页面选项,可为nil,采用默认的授权页面,具体请参考TXCustomModel.h文件
 *  @param  complete 结果异步回调到主线程,"resultDic"里面的"resultCode"值请参考PNSReturnCode,如下:
 *
 *          授权页控件点击事件:700000(点击授权页返回按钮)、700001(点击切换其他登录方式)、
 *          700002(点击登录按钮事件,根据返回字典里面的 "isChecked"字段来区分check box是否被选中,只有被选中的时候内部才会去获取Token)、700003(点击check box事件)、700004(点击协议富文本文字)
            接口回调其他事件:600001(授权页唤起成功)、600002(授权页唤起失败)、600000(成功获取Token)、600011(获取Token失败)、
 *          600015(获取Token超时)、600013(运营商维护升级,该功能不可用)、600014(运营商维护升级,该功能已达最大调用次数).....
 */
- (void)getLoginTokenWithTimeout:(NSTimeInterval)timeout controller:(UIViewController *_Nonnull)controller model:(TXCustomModel *_Nullable)model complete:(void (^_Nullable)(NSDictionary * _Nonnull resultDic))complete;

使用示例

  [[TXCommonHandler sharedInstance] getLoginTokenWithTimeout:3.0
                                                    controller:self
                                                         model:model
                                                      complete:^(NSDictionary * _Nonnull resultDic) {
                                                      NSLog(@"一键登录结果:%@", resultDic);
                                                      }];

必调方法:注销登录页面(cancelLoginVCAnimated)

/**
 *  注销授权页,建议用此方法,对于移动卡授权页的消失会清空一些数据
 *  @param flag 是否添加动画
 *  @param complete 成功返回
 */
- (void)cancelLoginVCAnimated:(BOOL)flag complete:(void (^_Nullable)(void))complete;

使用示例

  [[TXCommonHandler sharedInstance] cancelLoginVCAnimated:YES complete:nil];

选调方法:一键登录预取号(accelerateLoginPageWithTimeout)

/**
 *  加速一键登录授权页弹起,防止调用 getLoginTokenWithTimeout:controller:model:complete: 等待弹起授权页时间过长
 *  @param  timeout 接口超时时间,单位:秒,默认为3.0s
 *  @param  complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, msg:...},其他情况时"resultCode"值请参考PNSReturnCode
 */
- (void)accelerateLoginPageWithTimeout:(NSTimeInterval)timeout complete:(void (^_Nullable)(NSDictionary * _Nonnull resultDic))complete;

使用示例

    [[TXCommonHandler sharedInstance] accelerateLoginPageWithTimeout:3.0 complete:^(NSDictionary * _Nonnull resultDic) {
        NSLog(@"为后面授权页拉起加个速,加速结果:%@", resultDic);
    }];

其他接口说明

选调方法:获取版本号

/**
 *  获取当前SDK版本号
 *  @return 字符串,SDK版本号
 */
- (NSString *_Nonnull)getVersion;

使用示例

NSString *version = [[TXCommonHandler sharedInstance] getVersion];

选调方法:环境检查

/**
 *  检查当前环境是否支持一键登录或号码认证,resultDic返回 PNSCodeSuccess说明当前环境支持
 *  @param  authType 服务类型 PNSAuthTypeVerifyToken 本机号码校验流程,PNSAuthTypeLoginToken 一键登录流程
 *  @param  complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, msg:...},其他情况时"resultCode"值请参考PNSReturnCode,只有成功回调才能保障后续接口调用
 */
- (void)checkEnvAvailableWithAuthType:(PNSAuthType)authType complete:(void (^_Nullable)(NSDictionary * _Nullable resultDic))complete;

使用示例

[[TXCommonHandler sharedInstance] checkEnvAvailableWithAuthType:PNSAuthTypeVerifyToken complete:^(NSDictionary * _Nullable resultDic) {
        NSLog(@"环境检查结果:%@",resultDic);
}];

选调方法:设置checkbox选中状态

/**
 *  授权页弹起后,修改checkbox按钮选中状态,当checkout按钮隐藏时,设置不生效
 */
- (void)setCheckboxIsChecked:(BOOL)isChecked;

使用示例

[[TXCommonHandler sharedInstance] setCheckboxIsChecked:YES];

选调方法:隐藏一键登录获取登录Token后的等待动画

/**
 *  手动隐藏一键登录获取登录Token之后的等待动画,默认为自动隐藏,当设置 TXCustomModel 实例 autoHideLoginLoading = NO 时, 可调用该方法手动隐藏
 */
- (void)hideLoginLoading;

使用示例

[[TXCommonHandler sharedInstance] hideLoginLoading];

日志埋点控制对象

获取到该对象后可以进行相关的日志设置。

/**
 *  获取日志埋点相关控制对象
 */
- (PNSReporter * _Nonnull)getReporter;

使用示例

PNSReporter *reporter = [[TXCommonHandler sharedInstance] getReporter];

控制台日志输出开关

/**
 *  控制台日志输出开关,若开启会以PNS_LOGGER为开始标记对日志进行输出,Release模式记得关闭!
 *  @param enable 开关参数,默认为NO
 */
- (void)setConsolePrintLoggerEnable:(BOOL)enable;

使用示例

PNSReporter *reporter = [[TXCommonHandler sharedInstance] getReporter];
[reporter setConsolePrintLoggerEnable:YES];

设置日志及埋点上传开关

/**
 *  设置日志及埋点上传开关,但不会对通过 setupUploader: 接口实现的自定义上传方法起作用
 *  @param  enable 开关设置BOOL值,默认为YES
 */
- (void)setUploadEnable:(BOOL)enable;

使用示例

PNSReporter *reporter = [[TXCommonHandler sharedInstance] getReporter];
[reporter setUploadEnable:YES];

工具类TXCommonUtils

判断设备蜂窝网络是否开启(checkDeviceCellularDataEnable)

/**
 判断当前设备蜂窝数据网络是否开启,即3G、4G
 @return 结果
 */
+ (BOOL)checkDeviceCellularDataEnable;

判断当前上网卡是否是中国联通(isChinaUnicom)

/**
判断当前上网卡运营商是否是中国联通
@return 结果
*/
+ (BOOL)isChinaUnicom;

判断当前上网卡是否是中国移动(isChinaMobile)

/**
判断当前上网卡运营商是否是中国移动
@return 结果
*/
+ (BOOL)isChinaMobile;

判断当前上网卡是否是中国电信(isChinaTelecom)

/**
判断当前上网卡运营商是否是中国电信
@return 结果
*/
+ (BOOL)isChinaTelecom;

获取当前上网卡运营商名称(getCurrentCarrierName)

/**
获取当前上网卡运营商名称,比如中国移动、中国电信、中国联通
@return 结果
*/
+ (NSString *)getCurrentCarrierName;

获取当前上网网络类型(getNetworktype)

/**
获取当前上网卡网络类型,比如Wi-Fi,4G
@return 结果
*/
+ (NSString *)getNetworktype;

判断设备是否有SIM卡(simSupportedIsOK)

/**
判断当前设备是否有SIM卡
@return 结果
*/
+ (BOOL)simSupportedIsOK;

判断无线网络是否开启(isWWANOpen)

/**
 判断无线网络是否开着(通过p0网卡判断,无Wi-Fi或有Wi-Fi情况下都能检测到)
 @return 结果
 */
+ (BOOL)isWWANOpen;

判断无Wi-Fi下无线网络是否开启(reachableViaWWAN)

/**
 判断无线网络是否开启(仅无Wi-Fi情况下)
 @return 结果
 */
+ (BOOL)reachableViaWWAN;

获取设备当前网络私网IP地址(getMobilePrivateIPAddress)

/**
 获取设备当前网络私网IP地址
  @return 结果
 */
+ (NSString *)getMobilePrivateIPAddress:(BOOL)preferIPv4;

获取当前设备的唯一标识ID(getUniqueID)

/**
 获取当前设备的唯一标识ID,用于埋点的精确查找使用
 */
+ (NSString *)getUniqueID;

通过颜色设置生成图片(imageWithColor)

/**
通过颜色设置生成图片,支持弧度设置,比如一键登录按钮背景图片
*/
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size isRoundedCorner:(BOOL )isRounded radius:(CGFloat)radius;

UI页面接口说明

全屏授权页面设计规范

编组..png

状态栏

prefersStatusBarHidden: 状态栏是否隐藏,默认NO。

preferredStatusBarStyle: 状态栏主题风格,默认UIStatusBarStyleDefault。

导航栏

  • navIsHidden: 设置导航栏是否隐藏。

  • navColor: 设置导航栏主题色。

  • navTitle: 设置导航栏标题内容、文字大小、颜色。

  • navBackImage: 设置导航栏返回图片。

  • hideNavBackItem: 设置导航栏返回按钮是否隐藏。

  • navMoreView: 导航栏右侧自定义控件,可以在创建该VIEW时添加手势操作,或者创建按钮或者其他赋值给VIEW。

  • navBackButtonFrameBlock: 构建导航栏返回按钮的frame,view布局或者布局发生变化时调用,不实现则默认处理。

  • navTitleFrameBlock: 构建导航栏标题的frame,view布局或布局发生变化时调用,不实现则默认处理。

  • navMoreViewFrameBlock: 构建导航栏右侧more view 的frame,view布局或布局发生变化时调用,不实现则按默认处理。

  • privacyNavColor: 协议详情页导航栏背景颜色设置。

  • privacyNavTitleFont: 协议详情页导航栏标题字体、大小。

  • privacyNavTitleColor: 协议详情页导航栏标题颜色。

  • privacyNavBackImage: 协议详情页导航栏返回图片。

Logo区

  • logoImage: logo图片设置。

  • logoIsHidden: logo是否隐藏,默认NO。

  • logoFrameBlock:构建logo的frame,view布局或布局发生变化时调用,不实现则按默认处理。

Slogan

  • sloganText: 设置slogan文案,内容、大小、颜色。

  • sloganIsHidden: 设置slogan是否隐藏、默认不隐藏。

  • sloganFrameBlock: 构建slogan的frame,view布局或者布局发生变化时调用,不实现则按默认处理。

掩码栏

  • numberColor: 设置掩码颜色。

  • numberFont: 设置掩码字体大小设置,<16则不生效。

  • numberFrameBlock: 构建号码的frame,view布局或布局发生变化时调用,只有x,y生效,不实现则按默认处理,设置不能超出父视图content view。

编组..png

登录按钮

  • loginBtnText: 设置登录按钮文案、内容、大小、颜色。

  • loginBtnBgImgs: 登录按钮背景图片组,默认高度50.0pt,@[激活状态的图片、失效状态的图片、高亮状态的图片]。

  • autoHideLoginLoading: 是否自动隐藏点击登录按钮之后授权页上转圈的loading,默认为YES,在获取登录Token成功后自动隐藏,如果设置为NO,需要自己手动调用[[TXCommonHandler, sharedInstance] hideLoginLoading]隐藏。

  • loginBtnFrameBlock: 构建登录按钮frame,view布局或布局发生变化时调用,不实现则按默认处理,不能超出父视图content view,height不能小于40,width不能小于父视图宽度的一半。

切换到其他方式

  • changeBtnTitle: changeBtn标题,内容,大小,颜色。

  • changeBtnIsHidden: changeBtn是否隐藏,默认NO。

  • changeBtnFrameBlock: 构建changeBtn的frame,view布局或布局发生变化时调用,不实现则按默认处理。

自定义控件区(如其他方式登录)

  • customViewBlock: 自定义控件添加,注意:自定义视图的创建初始化和添加到父视图都需要在主线程中。

  • customViewLayoutBlock: 每次授权页布局完成时会调用该block,可以在该block实现里面设置自定义添加控件的frame。

  • 您可以在除了协议、掩码、登录按钮之外的区域添加自定义控件。

协议栏

  • checkBoxImages: 设置checkBox图片组,[uncheckedImg, checkedImg]。

  • checkBoxIsChecked: checkBox是否勾选,默认NO。

  • checkBoxIsHidden: checkBox是否隐藏,默认NO。

  • checkBoxWH: checkBox大小,高宽一样,必须大于0。

  • privacyOne: 协议1,[协议名称,协议Url], 注:两个协议名称不能相同。

  • privacyTwo: 协议2,[协议名称,协议Url], 注:两个协议名称不能相同。

  • privacyColors: 协议内容颜色数组,[非点击文案颜色,点击文案颜色]。

  • privacyAligment: 协议文案支持居中,居左设置,默认居左。

  • privacyPreText: 协议整体文案,前缀部分文案。

  • privacySufText: 协议整体文案,后缀部分文案。

  • privacyOperatorPreText: 运营商协议名称前缀文案,仅支持<、(、[、{、(、【、『、。

  • privacyOperatorSufText: 运营商协议 >、)、]、}、)、】、』。

  • privacyFont: 协议整体文案字体大小,小于12.0 不生效。

  • privacyFrameBlock: 构建协议整体(包括checkBox)的frame,view布局或布局发生变化时调用,不实现则按默认处理,如果设置的width小于checkBox的宽度则不生效,最小值为0,最大width,height为父视图宽高,最终会根据设置进来的width对协议文本进行自适应,得到的size是协议空间的最终大小。

  • privacyOperatorColor:运营商协议内容颜色 ,优先级最高,如果privacyOperatorColors不设置,则取privacyColors中的点击文案颜色,privacyColors不设置,则是默认色。

  • privacyOneColor:协议1内容颜色,优先级最高,如果privacyOneColors不设置,则取privacyColors中的点击文案颜色,privacyColors不设置,则是默认色。

  • privacyTwoColor:协议2内容颜色,优先级最高,如果privacyTwoColors不设置,则取privacyColors中的点击文案颜色,privacyColors不设置,则是默认色。

  • privacyThreeColor:协议3内容颜色,优先级最高,如果privacyThreeColors不设置,则取privacyColors中的点击文案颜色,privacyColors不设置,则是默认色。

其他全屏页面属性

  • contentViewFrameBlock: 全屏、弹窗模式设置,授权页面中,渲染并显示所有空间的view,称为content view,不实现该block默认为全屏模式。

    * 实现弹窗的方案 x > 0 || y > 0, width < 屏幕宽度 || height < 屏幕高度。

  • supportedInterfaceOrientations: 横屏、竖屏模式设置,注意:在刘海屏,UIInterfaceOrientationMaskPortraitUpsideDown 属性慎用!

  • presentDirection: 授权页面弹出方向,默认PNSPresentationDirectionBottom。

弹窗授权页面设计规范

编组 2..png

标题栏

  • alertTitleBarColor: 标题栏背景颜色。

  • alertBarIsHidden: 标题栏是否隐藏。

  • alertTitle: 标题栏标题内容、大小、颜色。

  • alertCloseImage: 标题栏右侧关闭按钮图片设置。

  • alertCloseItemIsHidden: 标题栏右侧关闭按钮是否显示,默认NO。

  • alertTitleBarFrameBlock: 构建标题栏的frame,view布局或布局发生变化时调用,不实现则按默认处理,实现时仅有height生效。

  • alertTitleFrameBlock: 构建标题栏的frame,view布局或布局发生变化时调用,不实现则按默认处理。

  • alertCloseItemFrameBlock: 构建标题栏右侧关闭按钮的frame、view布局或布局发生变化时调用,不实现则按默认处理。

其他弹窗页面属性

  • contentViewFrameBlock: 全屏、弹窗模式设置,授权页面中,渲染并显示所有空间的view,称content view,不实现该block默认为全屏模式。

  • supportedInterfaceOrientations: 横屏、竖屏模式设置,注意:在刘海屏,UIInterfaceOrientationMaskPortraitUpsideDown 属性慎用!

  • presentDirection: 授权页面弹出方向,默认PNSPresentationDirectionBottom。

  • alertBlurViewColor: 底部蒙层背景色,默认黑色。

  • alertBlurViewAlpha: 底部蒙层背景透明度,默认0.5。

  • alertCornerRadiusArray: contentView的四个圆角值,顺序为左上、左下、右下、右上,需要填充4个值,不足4个值则无效,如果值<=0则为直角。

  • setTapAuthPageMaskClosePage:设置授权页弹窗模式,点击非弹窗区域关闭授权页。true,关闭。false,不关闭。

其他部分的页面设计请参见全屏授权页面设计规范

唤起授权页示例

//1. 设置SDK参数,App生命周期内调用一次即可
NSString *info = @"客户的密钥串";
__weak typeof(self) weakSelf = self;
//设置SDK参数,App生命周期内调用一次即可
[[TXCommonHandler sharedInstance] setAuthSDKInfo:info complete:^(NSDictionary * _Nonnull resultDic) {
    [weakSelf showResult:resultDic];
}];


//2. 检测当前环境是否支持一键登录
__block BOOL support = YES;
[[TXCommonHandler sharedInstance] checkEnvAvailableWithAuthType:PNSAuthTypeLoginToken complete:^(NSDictionary * _Nullable resultDic) {
    support = [PNSCodeSuccess isEqualToString:[resultDic objectForKey:@"resultCode"]];
}];	

//3. 开始一键登录流程
//3.1 调用加速授权页弹起接口,提前获取必要参数,为后面弹起授权页加速
[[TXCommonHandler sharedInstance] accelerateLoginPageWithTimeout:timeout complete:^(NSDictionary * _Nonnull resultDic) {
    if ([PNSCodeSuccess isEqualToString:[resultDic objectForKey:@"resultCode"]] == NO) {
        [ProgressHUD showError:@"取号,加速授权页弹起失败"];
        [weakSelf showResult:resultDic];
        return ;
    }

    //3.2 调用获取登录Token接口,可以立马弹起授权页,model的创建需要放在主线程
    [ProgressHUD dismiss];
    [[TXCommonHandler sharedInstance] getLoginTokenWithTimeout:timeout controller:weakSelf model:model complete:^(NSDictionary * _Nonnull resultDic) {

        NSString *code = [resultDic objectForKey:@"resultCode"];
        if ([PNSCodeLoginControllerPresentSuccess isEqualToString:code]) {
            [ProgressHUD showSuccess:@"弹起授权页成功"];
        } else if ([PNSCodeLoginControllerClickCancel isEqualToString:code]) {
            [ProgressHUD showSuccess:@"点击了授权页的返回"];
        } else if ([PNSCodeLoginControllerClickChangeBtn isEqualToString:code]) {
            [ProgressHUD showSuccess:@"点击切换其他登录方式按钮"];
        } else if ([PNSCodeLoginControllerClickLoginBtn isEqualToString:code]) {
            if ([[resultDic objectForKey:@"isChecked"] boolValue] == YES) {
                [ProgressHUD showSuccess:@"点击了登录按钮,check box选中,SDK内部接着会去获取登录Token"];
            } else {
                [ProgressHUD showSuccess:@"点击了登录按钮,check box选中,SDK内部不会去获取登录Token"];
            }
        } else if ([PNSCodeLoginControllerClickCheckBoxBtn isEqualToString:code]) {
            [ProgressHUD showSuccess:@"点击check box"];
        } else if ([PNSCodeLoginControllerClickProtocol isEqualToString:code]) {
            [ProgressHUD showSuccess:@"点击了协议富文本"];
        } else if ([PNSCodeSuccess isEqualToString:code]) {
            //点击登录按钮获取登录Token成功回调
            NSString *token = [resultDic objectForKey:@"token"];
            //下面用Token去服务器换手机号,此处仅做参考
            [PNSVerifyTopRequest requestLoginWithToken:token complete:^(BOOL isSuccess, NSString * _Nonnull msg, NSDictionary * _Nonnull data) {
                NSString *popCode = [data objectForKey:@"code"];
                NSDictionary *module = [data objectForKey:@"module"];
                NSString *mobile = module[@"mobile"];
                if ([popCode isEqualToString:@"OK"] && mobile.length > 0) {
                    [ProgressHUD showSuccess:@"一键登录成功"];
                } else {
                    [ProgressHUD showSuccess:@"一键登录失败"];
                }
                dispatch_async(dispatch_get_main_queue(), ^{
                    [[TXCommonHandler sharedInstance] cancelLoginVCAnimated:YES complete:nil];
                });
                [weakSelf showResult:data];
            }];
        } else {
            [ProgressHUD showError:@"获取登录Token失败"];
        }
        [weakSelf showResult:resultDic];
    }];
}];

授权页全屏模式示例

支持横竖屏切换。

TXCustomModel *model = [[TXCustomModel alloc] init];

model.navColor = UIColor.orangeColor;
model.navTitle = [[NSAttributedString alloc] initWithString:@"一键登录(全屏)" attributes:@{NSForegroundColorAttributeName : UIColor.whiteColor,NSFontAttributeName : [UIFont systemFontOfSize:20.0]}];
//model.navIsHidden = NO;
model.navBackImage = [UIImage imageNamed:@"icon_nav_back_light"];
//model.hideNavBackItem = NO;
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeSystem];
[rightBtn setTitle:@"更多" forState:UIControlStateNormal];
model.navMoreView = rightBtn;

model.privacyNavColor = UIColor.orangeColor;
model.privacyNavBackImage = [UIImage imageNamed:@"icon_nav_back_light"];
model.privacyNavTitleFont = [UIFont systemFontOfSize:20.0];
model.privacyNavTitleColor = UIColor.whiteColor;

model.logoImage = [UIImage imageNamed:@"taobao"];
//model.logoIsHidden = NO;
//model.sloganIsHidden = NO;
model.sloganText = [[NSAttributedString alloc] initWithString:@"一键登录slogan文案" attributes:@{NSForegroundColorAttributeName : UIColor.orangeColor,NSFontAttributeName : [UIFont systemFontOfSize:16.0]}];
model.numberColor = UIColor.orangeColor;
model.numberFont = [UIFont systemFontOfSize:30.0];
model.loginBtnText = [[NSAttributedString alloc] initWithString:@"一键登录" attributes:@{NSForegroundColorAttributeName : UIColor.whiteColor,NSFontAttributeName : [UIFont systemFontOfSize:20.0]}];
//model.autoHideLoginLoading = NO;
//model.privacyOne = @[@"《隐私1》",@"https://www.taobao.com/"];
//model.privacyTwo = @[@"《隐私2》",@"https://www.taobao.com/"];
model.privacyColors = @[UIColor.lightGrayColor, UIColor.orangeColor];
model.privacyAlignment = NSTextAlignmentCenter;
model.privacyFont = [UIFont fontWithName:@"PingFangSC-Regular" size:13.0];
model.privacyOperatorPreText = @"《";
model.privacyOperatorSufText = @"》";
//model.checkBoxIsHidden = NO;
model.checkBoxWH = 17.0;
model.changeBtnTitle = [[NSAttributedString alloc] initWithString:@"切换到其他方式" attributes:@{NSForegroundColorAttributeName : UIColor.orangeColor,NSFontAttributeName : [UIFont systemFontOfSize:18.0]}];
//model.changeBtnIsHidden = NO;
//model.prefersStatusBarHidden = NO;
model.preferredStatusBarStyle = UIStatusBarStyleLightContent;
//model.presentDirection = PNSPresentationDirectionBottom;

//授权页默认控件布局调整
//model.navBackButtonFrameBlock =
//model.navTitleFrameBlock =
model.navMoreViewFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    CGFloat width = superViewSize.height;
    CGFloat height = width;
    return CGRectMake(superViewSize.width - 15 - width, 0, width, height);
};
model.loginBtnFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        frame.origin.y = 20;
        return frame;
    }
    return frame;
};
model.sloganFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        return CGRectZero; //横屏时模拟隐藏该控件
    } else {
        return CGRectMake(0, 140, superViewSize.width, frame.size.height);
    }
};
model.numberFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        frame.origin.y = 140;
    }
    return frame;
};
model.loginBtnFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        frame.origin.y = 185;
    }
    return frame;
};
model.changeBtnFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        return CGRectZero; //横屏时模拟隐藏该控件
    } else {
        return CGRectMake(10, frame.origin.y, superViewSize.width - 20, 30);
    }
};
//model.privacyFrameBlock =

//添加自定义控件并对自定义控件进行布局
__block UIButton *customBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[customBtn setTitle:@"这是一个自定义控件" forState:UIControlStateNormal];
[customBtn setBackgroundColor:UIColor.redColor];
customBtn.frame = CGRectMake(0, 0, 230, 40);
model.customViewBlock = ^(UIView * _Nonnull superCustomView) {
    [superCustomView addSubview:customBtn];
};
model.customViewLayoutBlock = ^(CGSize screenSize, CGRect contentViewFrame, CGRect navFrame, CGRect titleBarFrame, CGRect logoFrame, CGRect sloganFrame, CGRect numberFrame, CGRect loginFrame, CGRect changeBtnFrame, CGRect privacyFrame) {
    CGRect frame = customBtn.frame;
    frame.origin.x = (contentViewFrame.size.width - frame.size.width) * 0.5;
    frame.origin.y = CGRectGetMinY(privacyFrame) - frame.size.height - 20;
    frame.size.width = contentViewFrame.size.width - frame.origin.x * 2;
    customBtn.frame = frame;
};
	
// 横竖屏切换
model.supportedInterfaceOrientations = UIInterfaceOrientationMaskAllButUpsideDown;
// 仅支持竖屏
model.supportedInterfaceOrientations = UIInterfaceOrientationMaskPortrait;
// 仅支持横屏
model.supportedInterfaceOrientations = UIInterfaceOrientationMaskLandscape;

全屏模式下二次弹窗示例

 TXCustomModel *model = [[TXCustomModel alloc] init];
    model.supportedInterfaceOrientations = UIInterfaceOrientationMaskPortrait;
    model.navColor = [UIColor orangeColor];
    NSDictionary *attributes = @{
        NSForegroundColorAttributeName : [UIColor whiteColor],
        NSFontAttributeName : [UIFont systemFontOfSize:20.0]
    };
    model.navTitle = [[NSAttributedString alloc] initWithString:@"一键登录" attributes:attributes];
    model.navBackImage = [UIImage imageNamed:@"icon_nav_back_light"];
    model.logoImage = [UIImage imageNamed:@"taobao"];
    model.changeBtnIsHidden = YES;
    model.privacyOne = @[@"协议1", @"https://www.taobao.com"];
    
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeSystem];
    [button1 setTitle:button1Title forState:UIControlStateNormal];
    [button1 addTarget:target1 action:selector1 forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeSystem];
    [button2 setTitle:button2Title forState:UIControlStateNormal];
    [button2 addTarget:target2 action:selector2 forControlEvents:UIControlEventTouchUpInside];
    model.privacyAlignment = NSTextAlignmentRight;
    model.customViewBlock = ^(UIView * _Nonnull superCustomView) {
        [superCustomView addSubview:button1];
        [superCustomView addSubview:button2];
    };
    model.customViewLayoutBlock = ^(CGSize screenSize, CGRect contentViewFrame, CGRect navFrame, CGRect titleBarFrame, CGRect logoFrame, CGRect sloganFrame, CGRect numberFrame, CGRect loginFrame, CGRect changeBtnFrame, CGRect privacyFrame) {
        button1.frame = CGRectMake(CGRectGetMinX(loginFrame),
                                   CGRectGetMaxY(loginFrame) + 20,
                                   CGRectGetWidth(loginFrame),
                                   30);
        
        button2.frame = CGRectMake(CGRectGetMinX(loginFrame),
                                   CGRectGetMaxY(button1.frame) + 15,
                                   CGRectGetWidth(loginFrame),
                                   30);
    };
    model.privacyAlertIsNeedShow = YES;
    model.privacyAlertMaskAlpha = 0.5;
    model.privacyAlertMaskColor = UIColor.blackColor;
    model.privacyAlertCornerRadiusArray = @[@10,@10,@10,@10];
    model.privacyAlertBackgroundColor = UIColor.whiteColor;
    model.privacyAlertAlpha = 1.0;
    model.privacyAlertTitleBackgroundColor = UIColor.whiteColor;
    model.privacyAlertContentBackgroundColor = UIColor.whiteColor;
    model.privacyAlertTitleFont = [UIFont systemFontOfSize:16];
    model.privacyAlertTitleColor = UIColor.blackColor;
    model.privacyAlertContentColors = @[UIColor.grayColor, UIColor.orangeColor];
    model.privacyAlertContentAlignment = NSTextAlignmentCenter;
    UIImage *activeImage = [TXCommonUtils imageWithColor:UIColor.orangeColor size:CGSizeMake(UIScreen.mainScreen.bounds.size.width - 2 * 18, 50) isRoundedCorner:YES radius:10];
    UIImage *hightLightImage = [TXCommonUtils imageWithColor:UIColor.grayColor size:CGSizeMake(UIScreen.mainScreen.bounds.size.width - 2 * 18, 50) isRoundedCorner:YES radius:10];
    model.privacyAlertBtnBackgroundImages = @[activeImage, hightLightImage];
    model.privacyAlertButtonTextColors = @[UIColor.whiteColor,UIColor.blueColor];
    model.privacyAlertButtonFont = [UIFont systemFontOfSize:18];
    model.privacyAlertCloseButtonIsNeedShow = YES;
    model.privacyAlertMaskIsNeedShow = YES;
    model.privacyAlertIsNeedAutoLogin = NO;
    model.tapPrivacyAlertMaskCloseAlert = NO;
    model.expandAuthPageCheckedScope = YES;
    model.privacyAlertCloseButtonIsNeedShow = YES;
    model.privacyAlertTitleFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
        return CGRectMake(0, 20, frame.size.width, frame.size.height);
    };
    model.privacyAlertPrivacyContentFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
        return CGRectMake(0, frame.origin.y+10, frame.size.width, frame.size.height);
    };
    model.privacyAlertButtonFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
        return CGRectMake(frame.origin.x,superViewSize.height - 50 - 20, frame.size.width, 50);;
    };
    model.privacyAlertFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
        return CGRectMake(40, (superViewSize.height - 150)*0.5, screenSize.width-80, 150);
    };

授权页弹窗模式示例

支持横竖屏切换。

TXCustomModel *model = [[TXCustomModel alloc] init];

model.alertCornerRadiusArray = @[@10, @10, @10, @10];
//model.alertCloseItemIsHidden = YES;
model.alertTitleBarColor = UIColor.orangeColor;
model.alertTitle = [[NSAttributedString alloc] initWithString:@"一键登录(弹窗)" attributes:@{NSForegroundColorAttributeName : UIColor.whiteColor, NSFontAttributeName : [UIFont systemFontOfSize:20.0]}];
model.alertCloseImage = [UIImage imageNamed:@"icon_close_light"];

model.privacyNavColor = UIColor.orangeColor;
model.privacyNavBackImage = [UIImage imageNamed:@"icon_nav_back_light"];
model.privacyNavTitleFont = [UIFont systemFontOfSize:20.0];
model.privacyNavTitleColor = UIColor.whiteColor;

model.logoImage = [UIImage imageNamed:@"taobao"];
//model.logoIsHidden = NO;
//model.sloganIsHidden = NO;
model.sloganText = [[NSAttributedString alloc] initWithString:@"一键登录slogan文案" attributes:@{NSForegroundColorAttributeName : UIColor.orangeColor,NSFontAttributeName : [UIFont systemFontOfSize:16.0]}];
model.numberColor = UIColor.orangeColor;
model.numberFont = [UIFont systemFontOfSize:30.0];
model.loginBtnText = [[NSAttributedString alloc] initWithString:@"一键登录" attributes:@{NSForegroundColorAttributeName : UIColor.whiteColor, NSFontAttributeName : [UIFont systemFontOfSize:20.0]}];
//model.autoHideLoginLoading = NO;
//model.privacyOne = @[@"《隐私1》",@"https://www.taobao.com/"];
//model.privacyTwo = @[@"《隐私2》",@"https://www.taobao.com/"];
model.privacyColors = @[UIColor.lightGrayColor, UIColor.orangeColor];
model.privacyAlignment = NSTextAlignmentCenter;
model.privacyFont = [UIFont fontWithName:@"PingFangSC-Regular" size:13.0];
model.privacyOperatorPreText = @"《";
model.privacyOperatorSufText = @"》";
//model.checkBoxIsHidden = NO;
model.checkBoxWH = 17.0;
model.changeBtnTitle = [[NSAttributedString alloc] initWithString:@"切换到其他方式" attributes:@{NSForegroundColorAttributeName : UIColor.orangeColor,NSFontAttributeName : [UIFont systemFontOfSize:18.0]}];
//model.changeBtnIsHidden = NO;
//model.prefersStatusBarHidden = NO;
//model.preferredStatusBarStyle = UIStatusBarStyleDefault;
//model.presentDirection = PNSPresentationDirectionBottom;

CGFloat ratio = MAX(TX_SCREEN_WIDTH, TX_SCREEN_HEIGHT) / 667.0;

//实现该block,并且返回的frame的x或y大于0,则认为是弹窗谈起授权页
model.contentViewFrameBlock = ^CGRect(CGSize screenSize, CGSize contentSize, CGRect frame) {
    CGFloat alertX = 0;
    CGFloat alertY = 0;
    CGFloat alertWidth = 0;
    CGFloat alertHeight = 0;
    if ([self isHorizontal:screenSize]) {
        alertX = ratio * TX_Alert_Horizontal_Default_Left_Padding;
        alertWidth = screenSize.width - alertX * 2;
        alertY = (screenSize.height - alertWidth * 0.5) * 0.5;
        alertHeight = screenSize.height - 2 * alertY;
    } else {
        alertX = TX_Alert_Default_Left_Padding * ratio;
        alertWidth = screenSize.width - alertX * 2;
        alertY = TX_Alert_Default_Top_Padding * ratio;
        alertHeight = screenSize.height - alertY * 2;
    }
    return CGRectMake(alertX, alertY, alertWidth, alertHeight);
};

//授权页默认控件布局调整
//model.alertTitleBarFrameBlock =
//model.alertTitleFrameBlock =
//model.alertCloseItemFrameBlock =
model.logoFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        return CGRectZero; //横屏时模拟隐藏该控件
    } else {
        frame.origin.y = 10;
        return frame;
    }
};
model.sloganFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        return CGRectZero; //横屏时模拟隐藏该控件
    } else {
        frame.origin.y = 110;
        return frame;
    }
};
model.numberFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        frame.origin.y = 20;
        frame.origin.x = (superViewSize.width * 0.5 - frame.size.width) * 0.5 + 18.0;
    } else {
        frame.origin.y = 140;
    }
    return frame;
};
model.loginBtnFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        frame.origin.y = 60;
        frame.size.width = superViewSize.width * 0.5; //登录按钮最小宽度是其父视图的一半,再小就不生效了
    } else {
        frame.origin.y = 180;
    }
    return frame;
};
model.changeBtnFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
    if ([self isHorizontal:screenSize]) {
        return CGRectZero; //横屏时模拟隐藏该控件
    } else {
        return CGRectMake(10, 240, superViewSize.width - 20, 30);
    }
};
//model.privacyFrameBlock =

//添加自定义控件并对自定义控件进行布局
__block UIButton *customBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[customBtn setTitle:@"这是一个自定义控件" forState:UIControlStateNormal];
[customBtn setBackgroundColor:UIColor.redColor];
model.customViewBlock = ^(UIView * _Nonnull superCustomView) {
    [superCustomView addSubview:customBtn];
};
model.customViewLayoutBlock = ^(CGSize screenSize, CGRect contentViewFrame, CGRect navFrame, CGRect titleBarFrame, CGRect logoFrame, CGRect sloganFrame, CGRect numberFrame, CGRect loginFrame, CGRect changeBtnFrame, CGRect privacyFrame) {
    CGFloat padding = 15;
    CGFloat x = 0;
    CGFloat y = 0;
    CGFloat width = 0;
    CGFloat height = 0;
    if ([self isHorizontal:screenSize]) {
        x = CGRectGetMaxX(loginFrame) + padding;
        y = padding;
        width = contentViewFrame.size.width - x - padding;
        height = CGRectGetMinY(privacyFrame) - y - padding;
    } else {
        x = padding;
        y = MAX(CGRectGetMaxY(changeBtnFrame), CGRectGetMaxY(loginFrame)) + padding;
        width = contentViewFrame.size.width - 2 * x;
        height = CGRectGetMinY(privacyFrame) - y - padding;
    }
    customBtn.frame = CGRectMake(x, y, width, height);
};
	
// 横竖屏切换
model.supportedInterfaceOrientations = UIInterfaceOrientationMaskAllButUpsideDown;
// 仅支持竖屏
model.supportedInterfaceOrientations = UIInterfaceOrientationMaskPortrait;
// 仅支持横屏
model.supportedInterfaceOrientations = UIInterfaceOrientationMaskLandscape;

二次隐私协议弹窗页面

image..png

配置二次隐私协议弹窗页面

方法

参数类型

说明

privacyAlertIsNeedShow

BOOL

设置二次隐私协议弹窗是否显示。取值:

  • NO(默认值):表示不显示。

  • YES:表示显示。

说明

针对弹窗形式的授权页暂时不支持二次隐私协议弹窗页面。

privacyAlertIsNeedAutoLogin

BOOL

设置二次隐私协议弹窗点击按钮是否需要执行登录。取值:

  • NO:表示不需要执行登录。

  • YES(默认值):表示需要执行登录。

privacyAlertEntryAnimation

CAAnimation

设置二次隐私协议弹窗显示自定义动画,默认从下往上位移动画。

privacyAlertExitAnimation

CAAnimation

设置二次隐私协议弹窗隐藏自定义动画,默认从上往下位移动画。

privacyAlertCornerRadiusArray

NSArray<NSNumber *>

设置二次隐私协议弹窗的四个圆角值。

说明

顺序为左上,左下,右下,右上,需要填充4个值,不足4个值则无效,如果值小于等于0则为直角。

privacyAlertBackgroundColor

UIColor

设置二次隐私协议弹窗背景颜色。

privacyAlertAlpha

CGFloat

设置二次隐私协议弹窗透明度,默认值1.0。

说明

设置范围0.3~1.0。

privacyAlertTitleFont

UIFont

设置二次隐私协议弹窗标题文字大小。

privacyAlertTitleColor

UIColor

设置二次隐私协议弹窗标题文字颜色。

privacyAlertTitleBackgroundColor

UIColor

设置二次隐私协议弹窗标题背景颜色。

privacyAlertTitleAlignment

NSTextAlignment

设置二次隐私协议弹窗标题位置,默认居中。

privacyAlertContentFont

UIFont

设置二次隐私协议弹窗协议内容文字大小,默认值13 dp,最小值12 dp。

privacyAlertContentBackgroundColor

UIColor

设置二次隐私协议弹窗协议内容背景颜色。

privacyAlertContentColors

NSArray<UIColor *>

设置二次隐私协议弹窗协议内容颜色数组。

说明

默认值[#999999,#1890FF],[非点击文案颜色,点击文案颜色]。

privacyAlertContentAlignment

NSTextAlignment

设置二次隐私协议弹窗协议文案居中、居左,默认居左。

privacyAlertBtnBackgroundImages

NSArray<UIImage *>

设置二次隐私协议弹窗按钮背景图片。

privacyAlertButtonTextColors

NSArray<UIColor *>

设置二次隐私协议弹窗按钮文字颜色。

privacyAlertButtonFont

UIFont

设置二次隐私协议弹窗按钮文字大小,默认值18 dp,最小值10 dp。

privacyAlertCloseButtonIsNeedShow

BOOL

设置二次隐私协议弹窗关闭按钮是否显示。

  • NO:表示隐藏。

  • YES(默认值):表示显示。

privacyAlertCloseButtonImage

UIImage

设置二次隐私协议弹窗右侧关闭按钮图片。

privacyAlertMaskIsNeedShow

BOOL

设置二次隐私协议弹窗背景蒙层是否显示。

  • NO:表示隐藏。

  • YES(默认值):表示显示。

tapPrivacyAlertMaskCloseAlert

BOOL

设置二次隐私协议弹窗点击背景蒙层是否关闭弹窗。

  • NO:表示不关闭。

  • YES(默认值):表示关闭。

privacyAlertMaskColor

UIColor

设置二次隐私协议弹窗蒙版背景颜色。

privacyAlertMaskAlpha

CGFloat

设置二次隐私协议弹窗蒙版透明度,默认值0.5。

说明

设置范围0.3~1.0。

privacyAlertOperatorColor

UIColor

二次隐私协议弹窗协议运营商协议内容颜色,优先级最高,如果privacyAlertOperatorColors不设置,则取privacyAlertContentColors中的点击文案颜色,privacyAlertContentColors不设置,则是默认色。

privacyAlertOneColor

UIColor

二次隐私协议弹窗协议1内容颜色,优先级最高,如果privacyAlertOneColors不设置,则取privacyAlertContentColors中的点击文案颜色,privacyAlertContentColors不设置,则是默认色。

privacyAlertTwoColor

UIColor

二次隐私协议弹窗协议2内容颜色,优先级最高,如果privacyAlertTwoColors不设置,则取privacyAlertContentColors中的点击文案颜色,privacyAlertContentColors不设置,则是默认色。

privacyAlertThreeColor

UIColor

二次隐私协议弹窗协议3内容颜色,优先级最高,如果privacyAlertThreeColors不设置,则取privacyAlertContentColors中的点击文案颜色,privacyAlertContentColors不设置,则是默认色。

privacyAlertPreText

NSString

二次隐私协议弹窗协议整体文案,前缀部分文案,如果不赋值,默认使用privacyPreText。

privacyAlertSufText

NSString

二次隐私协议弹窗协议整体文案,后缀部分文案,如果不赋值,默认使用privacySufText。

privacyAlertMaskEntryAnimation

CAAnimation

设置二次隐私协议弹窗蒙版显示动画,默认渐显动画。

privacyAlertMaskExitAnimation

CAAnimation

设置二次隐私协议弹窗蒙版消失动画,默认渐隐动画。

privacyAlertFrameBlock

PNSBuildFrameBlock

设置二次隐私协议弹窗尺寸。

说明

默认值:20 px,(SH-100)*0.5 px,(SW-40) px,100 px。不能超出父视图,高度不小于50 px,宽度不小于0 px。

privacyAlertTitleFrameBlock

PNSBuildFrameBlock

设置二次隐私协议弹窗标题尺寸。

说明

不能超出父视图,最小宽度100 px,最小高度15 px。

privacyAlertPrivacyContentFrameBlock

PNSBuildFrameBlock

设置二次隐私协议弹窗内容尺寸。

说明

从标题顶部位置开始,不能超出父视图。

privacyAlertButtonFrameBlock

PNSBuildFrameBlock

设置二次隐私协议弹窗确认并继续按钮尺寸。

说明

居中显示,不能超出父视图。最小宽度40 px,最小高度20 px。

privacyAlertCloseFrameBlock

PNSBuildFrameBlock

设置二次隐私协议弹窗右侧关闭按钮尺寸。

说明

不能超出父视图。

privacyAlertBtnContent

NSString

二次隐私协议弹窗按钮文字内容。默认值:同意。

privacyAlertTitleContent

NSString

二次隐私协议弹窗标题文字内容。默认值:请阅读并同意以下条款。

privacyAlertCustomViewBlock

Block

二次授权页弹窗自定义控件添加。

privacyAlertCustomViewLayoutBlock

Block

二次授权页设置自定义添加控件的frame。

  • 本页导读 (1)
文档反馈