From 9ddcad6da76b5dbc48f3bb7ca75f9bed873eba71 Mon Sep 17 00:00:00 2001 From: Stephan Diederich Date: Tue, 24 Sep 2013 17:28:42 +0200 Subject: [PATCH] only reset validation flag once we actually went to the background --- Classes/BITAuthenticator.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index 0a0ab29f4c..80c872cc43 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -666,7 +666,10 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut } - (void)applicationWillResignActive:(NSNotification *)note { - if(BITAuthenticatorAppRestrictionEnforcementOnAppActive == self.restrictionEnforcementFrequency) { + //only reset if app is really going into the background, e.g not when pulling down + //the notification center + if(BITAuthenticatorAppRestrictionEnforcementOnAppActive == self.restrictionEnforcementFrequency && + [[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) { self.validated = NO; } }