diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index 4c3985b844..9b2e224fc3 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -462,14 +462,16 @@ static NSString* const kBITAuthenticatorLastAuthenticatedVersionKey = @"BITAuthe } - (void) registerObservers { - __weak typeof(self) weakSelf = self; - _appDidBecomeActiveObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification - object:nil - queue:NSOperationQueue.mainQueue - usingBlock:^(NSNotification *note) { - typeof(self) strongSelf = weakSelf; - [strongSelf applicationDidBecomeActive:note]; - }]; + if(nil == _appDidBecomeActiveObserver) { + __weak typeof(self) weakSelf = self; + _appDidBecomeActiveObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification + object:nil + queue:NSOperationQueue.mainQueue + usingBlock:^(NSNotification *note) { + typeof(self) strongSelf = weakSelf; + [strongSelf applicationDidBecomeActive:note]; + }]; + } } - (void) unregisterObservers {