mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 13:13:55 +00:00
Fix keychain warning alert showing app on app launch, if keychain is locked
This could happen if the app is launched via background fetch right when the device started and before it is unlocked by the user.
This commit is contained in:
parent
0765c93f1b
commit
28f15120a3
@ -108,19 +108,19 @@ static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44};
|
||||
|
||||
// make sure this is called after startManager so all modules are fully setup
|
||||
if (!_isSetup) {
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(authenticateInstallation) object:nil];
|
||||
[self performSelector:@selector(authenticateInstallation) withObject:nil afterDelay:0.1];
|
||||
} else {
|
||||
switch ([[UIApplication sharedApplication] applicationState]) {
|
||||
case UIApplicationStateActive:
|
||||
[self authenticate];
|
||||
break;
|
||||
case UIApplicationStateBackground:
|
||||
case UIApplicationStateInactive:
|
||||
// do nothing, wait for active state
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch ([[UIApplication sharedApplication] applicationState]) {
|
||||
case UIApplicationStateActive:
|
||||
[self authenticate];
|
||||
break;
|
||||
case UIApplicationStateBackground:
|
||||
case UIApplicationStateInactive:
|
||||
// do nothing, wait for active state
|
||||
break;
|
||||
}
|
||||
|
||||
[self registerObservers];
|
||||
}
|
||||
|
||||
@ -156,6 +156,10 @@ static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44};
|
||||
}
|
||||
|
||||
- (void)alertOnFailureStoringTokenInKeychain {
|
||||
if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil
|
||||
message:BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerStorageError")
|
||||
delegate:self
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user