@sentry/react-native 6.1.0 → 6.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -9
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java +6 -0
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +183 -127
- package/android/src/main/java/io/sentry/react/RNSentryTimeToDisplay.java +42 -0
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +5 -0
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +5 -0
- package/dist/js/NativeRNSentry.d.ts +1 -0
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +7 -2
- package/dist/js/client.js.map +1 -1
- package/dist/js/index.d.ts +2 -2
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +4 -37
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.d.ts +6 -2
- package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.js +44 -27
- package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +11 -7
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/devicecontext.d.ts.map +1 -1
- package/dist/js/integrations/devicecontext.js +7 -3
- package/dist/js/integrations/devicecontext.js.map +1 -1
- package/dist/js/integrations/spotlight.d.ts +4 -0
- package/dist/js/integrations/spotlight.d.ts.map +1 -1
- package/dist/js/integrations/spotlight.js +4 -1
- package/dist/js/integrations/spotlight.js.map +1 -1
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +40 -2
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/metroMiddleware.d.ts +15 -0
- package/dist/js/tools/metroMiddleware.d.ts.map +1 -0
- package/dist/js/tools/metroMiddleware.js +105 -0
- package/dist/js/tools/metroMiddleware.js.map +1 -0
- package/dist/js/tools/metroconfig.d.ts +7 -1
- package/dist/js/tools/metroconfig.d.ts.map +1 -1
- package/dist/js/tools/metroconfig.js +9 -1
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +17 -1
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.js +7 -7
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/utils/ignorerequirecyclelogs.d.ts +6 -1
- package/dist/js/utils/ignorerequirecyclelogs.d.ts.map +1 -1
- package/dist/js/utils/ignorerequirecyclelogs.js +6 -2
- package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -1
- package/dist/js/utils/sentryeventemitterfallback.d.ts +19 -0
- package/dist/js/utils/sentryeventemitterfallback.d.ts.map +1 -0
- package/dist/js/utils/sentryeventemitterfallback.js +78 -0
- package/dist/js/utils/sentryeventemitterfallback.js.map +1 -0
- package/dist/js/vendor/react-native/index.d.ts +1 -1
- package/dist/js/vendor/react-native/index.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +4 -0
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +6 -0
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.h +8 -12
- package/ios/RNSentry.mm +417 -303
- package/ios/RNSentryBreadcrumb.h +2 -2
- package/ios/RNSentryBreadcrumb.m +13 -6
- package/ios/RNSentryDependencyContainer.h +2 -2
- package/ios/RNSentryDependencyContainer.m +7 -6
- package/ios/RNSentryFramesTrackerListener.h +6 -6
- package/ios/RNSentryFramesTrackerListener.m +10 -8
- package/ios/RNSentryId.m +2 -1
- package/ios/RNSentryOnDrawReporter.h +5 -5
- package/ios/RNSentryOnDrawReporter.m +26 -24
- package/ios/RNSentryRNSScreen.h +1 -1
- package/ios/RNSentryRNSScreen.m +18 -18
- package/ios/RNSentryReplay.m +42 -53
- package/ios/RNSentryReplayBreadcrumbConverter.h +3 -4
- package/ios/RNSentryReplayBreadcrumbConverter.m +139 -132
- package/ios/RNSentryTimeToDisplay.h +7 -0
- package/ios/RNSentryTimeToDisplay.m +44 -0
- package/package.json +17 -16
- package/scripts/expo-upload-sourcemaps.js +16 -0
- package/scripts/sentry-xcode-debug-files.sh +6 -0
- package/scripts/sentry-xcode.sh +4 -0
- package/sentry.gradle +13 -2
- package/src/js/NativeRNSentry.ts +1 -0
- package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -0
- package/ts3.8/dist/js/index.d.ts +2 -2
- package/ts3.8/dist/js/integrations/debugsymbolicatorutils.d.ts +6 -2
- package/ts3.8/dist/js/integrations/spotlight.d.ts +4 -0
- package/ts3.8/dist/js/utils/ignorerequirecyclelogs.d.ts +6 -1
- package/ts3.8/dist/js/utils/sentryeventemitterfallback.d.ts +19 -0
- package/ts3.8/dist/js/vendor/react-native/index.d.ts +1 -1
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +4 -0
package/ios/RNSentryBreadcrumb.h
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
@interface RNSentryBreadcrumb : NSObject
|
|
8
8
|
|
|
9
|
-
+ (SentryBreadcrumb *)from:
|
|
9
|
+
+ (SentryBreadcrumb *)from:(NSDictionary *)dict;
|
|
10
10
|
|
|
11
|
-
+ (NSString *_Nullable)
|
|
11
|
+
+ (NSString *_Nullable)getCurrentScreenFrom:(NSDictionary *)dict;
|
|
12
12
|
|
|
13
13
|
@end
|
package/ios/RNSentryBreadcrumb.m
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
@implementation RNSentryBreadcrumb
|
|
5
5
|
|
|
6
|
-
+(SentryBreadcrumb*)
|
|
6
|
+
+ (SentryBreadcrumb *)from:(NSDictionary *)dict
|
|
7
7
|
{
|
|
8
|
-
SentryBreadcrumb*
|
|
8
|
+
SentryBreadcrumb *crumb = [[SentryBreadcrumb alloc] init];
|
|
9
9
|
|
|
10
|
-
NSString *
|
|
10
|
+
NSString *levelString = dict[@"level"];
|
|
11
11
|
SentryLevel sentryLevel;
|
|
12
12
|
if ([levelString isEqualToString:@"fatal"]) {
|
|
13
13
|
sentryLevel = kSentryLevelFatal;
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
|
|
24
24
|
[crumb setLevel:sentryLevel];
|
|
25
25
|
[crumb setCategory:dict[@"category"]];
|
|
26
|
+
id origin = dict[@"origin"];
|
|
27
|
+
if (origin != nil) {
|
|
28
|
+
[crumb setOrigin:origin];
|
|
29
|
+
} else {
|
|
30
|
+
[crumb setOrigin:@"react-native"];
|
|
31
|
+
}
|
|
26
32
|
[crumb setType:dict[@"type"]];
|
|
27
33
|
[crumb setMessage:dict[@"message"]];
|
|
28
34
|
[crumb setData:dict[@"data"]];
|
|
@@ -30,13 +36,14 @@
|
|
|
30
36
|
return crumb;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
+ (NSString *_Nullable)
|
|
39
|
+
+ (NSString *_Nullable)getCurrentScreenFrom:(NSDictionary<NSString *, id> *_Nonnull)dict
|
|
40
|
+
{
|
|
34
41
|
NSString *_Nullable maybeCategory = [dict valueForKey:@"category"];
|
|
35
42
|
if (![maybeCategory isEqualToString:@"navigation"]) {
|
|
36
43
|
return nil;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
|
-
NSDictionary<NSString*, id> *_Nullable maybeData = [dict valueForKey:@"data"];
|
|
46
|
+
NSDictionary<NSString *, id> *_Nullable maybeData = [dict valueForKey:@"data"];
|
|
40
47
|
if (![maybeData isKindOfClass:[NSDictionary class]]) {
|
|
41
48
|
return nil;
|
|
42
49
|
}
|
|
@@ -45,7 +52,7 @@
|
|
|
45
52
|
if (![maybeCurrentScreen isKindOfClass:[NSString class]]) {
|
|
46
53
|
return nil;
|
|
47
54
|
}
|
|
48
|
-
|
|
55
|
+
|
|
49
56
|
return maybeCurrentScreen;
|
|
50
57
|
}
|
|
51
58
|
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
@interface RNSentryDependencyContainer : NSObject
|
|
6
6
|
SENTRY_NO_INIT
|
|
7
7
|
|
|
8
|
-
@property (class, readonly, strong) RNSentryDependencyContainer*
|
|
8
|
+
@property (class, readonly, strong) RNSentryDependencyContainer *sharedInstance;
|
|
9
9
|
|
|
10
10
|
#if SENTRY_HAS_UIKIT
|
|
11
11
|
|
|
12
12
|
@property (nonatomic, strong) RNSentryFramesTrackerListener *framesTrackerListener;
|
|
13
13
|
|
|
14
|
-
- (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent)
|
|
14
|
+
- (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent)eventEmitter;
|
|
15
15
|
|
|
16
16
|
#endif
|
|
17
17
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
#import <Sentry/SentryDependencyContainer.h>
|
|
3
3
|
|
|
4
4
|
@implementation RNSentryDependencyContainer {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
NSObject *sentryDependencyContainerLock;
|
|
6
|
+
}
|
|
7
7
|
|
|
8
8
|
+ (instancetype)sharedInstance
|
|
9
9
|
{
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
|
|
26
26
|
- (void)initializeFramesTrackerListenerWith:(RNSentryEmitNewFrameEvent)eventEmitter
|
|
27
27
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
@synchronized(sentryDependencyContainerLock) {
|
|
29
|
+
_framesTrackerListener = [[RNSentryFramesTrackerListener alloc]
|
|
30
|
+
initWithSentryFramesTracker:[[SentryDependencyContainer sharedInstance] framesTracker]
|
|
31
|
+
andEventEmitter:eventEmitter];
|
|
32
|
+
}
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
#endif
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
#if SENTRY_HAS_UIKIT
|
|
4
4
|
|
|
5
|
-
#import <Foundation/Foundation.h>
|
|
6
|
-
#import <React/RCTEventEmitter.h>
|
|
7
|
-
#import <Sentry/SentryFramesTracker.h>
|
|
5
|
+
# import <Foundation/Foundation.h>
|
|
6
|
+
# import <React/RCTEventEmitter.h>
|
|
7
|
+
# import <Sentry/SentryFramesTracker.h>
|
|
8
8
|
|
|
9
9
|
typedef void (^RNSentryEmitNewFrameEvent)(NSNumber *newFrameTimestampInSeconds);
|
|
10
10
|
|
|
11
11
|
@interface RNSentryFramesTrackerListener : NSObject <SentryFramesTrackerListener>
|
|
12
12
|
|
|
13
|
-
- (instancetype)initWithSentryFramesTracker:(SentryFramesTracker *)
|
|
14
|
-
andEventEmitter:(RNSentryEmitNewFrameEvent)
|
|
13
|
+
- (instancetype)initWithSentryFramesTracker:(SentryFramesTracker *)framesTracker
|
|
14
|
+
andEventEmitter:(RNSentryEmitNewFrameEvent)emitNewFrameEvent;
|
|
15
15
|
|
|
16
|
-
- (void)
|
|
16
|
+
- (void)startListening;
|
|
17
17
|
|
|
18
18
|
@property (strong, nonatomic) SentryFramesTracker *framesTracker;
|
|
19
19
|
@property (strong, nonatomic) RNSentryEmitNewFrameEvent emitNewFrameEvent;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@implementation RNSentryFramesTrackerListener
|
|
6
6
|
|
|
7
7
|
- (instancetype)initWithSentryFramesTracker:(SentryFramesTracker *)framesTracker
|
|
8
|
-
andEventEmitter:(RNSentryEmitNewFrameEvent)
|
|
8
|
+
andEventEmitter:(RNSentryEmitNewFrameEvent)emitNewFrameEvent;
|
|
9
9
|
{
|
|
10
10
|
self = [super init];
|
|
11
11
|
if (self) {
|
|
@@ -17,16 +17,18 @@
|
|
|
17
17
|
|
|
18
18
|
- (void)framesTrackerHasNewFrame:(NSDate *)newFrameDate
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
[_framesTracker removeListener:self];
|
|
21
|
+
NSNumber *newFrameTimestampInSeconds =
|
|
22
|
+
[NSNumber numberWithDouble:[newFrameDate timeIntervalSince1970]];
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
if (_emitNewFrameEvent) {
|
|
25
|
+
_emitNewFrameEvent(newFrameTimestampInSeconds);
|
|
26
|
+
}
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
- (void)startListening
|
|
29
|
-
|
|
29
|
+
- (void)startListening
|
|
30
|
+
{
|
|
31
|
+
[_framesTracker addListener:self];
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
@end
|
package/ios/RNSentryId.m
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
#if SENTRY_HAS_UIKIT
|
|
4
4
|
|
|
5
|
-
#import
|
|
6
|
-
#import <React/RCTViewManager.h>
|
|
7
|
-
#import
|
|
5
|
+
# import "RNSentryFramesTrackerListener.h"
|
|
6
|
+
# import <React/RCTViewManager.h>
|
|
7
|
+
# import <UIKit/UIKit.h>
|
|
8
8
|
|
|
9
9
|
@interface RNSentryOnDrawReporter : RCTViewManager
|
|
10
10
|
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
@interface RNSentryOnDrawReporterView : UIView
|
|
14
14
|
|
|
15
|
-
@property (nonatomic, strong) RNSentryFramesTrackerListener*
|
|
15
|
+
@property (nonatomic, strong) RNSentryFramesTrackerListener *framesListener;
|
|
16
16
|
@property (nonatomic, copy) RCTBubblingEventBlock onDrawNextFrame;
|
|
17
17
|
@property (nonatomic) bool fullDisplay;
|
|
18
18
|
@property (nonatomic) bool initialDisplay;
|
|
19
|
-
@property (nonatomic, weak) RNSentryOnDrawReporter*
|
|
19
|
+
@property (nonatomic, weak) RNSentryOnDrawReporter *delegate;
|
|
20
20
|
|
|
21
21
|
@end
|
|
22
22
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#if SENTRY_HAS_UIKIT
|
|
4
4
|
|
|
5
|
-
#import <Sentry/SentryDependencyContainer.h>
|
|
5
|
+
# import <Sentry/SentryDependencyContainer.h>
|
|
6
6
|
|
|
7
7
|
@implementation RNSentryOnDrawReporter
|
|
8
8
|
|
|
@@ -13,45 +13,47 @@ RCT_EXPORT_VIEW_PROPERTY(fullDisplay, BOOL)
|
|
|
13
13
|
|
|
14
14
|
- (UIView *)view
|
|
15
15
|
{
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
RNSentryOnDrawReporterView *view = [[RNSentryOnDrawReporterView alloc] init];
|
|
17
|
+
return view;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@end
|
|
21
21
|
|
|
22
22
|
@implementation RNSentryOnDrawReporterView
|
|
23
23
|
|
|
24
|
-
- (instancetype)init
|
|
24
|
+
- (instancetype)init
|
|
25
|
+
{
|
|
25
26
|
self = [super init];
|
|
26
27
|
if (self) {
|
|
27
28
|
RNSentryEmitNewFrameEvent emitNewFrameEvent = ^(NSNumber *newFrameTimestampInSeconds) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
if (self->_fullDisplay) {
|
|
30
|
+
self.onDrawNextFrame(@{
|
|
31
|
+
@"newFrameTimestampInSeconds" : newFrameTimestampInSeconds,
|
|
32
|
+
@"type" : @"fullDisplay"
|
|
33
|
+
});
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (self->_initialDisplay) {
|
|
38
|
+
self.onDrawNextFrame(@{
|
|
39
|
+
@"newFrameTimestampInSeconds" : newFrameTimestampInSeconds,
|
|
40
|
+
@"type" : @"initialDisplay"
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
43
44
|
};
|
|
44
|
-
_framesListener = [[RNSentryFramesTrackerListener alloc]
|
|
45
|
-
|
|
45
|
+
_framesListener = [[RNSentryFramesTrackerListener alloc]
|
|
46
|
+
initWithSentryFramesTracker:[[SentryDependencyContainer sharedInstance] framesTracker]
|
|
47
|
+
andEventEmitter:emitNewFrameEvent];
|
|
46
48
|
}
|
|
47
49
|
return self;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
- (void)didSetProps:(NSArray<NSString *> *)changedProps
|
|
51
53
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
if (_fullDisplay || _initialDisplay) {
|
|
55
|
+
[_framesListener startListening];
|
|
56
|
+
}
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
@end
|
package/ios/RNSentryRNSScreen.h
CHANGED
package/ios/RNSentryRNSScreen.m
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
#if SENTRY_HAS_UIKIT
|
|
4
4
|
|
|
5
|
-
#import <Sentry/
|
|
6
|
-
#import <Sentry/
|
|
7
|
-
#import <Sentry/SentrySwizzle.h>
|
|
5
|
+
# import <Sentry/SentryDependencyContainer.h>
|
|
6
|
+
# import <Sentry/SentryFramesTracker.h>
|
|
7
|
+
# import <Sentry/SentrySwizzle.h>
|
|
8
8
|
|
|
9
|
-
#import "RNSentryDependencyContainer.h"
|
|
9
|
+
# import "RNSentryDependencyContainer.h"
|
|
10
10
|
|
|
11
11
|
@implementation RNSentryRNSScreen
|
|
12
12
|
|
|
13
|
-
+ (void)swizzleViewDidAppear
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
+ (void)swizzleViewDidAppear
|
|
14
|
+
{
|
|
15
|
+
Class rnsscreenclass = NSClassFromString(@"RNSScreen");
|
|
16
|
+
if (rnsscreenclass == nil) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
SEL selector = NSSelectorFromString(@"viewDidAppear:");
|
|
21
|
+
SentrySwizzleInstanceMethod(rnsscreenclass, selector, SentrySWReturnType(void),
|
|
22
|
+
SentrySWArguments(BOOL animated), SentrySWReplacement({
|
|
23
|
+
[[[RNSentryDependencyContainer sharedInstance] framesTrackerListener] startListening];
|
|
24
|
+
SentrySWCallOriginal(animated);
|
|
25
|
+
}),
|
|
26
|
+
SentrySwizzleModeOncePerClass, (void *)selector);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@end
|
package/ios/RNSentryReplay.m
CHANGED
|
@@ -6,70 +6,59 @@
|
|
|
6
6
|
@implementation RNSentryReplay {
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
+ (void)updateOptions:(NSMutableDictionary *)options
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
+ (void)updateOptions:(NSMutableDictionary *)options
|
|
10
|
+
{
|
|
11
|
+
NSDictionary *experiments = options[@"_experiments"];
|
|
12
|
+
[options removeObjectForKey:@"_experiments"];
|
|
13
|
+
if (experiments == nil) {
|
|
14
|
+
NSLog(@"Session replay disabled via configuration");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
if (experiments[@"replaysSessionSampleRate"] == nil
|
|
19
|
+
&& experiments[@"replaysOnErrorSampleRate"] == nil) {
|
|
20
|
+
NSLog(@"Session replay disabled via configuration");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
NSLog(@"Setting up session replay");
|
|
25
|
+
NSDictionary *replayOptions = options[@"mobileReplayOptions"] ?: @{};
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
[options setValue:@{
|
|
28
|
+
@"sessionReplay" : @ {
|
|
29
|
+
@"sessionSampleRate" : experiments[@"replaysSessionSampleRate"] ?: [NSNull null],
|
|
30
|
+
@"errorSampleRate" : experiments[@"replaysOnErrorSampleRate"] ?: [NSNull null],
|
|
31
|
+
@"maskAllImages" : replayOptions[@"maskAllImages"] ?: [NSNull null],
|
|
32
|
+
@"maskAllText" : replayOptions[@"maskAllText"] ?: [NSNull null],
|
|
33
|
+
@"maskedViewClasses" : [RNSentryReplay getReplayRNRedactClasses:replayOptions],
|
|
34
|
+
}
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
forKey:@"experimental"];
|
|
37
|
-
|
|
38
|
-
[RNSentryReplay addReplayRNRedactClasses:replayOptions];
|
|
36
|
+
forKey:@"experimental"];
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
+ (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if ([replayOptions[@"maskAllImages"] boolValue] == YES) {
|
|
50
|
-
Class _Nullable maybeRCTImageClass = NSClassFromString(@"RCTImageView");
|
|
51
|
-
if (maybeRCTImageClass != nil) {
|
|
52
|
-
[classesToRedact addObject:maybeRCTImageClass];
|
|
39
|
+
+ (NSArray *_Nonnull)getReplayRNRedactClasses:(NSDictionary *_Nullable)replayOptions
|
|
40
|
+
{
|
|
41
|
+
NSMutableArray *_Nonnull classesToRedact = [[NSMutableArray alloc] init];
|
|
42
|
+
|
|
43
|
+
if ([replayOptions[@"maskAllVectors"] boolValue] == YES) {
|
|
44
|
+
[classesToRedact addObject:@"RNSVGSvgView"];
|
|
53
45
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Class _Nullable maybeRCTTextClass = NSClassFromString(@"RCTTextView");
|
|
57
|
-
if (maybeRCTTextClass != nil) {
|
|
58
|
-
[classesToRedact addObject:maybeRCTTextClass];
|
|
46
|
+
if ([replayOptions[@"maskAllImages"] boolValue] == YES) {
|
|
47
|
+
[classesToRedact addObject:@"RCTImageView"];
|
|
59
48
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
[classesToRedact addObject
|
|
49
|
+
if ([replayOptions[@"maskAllText"] boolValue] == YES) {
|
|
50
|
+
[classesToRedact addObject:@"RCTTextView"];
|
|
51
|
+
[classesToRedact addObject:@"RCTParagraphComponentView"];
|
|
63
52
|
}
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
|
|
54
|
+
return classesToRedact;
|
|
66
55
|
}
|
|
67
56
|
|
|
68
|
-
+ (void)postInit
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
57
|
+
+ (void)postInit
|
|
58
|
+
{
|
|
59
|
+
RNSentryReplayBreadcrumbConverter *breadcrumbConverter =
|
|
60
|
+
[[RNSentryReplayBreadcrumbConverter alloc] init];
|
|
61
|
+
[PrivateSentrySDKOnly configureSessionReplayWith:breadcrumbConverter screenshotProvider:nil];
|
|
73
62
|
}
|
|
74
63
|
|
|
75
64
|
@end
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
#if SENTRY_TARGET_REPLAY_SUPPORTED
|
|
4
4
|
@class SentryRRWebEvent;
|
|
5
5
|
|
|
6
|
-
@interface RNSentryReplayBreadcrumbConverter
|
|
7
|
-
: NSObject <SentryReplayBreadcrumbConverter>
|
|
6
|
+
@interface RNSentryReplayBreadcrumbConverter : NSObject <SentryReplayBreadcrumbConverter>
|
|
8
7
|
|
|
9
8
|
- (instancetype _Nonnull)init;
|
|
10
9
|
|
|
11
|
-
+ (NSString*
|
|
10
|
+
+ (NSString *_Nullable)getTouchPathMessageFrom:(NSArray *_Nullable)path;
|
|
12
11
|
|
|
13
|
-
- (id<SentryRRWebEvent> _Nullable)convertFrom:(SentryBreadcrumb *_Nonnull)
|
|
12
|
+
- (id<SentryRRWebEvent> _Nullable)convertFrom:(SentryBreadcrumb *_Nonnull)breadcrumb;
|
|
14
13
|
|
|
15
14
|
@end
|
|
16
15
|
#endif
|