-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBugSplatDelegate.h
More file actions
108 lines (73 loc) · 3.72 KB
/
BugSplatDelegate.h
File metadata and controls
108 lines (73 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//
// BugSplatDelegate.h
//
// Copyright © BugSplat, LLC. All rights reserved.
//
#import <TargetConditionals.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class BugSplat;
@class BugSplatAttachment;
@protocol BugSplatDelegate <NSObject>
@optional
// MARK: - BugSplatDelegate (MacOS, iOS)
/** Return any log string based data the crash report being processed should contain
*
* @param bugSplat The `BugSplat` instance invoking this delegate
*/
- (NSString *)applicationLogForBugSplat:(BugSplat *)bugSplat;
/** Invoked right before sending crash reports will start
@param bugSplat The `BugSplat` instance invoking this delegate
*/
- (void)bugSplatWillSendCrashReport:(BugSplat *)bugSplat;
/** Invoked after sending crash reports failed
@param bugSplat The `BugSplat` instance invoking this delegate
@param error The error returned from the NSURLSession call
*/
- (void)bugSplat:(BugSplat *)bugSplat didFailWithError:(NSError *)error;
/** Invoked after sending crash reports succeeded
@param bugSplat The `BugSplat` instance invoking this delegate
*/
- (void)bugSplatDidFinishSendingCrashReport:(BugSplat *)bugSplat;
/** Invoked before the user is asked to send a crash report, so you can do additional actions.
E.g. to make sure not to ask the user for an app rating :)
@param bugSplat The `BugSplat` instance invoking this delegate
*/
-(void)bugSplatWillShowSubmitCrashReportAlert:(BugSplat *)bugSplat;
/** Invoked after the user did choose _NOT_ to send a crash in the alert
@param bugSplat The `BugSplat` instance invoking this delegate
*/
-(void)bugSplatWillCancelSendingCrashReport:(BugSplat *)bugSplat;
/** Return a BugSplatAttachment object providing an NSData object the crash report being processed should contain
NOTE: For iOS, if this method returns a non-nil BugSplatAttachment, any attributes added via setAttribute:value: to BugSplat will NOT be included in the Crash Report.
Example implementation:
NSData *data = [NSData dataWithContentsOfURL:@"mydatafile"];
BugSplatAttachment *attachment = [[BugSplatAttachment alloc] initWithFilename:@"myfile.data"
attachmentData:data
contentType:@"application/octet-stream"];
@param bugSplat The `BugSplat` instance invoking this delegate
*/
- (nullable BugSplatAttachment *)attachmentForBugSplat:(BugSplat *)bugSplat API_AVAILABLE(ios(13.0));
// MARK: - BugSplatDelegate (MacOS)
#if TARGET_OS_OSX
/** Return a collection of BugsplatAttachment objects providing an NSData object the crash report being processed should contain
Example implementation:
NSData *data = [NSData dataWithContentsOfURL:@"mydatafile"];
BugsplatAttachment *attachment = [[BugsplatAttachment alloc] initWithFilename:@"myfile.data"
attachmentData:data
contentType:@"application/octet-stream"];
@param bugSplat The `BugSplat` instance invoking this delegate
*/
- (NSArray<BugSplatAttachment *> *)attachmentsForBugSplat:(BugSplat *)bugSplat API_AVAILABLE(macosx(10.13));
// MARK: - BugSplatDelegate (iOS)
#else
/** Invoked after the user chose "Always Send" in the crash report alert.
When the user selects "Always Send", the crash report is sent and future crash reports
will be submitted automatically without prompting (unless the app clears NSUserDefaults).
Use this delegate method to update your app's UI or settings to reflect the user's choice.
@param bugSplat The `BugSplat` instance invoking this delegate
*/
-(void)bugSplatWillSendCrashReportsAlways:(BugSplat *)bugSplat API_AVAILABLE(ios(13.0));
#endif
@end
NS_ASSUME_NONNULL_END