mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Improves sample code for last commit
This commit is contained in:
parent
e624fb71ab
commit
285dabf347
1 changed files with 12 additions and 4 deletions
|
|
@ -39,8 +39,7 @@ Example
|
|||
|
||||
[[BITHockeyManager sharedHockeyManager] startManager];
|
||||
|
||||
if ([[BITHockeyManager.crashmanager] didCrashInLastSession] &&
|
||||
[[BITHockeyManager.crashmanager] timeintervalCrashInLastSessionOccured] < 5) {
|
||||
if ([self didCrashInLastSessionOnStartup]) {
|
||||
// show intermediate UI
|
||||
} else {
|
||||
[self setupApplication];
|
||||
|
|
@ -49,6 +48,11 @@ Example
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)didCrashInLastSessionOnStartup {
|
||||
return ([[BITHockeyManager.crashmanager] didCrashInLastSession] &&
|
||||
[[BITHockeyManager.crashmanager] timeintervalCrashInLastSessionOccured] < 5);
|
||||
}
|
||||
|
||||
- (void)setupApplication {
|
||||
// setup your app specific code
|
||||
}
|
||||
|
|
@ -56,11 +60,15 @@ Example
|
|||
#pragma mark - BITCrashManagerDelegate
|
||||
|
||||
- (void)crashManager:(BITCrashManager *)crashManager didFailWithError:(NSError *)error {
|
||||
[self setupApplication];
|
||||
if ([self didCrashInLastSessionOnStartup) {
|
||||
[self setupApplication];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)crashManagerDidFinishSendingCrashReport:(BITCrashManager *)crashManager {
|
||||
[self setupApplication];
|
||||
if ([self didCrashInLastSessionOnStartup) {
|
||||
[self setupApplication];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue