This document shows you how to run the fusion authentication demo and provides sample code for the fusion authentication feature. For detailed instructions on how to integrate and use the iOS client SDK, see Integrate the fusion authentication SDK for iOS.
Step 1: Download and decompress the SDK
For information about the required tools and environment setup, see Client SDK reference.
Log on to the Phone Number Verification Service console. On the Overview page, find the API & SDK section on the right and click Download Now. Follow the on-screen instructions to download the required SDK.
Step 2: Open the demo project
-
Open the demo in Xcode. The project fetches related dependencies during the loading process. Wait for the process to complete.
-
Change the Bundle ID to your own. This ID must match the one you provided in the Alibaba Cloud console when you applied for a scheme code.
Step 3: Select an access mode
The demo provides a quick access mode so you can run it before setting up a server-side environment. You can switch between access modes by setting the value of DEMO_DEBUG_MODE in the pch file.
-
DEMO_DEBUG_MODE: Set to 1 for quick access mode.
-
DEMO_DEBUG_MODE: Set to 2 for normal access mode (default).
Normal access mode
Normal access mode requires integrating both the fusion authentication server and client SDKs. This mode allows for full debugging and access to all features.
First, follow the Development guide to integrate your fusion authentication app server. Use the app server to obtain an authentication token and verify the final authentication result.
Modify the following parameters in the pch file:
-
DEMO_DEBUG_MODE: Enter 2.
-
DEMO_SCHEME_CODE: Enter the scheme code that you created in the console.
-
DEMO_APP_SERVER_HOST: Enter the address of your app server.
-
DEMO_AUTHTOKENA_API: Enter the server-side API for obtaining the authentication token.
-
DEMO_VERIFY_API: Enter the server-side API for phone number verification.
-
DEMO_TOKEN_EXPIR_TIME: Enter the timeout period for the authentication token.
Quick access mode
Quick access mode lets you debug the demo and test basic features without integrating the server-side API.
-
In OpenAPI Explorer, enter the API parameters. For more information on the parameters, see Get an authentication token for fusion authentication.
Note-
SchemeCode: Enter the scheme code that you created in the console.
-
PackageName: In the app/build.gradle file, find the package name in the
android.defaultConfig.applicationIdproperty. -
PackageSign: Package signature. You can download and install the Android App Signature Tool on a mobile device to obtain the package signature of your Android app. This signature is required for authentication.
-
-
Click Send Request.
-
On the Call Result page, obtain the temporary authentication token. If the call is successful, the API returns a status code of 200. In the JSON response body, find the Token field and copy its value.
-
After obtaining the temporary authentication token, modify the following parameters in the demo's pch file:
-
DEMO_DEBUG_MODE: Enter 1.
-
DEMO_SCHEME_CODE: Enter the scheme code that you created in the console.
-
DEMO_TEMPORATY_TOKEN: Enter the temporary authentication token that you obtained.
-
-
After the demo runs, get the phone number verification token from the
onVerifySuccessmethod of theAlicomFusionAuthCallBackcallback. You can use this token in the console to perform phone number verification. For more information, see Server-side integration.
Step 4: Build and run
-
Connect your iOS device to your computer, and enable developer mode on your device.
-
Build and run the project to try out the features.
Sample code
Create an instance object
NSString *tokenStr = [AlicomFusionAuthTokenManager shareInstance].authTokenStr;
AlicomFusionAuthToken *token = [[AlicomFusionAuthToken alloc] initWithTokenStr:tokenStr];
self.handler = [[AlicomFusionAuthHandler alloc] initWithToken:token schemeCode:DEMO_SCHEME_CODE];
[self.handler setFusionAuthDelegate:self];
Start a scene
[self.handler startSceneUIWithTemplateId:self.currTemplateId viewController:controller delegate:self];
Handle a scene
- (void)dealWithPhone:(NSString *)phoneNum {
if (phoneNum.length < 11) {
[AlicomFusionToastTool showToastMsg:@"Failed to get the phone number"];
return;
}
if ([AlicomFusionTemplateId_100001 isEqualToString:self.currTemplateId]) {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setObject:phoneNum forKey:kDEMO_UD_PHONE_NUM];
[ud synchronize];
[AlicomFusionToastTool showToastMsg:@"Login successful"];
[self.handler stopSceneWithTemplateId:self.currTemplateId];
} else if ([AlicomFusionTemplateId_100002 isEqualToString:self.currTemplateId]) {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setObject:phoneNum forKey:kDEMO_UD_PHONE_NUM];
[ud synchronize];
[AlicomFusionToastTool showToastMsg:@"Phone number updated successfully"];
[self.handler stopSceneWithTemplateId:self.currTemplateId];
} else if ([AlicomFusionTemplateId_100003 isEqualToString:self.currTemplateId]) {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
NSString *loginPhone = [ud objectForKey:kDEMO_UD_PHONE_NUM];
if ([phoneNum isEqualToString:loginPhone]) {
[AlicomFusionToastTool showToastMsg:@"Phone number verified. You can now change your password."];
[self.handler stopSceneWithTemplateId:self.currTemplateId];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if ([self.delegate respondsToSelector:@selector(verifySuccess)]){
[self.delegate verifySuccess];
}
});
} else {
[AlicomFusionToastTool showToastMsg:@"Phone number verification failed"];
[self.handler continueSceneWithTemplateId:self.currTemplateId isSuccess:NO];
}
} else if ([AlicomFusionTemplateId_100004 isEqualToString:self.currTemplateId]) {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setObject:phoneNum forKey:kDEMO_UD_PHONE_NUM];
[ud synchronize];
[AlicomFusionToastTool showToastMsg:@"New phone number bound successfully"];
[self.handler stopSceneWithTemplateId:self.currTemplateId];
} else if ([AlicomFusionTemplateId_100005 isEqualToString:self.currTemplateId]) {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
NSString *loginPhone = [ud objectForKey:kDEMO_UD_PHONE_NUM];
if ([phoneNum isEqualToString:loginPhone]) {
[AlicomFusionToastTool showToastMsg:@"Phone number verified"];
[self.handler stopSceneWithTemplateId:self.currTemplateId];
} else {
[AlicomFusionToastTool showToastMsg:@"Phone number verification failed"];
[self.handler continueSceneWithTemplateId:self.currTemplateId isSuccess:NO];
}
}
}
#pragma mark - AlicomFusionAuthDelegate
/**
* Invoked when the authentication token needs to be updated.
* @note Required callback. This callback is triggered during handler initialization and 5 minutes before the existing token expires. The SDK manages the token lifecycle.
* @param handler The handler.
* @return An `AlicomFusionAuthToken` object containing the new token. The SDK uses this token for subsequent authentication requests.
*/
- (AlicomFusionAuthToken *)onSDKTokenUpdate:(AlicomFusionAuthHandler *)handler {
NSLog(@"%s, called",__func__);
NSString *tokenStr = [AlicomFusionAuthTokenManager updateAuthToken];
AlicomFusionAuthToken *token = [[AlicomFusionAuthToken alloc] initWithTokenStr:tokenStr];
return token;
}
/**
* Invoked after the authentication token is successfully validated.
* @note Required callback. You can launch a scene by using the startScene API only after this callback is triggered.
* @param handler The handler.
*/
- (void)onSDKTokenAuthSuccess:(AlicomFusionAuthHandler *)handler {
NSLog(@"%s, called",__func__);
self.isActive = YES;
self.reGetTime = 3;
}
/**
* Invoked when token authentication fails.
* @note Required callback. This callback is triggered when the initial token authentication fails or when authentication fails after a token update.
* @note If token authentication fails, you can no longer use the SDK's features. You must destroy and re-initialize the SDK instance.
* @param handler The handler.
* @param failToken The token that failed authentication.
* @param error An object containing details about the error.
*/
- (void)onSDKTokenAuthFailure:(AlicomFusionAuthHandler *)handler
failToken:(AlicomFusionAuthToken *)failToken
error:(AlicomFusionEvent *)error {
NSLog(@"%s, called:{\n%@}",__func__,error.description);
self.isActive = NO;
if (self.reGetTime > 0) {
NSString *tokenStr = [AlicomFusionAuthTokenManager updateAuthToken];
AlicomFusionAuthToken *token = [[AlicomFusionAuthToken alloc] initWithTokenStr:tokenStr];
[handler updateToken:token];
self.reGetTime --;
} else {
self.reGetTime = 3;
[self.handler destroy];
self.handler = nil;
[AlicomFusionAuthTokenManager shareInstance].authTokenStr = nil;
return;
}
}
/**
* Invoked when a verification step is successful.
* @note Required callback.
* @note Use the `maskToken` to perform final verification on your app server and exchange it for the user's phone number. If obtaining the phone number fails, you can call the SDK's continue API to proceed with the scene flow.
* @param handler The handler.
* @param maskToken The token for phone number verification.
*/
- (void)onVerifySuccess:(AlicomFusionAuthHandler *)handler
nodeName:(nonnull NSString *)nodeName
maskToken:(NSString *)maskToken
event:(nonnull AlicomFusionEvent *)event {
NSLog(@"%s, called.nodeName=%@",__func__,nodeName);
// Exchange for phone number.
dispatch_async(dispatch_get_main_queue(), ^{
[AlicomFusionToastTool showLoading];
});
[AlicomFusionNetAdapter verifyTokenRequest:maskToken complete:^(id data,NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[AlicomFusionToastTool hideLoading];
if (data&&!error){
// Save the phone number.
if ([data isKindOfClass:NSDictionary.class]) {
NSString *verifyResult = ((NSDictionary *)data)[@"VerifyResult"];
if ([@"PASS" isEqualToString:verifyResult]) {
[self dealWithPhone:((NSDictionary *)data)[@"PhoneNumber"]];
} else if ([@"REJECT" isEqualToString:verifyResult] || [@"UNKNOW" isEqualToString:verifyResult]) {
if ([nodeName isEqualToString:AlicomFusionNodeNameNumberAuth]) {
[AlicomFusionToastTool showToastMsg:@"One-click login failed"];
} else if ([nodeName isEqualToString:AlicomFusionNodeNameVerifyCodeAuth]) {
[AlicomFusionToastTool showToastMsg:@"Failed to get the phone number. Check whether the verification code is correct or has expired."];
} else if ([nodeName isEqualToString:AlicomFusionNodeNameUpGoingAuth]) {
[AlicomFusionToastTool showToastMsg:@"Failed to get the phone number. Check whether the SMS message was sent successfully."];
}
if (![AlicomFusionNodeNameVerifyCodeAuth isEqualToString:nodeName]) {
[self.handler continueSceneWithTemplateId:self.currTemplateId isSuccess:NO];
}
}
} else {
if (![AlicomFusionNodeNameVerifyCodeAuth isEqualToString:nodeName]) {
[self.handler continueSceneWithTemplateId:self.currTemplateId isSuccess:NO];
}
}
}else{
// End authentication.
[self.handler stopSceneWithTemplateId:self.currTemplateId];
[AlicomFusionToastTool showToastMsg:error.userInfo[NSLocalizedDescriptionKey] ?:@"Operation failed"];
}
});
}];
}
- (void)onHalfwayVerifySuccess:(AlicomFusionAuthHandler *)handler nodeName:(NSString *)nodeName maskToken:(NSString *)maskToken event:(nonnull AlicomFusionEvent *)event resultBlock:(void (^)(BOOL))resultBlock {
NSLog(@"%s, called.nodeName=%@",__func__,nodeName);
dispatch_async(dispatch_get_main_queue(), ^{
[AlicomFusionToastTool showLoading];
});
[AlicomFusionNetAdapter verifyTokenRequest:maskToken complete:^(id data,NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[AlicomFusionToastTool hideLoading];
if (data&&!error){
// Save the phone number.
if ([data isKindOfClass:NSDictionary.class]) {
NSString *verifyResult = ((NSDictionary *)data)[@"VerifyResult"];
if ([@"PASS" isEqualToString:verifyResult]) {
[AlicomFusionToastTool showToastMsg:@"Verification successful"];
if (resultBlock) {
resultBlock(YES);
}
} else if ([@"REJECT" isEqualToString:verifyResult] || [@"UNKNOW" isEqualToString:verifyResult]) {
[AlicomFusionToastTool showToastMsg:@"Verification failed"];
}
} else {
[AlicomFusionToastTool showToastMsg:@"Verification failed"];
}
}else{
[AlicomFusionToastTool showToastMsg:@"Verification failed"];
}
});
}];
}
- (void)onVerifyFailed:(AlicomFusionAuthHandler *)handler nodeName:(nonnull NSString *)nodeName error:(nonnull AlicomFusionEvent *)error {
NSLog(@"%s, nodeName=%@, called:{\n%@}",__func__,nodeName,error.description);
if ([nodeName isEqualToString:AlicomFusionNodeNameVerifyCodeAuth]) {
if ([error.resultCode isEqualToString:AlicomFusionVerifyCodeFrequency] || [error.resultCode isEqualToString:AlicomFusionVerifyCodeRisk]) {
dispatch_async(dispatch_get_main_queue(), ^{
[AlicomFusionToastTool showToastMsg:error.resultMsg];
});
[self.handler continueSceneWithTemplateId:self.currTemplateId isSuccess:NO];
} else if ([AlicomFusionVerifyCodeAutoNumberShowFail isEqualToString:error.resultCode]) {
dispatch_async(dispatch_get_main_queue(), ^{
[AlicomFusionToastTool showToastMsg:error.resultMsg];
});
[self.handler stopSceneWithTemplateId:self.currTemplateId];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[AlicomFusionToastTool showToastMsg:error.resultMsg];
});
}
} else {
[self.handler continueSceneWithTemplateId:self.currTemplateId isSuccess:NO];
}
}
/**
* Invoked when the authentication scene finishes.
* @note Required callback. This indicates the completion of the SDK's authentication process for the current scene.
* @param handler The handler.
* @param event The finish event.
*/
- (void)onTemplateFinish:(AlicomFusionAuthHandler *)handler event:(AlicomFusionEvent *)event {
NSLog(@"%s, called:{\n%@}",__func__,event.description);
// End authentication.
[self.handler stopSceneWithTemplateId:self.currTemplateId];
}
- (void)onProtocolClick:(AlicomFusionAuthHandler *)handler protocolName:(NSString *)protocolName protocolUrl:(NSString *)protocolUrl event:(AlicomFusionEvent *)event
{
NSLog(@"%s, called:{\n%@}",__func__,event.description);
AlicomFusionWebViewController *controller = [[AlicomFusionWebViewController alloc] initWithUrl:protocolUrl andUrlName:protocolName];
UINavigationController *navigationController = self.currVC.navigationController;
if (self.currVC.presentedViewController) {
// If the authorization page is successfully launched, use its navigation controller for the transition.
navigationController = (UINavigationController *)self.currVC.presentedViewController;
}
[navigationController pushViewController:controller animated:YES];
}
- (void)onVerifyInterrupt:(AlicomFusionAuthHandler *)handler event:(AlicomFusionEvent *)event {
if ([event.resultCode isEqualToString:AlicomFusionStartLoading]) {
[AlicomFusionToastTool showLoading];
} else if ([event.resultCode isEqualToString:AlicomFusionEndLoading]) {
[AlicomFusionToastTool hideLoading];
} else {
[AlicomFusionToastTool showToastMsg:[NSString stringWithFormat:@"%@,%@", event.resultCode, event.resultMsg]];
}
}
/**
* Receives notifications for scene events.
* @note Optional callback. This is a UI-related callback for events such as clicks and view transitions within the SDK scene.
* @note This callback is for event notification only. Do not implement business logic here.
* @param handler The handler.
* @param event The click event. For details, see AlicomFusionEvent.h.
*/
- (void)onAuthEvent:(AlicomFusionAuthHandler *)handler
eventData:(AlicomFusionEvent *)event {
NSLog(@"%s, called:{\n%@}",__func__,event.description);
}
/**
* Provides a phone number for verification or pre-filling UI fields.
* @note Required callback. Used for the phone number field in some of the SDK's built-in UI.
* @note For example, in a password reset scene, the original phone number must be entered for the first verification step. The SDK needs to verify if the entered value is the actual original phone number. This can also be used to auto-fill the phone number in a rebinding scene.
* @param handler The handler.
* @param event The event.
* @return The phone number that the application has on record for the current user.
*/
- (NSString *)onGetPhoneNumberForVerification:(AlicomFusionAuthHandler *)handler
event:(nonnull AlicomFusionEvent *)event {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
NSString *phoneNum = [ud objectForKey:kDEMO_UD_PHONE_NUM];
return phoneNum;
}
Custom UI
#pragma mark - AlicomFusionAuthUIDelegate
- (void)onPhoneNumberVerifyUICustomDefined:(AlicomFusionAuthHandler *)handler
templateId:(nonnull NSString *)templateId
nodeId:(NSString *)nodeId
UIModel:(AlicomFusionNumberAuthModel *)model {
self.authmodel = model;
model.supportedInterfaceOrientations = UIInterfaceOrientationMaskPortrait;
model.presentDirection = AlicomFusionPresentationDirectionBottom;
model.suspendDisMissVC = NO;
model.navTitle = [[NSAttributedString alloc] initWithString:@"One-click Login"];
model.navColor = AlicomColorHex(0xEFF3F2);
model.logoIsHidden = YES;
model.numberColor = AlicomColorHex(0x262626);
model.numberFont = [UIFont systemFontOfSize:24];
NSDictionary *loginAttriDict = @{
NSFontAttributeName: [UIFont systemFontOfSize:16],
NSForegroundColorAttributeName: AlicomColorHex(0xFFFFFF)
};
NSMutableAttributedString *loginAttr = [[NSMutableAttributedString alloc] initWithString:@"One-click Login" attributes:loginAttriDict];
model.loginBtnText = loginAttr;
UIImage *unSelectImage = [AlicomFusionDemoUtil demoImageWithColor:AlicomColorHex(0x0064C8) size:CGSizeMake(ALICOM_FUSION_DEMO_SCREEN_WIDTH - 32, 44) isRoundedCorner:NO radius:0.0];
UIImage *selectImage = [AlicomFusionDemoUtil demoImageWithColor:AlicomColorHex(0x0064C8) size:CGSizeMake(ALICOM_FUSION_DEMO_SCREEN_WIDTH - 32, 44) isRoundedCorner:NO radius:0.0];
UIImage *heighLightImage = [AlicomFusionDemoUtil demoImageWithColor:AlicomColorHex(0x0064C8) size:CGSizeMake(ALICOM_FUSION_DEMO_SCREEN_WIDTH - 32, 44) isRoundedCorner:NO radius:0.0];
model.loginBtnBgImgs = @[unSelectImage, selectImage, heighLightImage];
NSDictionary *sloganAttriDict = @{
NSFontAttributeName: [UIFont systemFontOfSize:15],
NSForegroundColorAttributeName: AlicomColorHex(0x555555)
};
NSMutableAttributedString *sloganAttr = [[NSMutableAttributedString alloc] initWithString:@"Authentication service provided by Alibaba Cloud" attributes:sloganAttriDict];
model.sloganText = sloganAttr;
model.privacyOperatorIndex = 2;
model.privacyOne = @[@"User Agreement",@"https://terms.alicdn.com/legal-agreement/terms/product/20230213121650869/20230213121650869.html"];
model.privacyTwo = @[@"Personal Information Protection Policy",@"https://terms.aliyun.com/legal-agreement/terms/suit_bu1_ali_cloud/suit_bu1_ali_cloud202112211045_86198.html?spm=a2c4g.11186623.0.0.72701a9edzzvbz"];
model.privacyConectTexts = @[@", ",@" and "];
model.privacyPreText = @"I have read and agree to ";
model.privacyOperatorPreText = @"";
model.privacyOperatorSufText = @"";
model.privacyColors = @[AlicomColorHex(0x262626), AlicomColorHex(0x262626)];
model.privacyFont = [UIFont systemFontOfSize:14];
model.checkBoxIsHidden = NO;
model.checkBoxIsChecked = NO;
model.checkBoxWH = 21;
model.backgroundColor = AlicomColorHex(0xEFF3F2);
model.moreLoginActionBlock = ^{
NSLog(@"Other login methods");
};
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, ALICOM_FUSION_DEMO_SCREEN_WIDTH, 100)];
label.text = @"Login";
label.textColor = AlicomColorHex(0x262626);
label.font = [UIFont systemFontOfSize:24];
[label sizeToFit];
model.nameLabel = label;
UIButton *otherLogin = [UIButton buttonWithType:UIButtonTypeCustom];
[otherLogin setTitle:@"Log in with a different phone number" forState:UIControlStateNormal];
otherLogin.backgroundColor = UIColor.whiteColor;
[otherLogin setTitleColor:AlicomColorHex(0x262626) forState:UIControlStateNormal];
otherLogin.titleLabel.font = [UIFont systemFontOfSize:16];
[otherLogin addTarget:self action:@selector(otherPhoneLoginClick) forControlEvents:UIControlEventTouchUpInside];
model.otherLoginButton = otherLogin;
model.numberFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
CGFloat x = (screenSize.width - frame.size.width) * 0.5;
CGFloat y = 214;
CGRect rect = CGRectMake(x, y, frame.size.width, frame.size.height);
return rect;
};
model.sloganFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
CGFloat y = 252;
CGRect rect = CGRectMake(frame.origin.x, y, frame.size.width, frame.size.height);
return rect;
};
model.loginBtnFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
CGFloat y = 318;
CGRect rect = CGRectMake(frame.origin.x, y, frame.size.width, frame.size.height);
return rect;
};
model.nameLabelFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
return frame;
};
model.otherLoginButtonFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
return frame;
};
model.privacyFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
CGRect rect = CGRectMake(frame.origin.x, screenSize.height - 60 - ALICOM_FUSION_DEMO_STATUS_BAR_HEIGHT - frame.size.height - 34, frame.size.width, frame.size.height);
return rect;
};
model.customViewLayoutBlock = ^(CGSize screenSize, CGRect contentViewFrame, CGRect nameLabelFrame, CGRect otherLoginBtnFrame, CGRect navFrame, CGRect titleBarFrame, CGRect logoFrame, CGRect sloganFrame, CGRect numberFrame, CGRect loginFrame, CGRect changeBtnFrame, CGRect privacyFrame) {
};
model.customViewBlock = ^(UIView * _Nonnull superCustomView) {};
model.privacyAlertIsNeedShow = YES;
model.privacyAlertIsNeedAutoLogin = YES;
model.privacyAlertCornerRadiusArray = @[@4, @4, @4, @4];
model.privacyAlertTitleFont = [UIFont systemFontOfSize:16];
model.privacyAlertTitleColor = AlicomColorHex(0x262626);
model.privacyAlertContentFont = [UIFont systemFontOfSize:16];
model.privacyAlertContentAlignment = NSTextAlignmentCenter;
model.privacyAlertButtonTextColors = @[AlicomColorHex(0x0064C8), AlicomColorHex(0x0064C8)];
UIImage *imageUnselect = [AlicomFusionDemoUtil demoImageWithColor:AlicomColorHex(0xFFFFFF) size:CGSizeMake(ALICOM_FUSION_DEMO_SCREEN_WIDTH, 56) isRoundedCorner:NO radius:0.0];
UIImage *imageSelect = [AlicomFusionDemoUtil demoImageWithColor:AlicomColorHex(0xFFFFFF) size:CGSizeMake(ALICOM_FUSION_DEMO_SCREEN_WIDTH, 56) isRoundedCorner:NO radius:0.0];
model.privacyAlertBtnBackgroundImages = @[imageUnselect, imageSelect];
model.privacyAlertButtonFont = [UIFont systemFontOfSize:16];
model.tapPrivacyAlertMaskCloseAlert = NO;
model.privacyAlertMaskColor = AlicomColorHex(0x262626);
model.privacyAlertMaskAlpha = 0.88;
model.privacyAlertFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
CGRect rect = CGRectMake(27, (superViewSize.height - 200)*0.382, superViewSize.width - 54, 200);
return rect;
};
model.privacyAlertTitleFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
CGRect rect = CGRectMake(0, 32, frame.size.width, frame.size.height);
return rect;
};
model.privacyAlertPrivacyContentFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
CGRect rect = CGRectMake(24, 70, superViewSize.width - 48, frame.size.height);
return rect;
};
model.privacyAlertButtonFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
CGRect rect = CGRectMake(0, superViewSize.height - 56, superViewSize.width, 56);
return rect;
};
}
- (void)onSMSCodeVerifyUICustomDefined:(AlicomFusionAuthHandler *)handler
templateId:(nonnull NSString *)templateId
nodeId:(NSString *)nodeId
isAutoInput:(BOOL)isAutoInput
view:(AlicomFusionVerifyCodeView *)view {
self.verifyView = view;
}
- (void)onSMSSendVerifyUICustomDefined:(AlicomFusionAuthHandler *)handler
templateId:(nonnull NSString *)templateId
nodeId:(NSString *)nodeId
smsContent:(nonnull NSString *)smsContent
receiveNum:(nonnull NSString *)receiveNum
view:(AlicomFusionUpGoingView *)view {
self.upGoingView = view;
self.smsContent = smsContent;
self.receiveNum = receiveNum;
NSLog(@"smsContent-====%@,receiveNum=-------%@",smsContent,receiveNum);
}
- (void)onNavigationControllerCustomDefined:(AlicomFusionAuthHandler *)handler
templateId:(nonnull NSString *)templateId
nodeId:(NSString *)nodeId
navigation:(UINavigationController *)naviController {
}