-
-
Notifications
You must be signed in to change notification settings - Fork 341
/
Copy pathPrivateSentrySDKOnly.m
157 lines (128 loc) · 3.66 KB
/
PrivateSentrySDKOnly.m
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#import "PrivateSentrySDKOnly.h"
#import "SentryBreadcrumb+Private.h"
#import "SentryClient.h"
#import "SentryDebugImageProvider.h"
#import "SentryExtraContextProvider.h"
#import "SentryHub+Private.h"
#import "SentryInstallation.h"
#import "SentryMeta.h"
#import "SentrySDK+Private.h"
#import "SentrySerialization.h"
#import "SentryUser+Private.h"
#import "SentryViewHierarchy.h"
#import <SentryBreadcrumb.h>
#import <SentryDependencyContainer.h>
#import <SentryFramesTracker.h>
#import <SentryScreenshot.h>
#import <SentryUser.h>
@implementation PrivateSentrySDKOnly
static SentryOnAppStartMeasurementAvailable _onAppStartMeasurementAvailable;
static BOOL _appStartMeasurementHybridSDKMode = NO;
#if SENTRY_HAS_UIKIT
static BOOL _framesTrackingMeasurementHybridSDKMode = NO;
#endif
+ (void)storeEnvelope:(SentryEnvelope *)envelope
{
[SentrySDK storeEnvelope:envelope];
}
+ (void)captureEnvelope:(SentryEnvelope *)envelope
{
[SentrySDK captureEnvelope:envelope];
}
+ (nullable SentryEnvelope *)envelopeWithData:(NSData *)data
{
return [SentrySerialization envelopeWithData:data];
}
+ (NSArray<SentryDebugMeta *> *)getDebugImages
{
return [[SentryDependencyContainer sharedInstance].debugImageProvider getDebugImages];
}
+ (nullable SentryAppStartMeasurement *)appStartMeasurement
{
return [SentrySDK getAppStartMeasurement];
}
+ (NSString *)installationID
{
return [SentryInstallation id];
}
+ (SentryOptions *)options
{
SentryOptions *options = [[SentrySDK currentHub] client].options;
if (options != nil) {
return options;
}
return [[SentryOptions alloc] init];
}
+ (SentryOnAppStartMeasurementAvailable)onAppStartMeasurementAvailable
{
return _onAppStartMeasurementAvailable;
}
+ (void)setOnAppStartMeasurementAvailable:
(SentryOnAppStartMeasurementAvailable)onAppStartMeasurementAvailable
{
_onAppStartMeasurementAvailable = onAppStartMeasurementAvailable;
}
+ (BOOL)appStartMeasurementHybridSDKMode
{
return _appStartMeasurementHybridSDKMode;
}
+ (void)setAppStartMeasurementHybridSDKMode:(BOOL)appStartMeasurementHybridSDKMode
{
_appStartMeasurementHybridSDKMode = appStartMeasurementHybridSDKMode;
}
+ (void)setSdkName:(NSString *)sdkName andVersionString:(NSString *)versionString
{
SentryMeta.sdkName = sdkName;
SentryMeta.versionString = versionString;
}
+ (void)setSdkName:(NSString *)sdkName
{
SentryMeta.sdkName = sdkName;
}
+ (NSString *)getSdkName
{
return SentryMeta.sdkName;
}
+ (NSString *)getSdkVersionString
{
return SentryMeta.versionString;
}
+ (NSDictionary *)getExtraContext
{
return [[SentryExtraContextProvider sharedInstance] getExtraContext];
}
#if SENTRY_HAS_UIKIT
+ (BOOL)framesTrackingMeasurementHybridSDKMode
{
return _framesTrackingMeasurementHybridSDKMode;
}
+ (void)setFramesTrackingMeasurementHybridSDKMode:(BOOL)framesTrackingMeasurementHybridSDKMode
{
_framesTrackingMeasurementHybridSDKMode = framesTrackingMeasurementHybridSDKMode;
}
+ (BOOL)isFramesTrackingRunning
{
return [SentryFramesTracker sharedInstance].isRunning;
}
+ (SentryScreenFrames *)currentScreenFrames
{
return [SentryFramesTracker sharedInstance].currentFrames;
}
+ (NSArray<NSData *> *)captureScreenshots
{
return [SentryDependencyContainer.sharedInstance.screenshot takeScreenshots];
}
+ (NSData *)captureViewHierarchy
{
return [SentryDependencyContainer.sharedInstance.viewHierarchy fetchViewHierarchy];
}
#endif
+ (SentryUser *)userWithDictionary:(NSDictionary *)dictionary
{
return [[SentryUser alloc] initWithDictionary:dictionary];
}
+ (SentryBreadcrumb *)breadcrumbWithDictionary:(NSDictionary *)dictionary
{
return [[SentryBreadcrumb alloc] initWithDictionary:dictionary];
}
@end