mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-19 12:10:55 +00:00
Add generateTestCrash method
This commit is contained in:
parent
5c5a549c75
commit
720dbccefe
@ -227,4 +227,20 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerStatus) {
|
|||||||
*/
|
*/
|
||||||
- (BOOL)isDebuggerAttached;
|
- (BOOL)isDebuggerAttached;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets the app crash for easy testing of the SDK
|
||||||
|
*
|
||||||
|
* The best way to use this is to trigger the crash with a button action.
|
||||||
|
*
|
||||||
|
* Make sure not to let the app crash in `applicationDidFinishLaunching` or any other
|
||||||
|
* startup method! Since otherwise the app would crash before the SDK could process it.
|
||||||
|
*
|
||||||
|
* Note that our SDK provides support for handling crashes that happen early on startup.
|
||||||
|
* Check the documentation for more information on how to use this.
|
||||||
|
*
|
||||||
|
* If the SDK detects an App Store environment, it will _NOT_ cause the app to crash!
|
||||||
|
*/
|
||||||
|
- (void)generateTestCrash;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -419,6 +419,18 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (void)generateTestCrash {
|
||||||
|
if (![self isAppStoreEnvironment]) {
|
||||||
|
|
||||||
|
if ([self isDebuggerAttached]) {
|
||||||
|
NSLog(@"[HockeySDK] WARNING: The debugger is attached. The following crash cannot be detected by the SDK!");
|
||||||
|
}
|
||||||
|
|
||||||
|
__builtin_trap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - PLCrashReporter
|
#pragma mark - PLCrashReporter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user