From f103314252ef3e213d00a316a36309c0b5aa5d9a Mon Sep 17 00:00:00 2001 From: Jorge Leandro Perez Date: Wed, 3 Mar 2021 10:06:44 -0300 Subject: [PATCH 1/4] Unscheduling OpenAuthUI on successful Auth --- Simperium/Simperium.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Simperium/Simperium.m b/Simperium/Simperium.m index f619a1d6..35bde50d 100644 --- a/Simperium/Simperium.m +++ b/Simperium/Simperium.m @@ -798,6 +798,7 @@ - (void)authenticationDidSucceedForUsername:(NSString *)username token:(NSString [self startNetworkManagers]; [self closeAuthViewControllerAnimated:YES]; + [self unscheduleOpenAuthViewController]; if ([self.delegate respondsToSelector:@selector(simperiumDidLogin:)]) { [self.delegate simperiumDidLogin:self]; @@ -837,7 +838,7 @@ - (void)authenticationDidFail { } // Delay it a touch to avoid issues with storyboard-driven UIs - [self performSelector:@selector(delayedOpenAuthViewController) withObject:nil afterDelay:0.1]; + [self scheduleOpenAuthViewController]; } - (BOOL)authenticateIfNecessary { @@ -850,6 +851,14 @@ - (BOOL)authenticateIfNecessary { return [self.authenticator authenticateIfNecessary]; } +- (void)scheduleOpenAuthViewController { + [self performSelector:@selector(delayedOpenAuthViewController) withObject:nil afterDelay:0.1]; +} + +- (void)unscheduleOpenAuthViewController { + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(delayedOpenAuthViewController) object:nil]; +} + - (void)delayedOpenAuthViewController { [self openAuthViewControllerAnimated:YES]; } From 5d9a76f3ea4e35e00b2b1505c66b428435365c1b Mon Sep 17 00:00:00 2001 From: Jorge Leandro Perez Date: Wed, 3 Mar 2021 10:10:57 -0300 Subject: [PATCH 2/4] Simperium: Relocates unschedule --- Simperium/Simperium.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Simperium/Simperium.m b/Simperium/Simperium.m index 35bde50d..abf43e67 100644 --- a/Simperium/Simperium.m +++ b/Simperium/Simperium.m @@ -798,7 +798,6 @@ - (void)authenticationDidSucceedForUsername:(NSString *)username token:(NSString [self startNetworkManagers]; [self closeAuthViewControllerAnimated:YES]; - [self unscheduleOpenAuthViewController]; if ([self.delegate respondsToSelector:@selector(simperiumDidLogin:)]) { [self.delegate simperiumDidLogin:self]; @@ -930,6 +929,8 @@ - (void)closeAuthViewControllerAnimated:(BOOL)animated { [[self.authenticationWindowController window] close]; self.authenticationWindowController = nil; #endif + + [self unscheduleOpenAuthViewController]; } From 5d889632a521230582effefb58700bd33258c7fd Mon Sep 17 00:00:00 2001 From: Jorge Leandro Perez Date: Wed, 3 Mar 2021 12:49:23 -0300 Subject: [PATCH 3/4] Simperium: Preventing Window repositioning when it's already visible --- Simperium/Simperium.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Simperium/Simperium.m b/Simperium/Simperium.m index abf43e67..372e5c05 100644 --- a/Simperium/Simperium.m +++ b/Simperium/Simperium.m @@ -911,9 +911,15 @@ - (void)openAuthViewControllerAnimated:(BOOL)animated { } // Hide the main window and show the auth window instead - [self.window setIsVisible:NO]; - [[self.authenticationWindowController window] center]; - [[self.authenticationWindowController window] makeKeyAndOrderFront:self]; + [self.window setIsVisible:NO]; + + // Center the AuthWindow *only* when it wasn't previously onscreen (only after alloc!) + NSWindow *authWindow = self.authenticationWindowController.window; + if (!authWindow.isVisible) { + [authWindow center]; + } + + [authWindow makeKeyAndOrderFront:self]; #endif } From 2ef4c7d1ccfb736b2eddc8212d81f96963caede8 Mon Sep 17 00:00:00 2001 From: Jorge Leandro Perez Date: Thu, 4 Mar 2021 09:46:25 -0300 Subject: [PATCH 4/4] Simperium Mk 1.6.0 --- Simperium/SPEnvironment.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Simperium/SPEnvironment.m b/Simperium/SPEnvironment.m index 0d2c51d8..a90496d6 100644 --- a/Simperium/SPEnvironment.m +++ b/Simperium/SPEnvironment.m @@ -30,7 +30,7 @@ #endif // TODO: Update this automatically via a script that looks at current git tag -NSString* const SPLibraryVersion = @"1.5.0"; +NSString* const SPLibraryVersion = @"1.6.0"; /// SSL Pinning ///