Skip to content

Commit 353512c

Browse files
committed
拉起关闭授权页动画设置实现
1 parent 74266a2 commit 353512c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ios/Classes/JverifyPlugin.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
static NSString *const j_opr_key = @"operator";
1818
/// 默认超时时间
1919
static long j_default_timeout = 5000;
20-
20+
static BOOL needStartAnim = YES;
21+
static BOOL needCloseAnim = YES;
2122
@implementation JverifyPlugin
2223

2324
NSObject<FlutterPluginRegistrar>* _jv_registrar;
@@ -315,7 +316,7 @@ -(void)loginAuthSync:(BOOL)isSync call:(FlutterMethodCall*)call result:(FlutterR
315316
UIViewController *vc = [UIApplication sharedApplication].keyWindow.rootViewController;
316317

317318
__weak typeof(self) weakself = self;
318-
[JVERIFICATIONService getAuthorizationWithController:vc hide:[hide boolValue] animated:YES timeout:timeout completion:^(NSDictionary *res) {
319+
[JVERIFICATIONService getAuthorizationWithController:vc hide:[hide boolValue] animated:needStartAnim timeout:timeout completion:^(NSDictionary *res) {
319320
JVLog(@"getAuthorizationWithController result = %@",res);
320321

321322
NSString *content = @"";
@@ -356,7 +357,7 @@ -(void)loginAuthSync:(BOOL)isSync call:(FlutterMethodCall*)call result:(FlutterR
356357
#pragma mark - SDK关闭授权页面
357358
-(void)dismissLoginController:(FlutterMethodCall*) call result:(FlutterResult)result{
358359
JVLog(@"Action - dismissLoginController::");
359-
[JVERIFICATIONService dismissLoginControllerAnimated:YES completion:^{
360+
[JVERIFICATIONService dismissLoginControllerAnimated:needCloseAnim completion:^{
360361

361362
}];
362363
}
@@ -371,7 +372,8 @@ -(void)setCustomAuthViewAllWidgets:(FlutterMethodCall*) call result:(FlutterResu
371372
}
372373
- (void)setCustomAuthorizationView:(FlutterMethodCall*) call result:(FlutterResult)result {
373374
JVLog(@"Action - setCustomAuthorizationView:%@",call.arguments);
374-
375+
needStartAnim = [call.arguments[@"needStartAnim"] boolValue];
376+
needCloseAnim = [call.arguments[@"needCloseAnim"] boolValue];
375377
BOOL isAutorotate = [call.arguments[@"isAutorotate"] boolValue];
376378
NSDictionary *portraitConfig = call.arguments[@"portraitConfig"];
377379
NSArray *widgets = call.arguments[@"widgets"];
@@ -424,7 +426,7 @@ - (void)setCustomUIWithUIConfig:(JVUIConfig *)uiconfig configArguments:(NSDictio
424426
JVLog(@"Action - setCustomUIWithUIConfig::");
425427

426428
uiconfig.preferredStatusBarStyle = 0;
427-
429+
uiconfig.dismissAnimationFlag = needCloseAnim;
428430
/************** 背景 ***************/
429431
NSString *authBackgroundImage = [config objectForKey:@"authBackgroundImage"];
430432
authBackgroundImage = authBackgroundImage?:nil;

0 commit comments

Comments
 (0)