forked from getsentry/sentry-cocoa
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSentrySession.h
59 lines (46 loc) · 1.87 KB
/
SentrySession.h
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
#import "SentryDefines.h"
#import "SentrySerializable.h"
@class SentryUser;
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, SentrySessionStatus) {
kSentrySessionStatusOk = 0,
kSentrySessionStatusExited = 1,
kSentrySessionStatusCrashed = 2,
kSentrySessionStatusAbnormal = 3,
};
/**
* The SDK uses SentrySession to inform Sentry about release and project associated project health.
*/
@interface SentrySession : NSObject <SentrySerializable, NSCopying>
SENTRY_NO_INIT
- (instancetype)initWithReleaseName:(NSString *)releaseName;
/**
* Initializes SentrySession from a JSON object.
*
* @param jsonObject The jsonObject containing the session.
*
* @return The SentrySession or nil if the JSONObject contains an error.
*/
- (nullable instancetype)initWithJSONObject:(NSDictionary *)jsonObject;
- (void)endSessionExitedWithTimestamp:(NSDate *)timestamp;
- (void)endSessionCrashedWithTimestamp:(NSDate *)timestamp;
- (void)endSessionAbnormalWithTimestamp:(NSDate *)timestamp;
- (void)incrementErrors;
@property (nonatomic, readonly, strong) NSUUID *sessionId;
@property (nonatomic, readonly, strong) NSDate *started;
@property (nonatomic, readonly) enum SentrySessionStatus status;
@property (nonatomic, readonly) NSUInteger errors;
@property (nonatomic, readonly) NSUInteger sequence;
@property (nonatomic, readonly, strong) NSString *distinctId;
/**
We can't use init because it overlaps with NSObject.init
*/
@property (nonatomic, readonly, copy) NSNumber *_Nullable flagInit;
@property (nonatomic, readonly, strong) NSDate *_Nullable timestamp;
@property (nonatomic, readonly, strong) NSNumber *_Nullable duration;
@property (nonatomic, readonly, copy) NSString *_Nullable releaseName;
@property (nonatomic, copy) NSString *_Nullable environment;
@property (nonatomic, copy) SentryUser *_Nullable user;
- (NSDictionary<NSString *, id> *)serialize;
@end
NS_ASSUME_NONNULL_END