@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.
Files changed (101) hide show
  1. package/README.md +5 -9
  2. package/RNSentry.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java +6 -0
  5. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +183 -127
  6. package/android/src/main/java/io/sentry/react/RNSentryTimeToDisplay.java +42 -0
  7. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +5 -0
  8. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +5 -0
  9. package/dist/js/NativeRNSentry.d.ts +1 -0
  10. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  11. package/dist/js/NativeRNSentry.js.map +1 -1
  12. package/dist/js/client.d.ts.map +1 -1
  13. package/dist/js/client.js +7 -2
  14. package/dist/js/client.js.map +1 -1
  15. package/dist/js/index.d.ts +2 -2
  16. package/dist/js/index.d.ts.map +1 -1
  17. package/dist/js/index.js +1 -1
  18. package/dist/js/index.js.map +1 -1
  19. package/dist/js/integrations/debugsymbolicator.js +4 -37
  20. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  21. package/dist/js/integrations/debugsymbolicatorutils.d.ts +6 -2
  22. package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
  23. package/dist/js/integrations/debugsymbolicatorutils.js +44 -27
  24. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
  25. package/dist/js/integrations/default.d.ts.map +1 -1
  26. package/dist/js/integrations/default.js +11 -7
  27. package/dist/js/integrations/default.js.map +1 -1
  28. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  29. package/dist/js/integrations/devicecontext.js +7 -3
  30. package/dist/js/integrations/devicecontext.js.map +1 -1
  31. package/dist/js/integrations/spotlight.d.ts +4 -0
  32. package/dist/js/integrations/spotlight.d.ts.map +1 -1
  33. package/dist/js/integrations/spotlight.js +4 -1
  34. package/dist/js/integrations/spotlight.js.map +1 -1
  35. package/dist/js/sdk.d.ts.map +1 -1
  36. package/dist/js/sdk.js +40 -2
  37. package/dist/js/sdk.js.map +1 -1
  38. package/dist/js/tools/metroMiddleware.d.ts +15 -0
  39. package/dist/js/tools/metroMiddleware.d.ts.map +1 -0
  40. package/dist/js/tools/metroMiddleware.js +105 -0
  41. package/dist/js/tools/metroMiddleware.js.map +1 -0
  42. package/dist/js/tools/metroconfig.d.ts +7 -1
  43. package/dist/js/tools/metroconfig.d.ts.map +1 -1
  44. package/dist/js/tools/metroconfig.js +9 -1
  45. package/dist/js/tools/metroconfig.js.map +1 -1
  46. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  47. package/dist/js/tracing/reactnativetracing.js +17 -1
  48. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  49. package/dist/js/tracing/reactnavigation.js +7 -7
  50. package/dist/js/tracing/reactnavigation.js.map +1 -1
  51. package/dist/js/utils/ignorerequirecyclelogs.d.ts +6 -1
  52. package/dist/js/utils/ignorerequirecyclelogs.d.ts.map +1 -1
  53. package/dist/js/utils/ignorerequirecyclelogs.js +6 -2
  54. package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -1
  55. package/dist/js/utils/sentryeventemitterfallback.d.ts +19 -0
  56. package/dist/js/utils/sentryeventemitterfallback.d.ts.map +1 -0
  57. package/dist/js/utils/sentryeventemitterfallback.js +78 -0
  58. package/dist/js/utils/sentryeventemitterfallback.js.map +1 -0
  59. package/dist/js/vendor/react-native/index.d.ts +1 -1
  60. package/dist/js/vendor/react-native/index.js.map +1 -1
  61. package/dist/js/version.d.ts +1 -1
  62. package/dist/js/version.d.ts.map +1 -1
  63. package/dist/js/version.js +1 -1
  64. package/dist/js/version.js.map +1 -1
  65. package/dist/js/wrapper.d.ts +4 -0
  66. package/dist/js/wrapper.d.ts.map +1 -1
  67. package/dist/js/wrapper.js +6 -0
  68. package/dist/js/wrapper.js.map +1 -1
  69. package/ios/RNSentry.h +8 -12
  70. package/ios/RNSentry.mm +417 -303
  71. package/ios/RNSentryBreadcrumb.h +2 -2
  72. package/ios/RNSentryBreadcrumb.m +13 -6
  73. package/ios/RNSentryDependencyContainer.h +2 -2
  74. package/ios/RNSentryDependencyContainer.m +7 -6
  75. package/ios/RNSentryFramesTrackerListener.h +6 -6
  76. package/ios/RNSentryFramesTrackerListener.m +10 -8
  77. package/ios/RNSentryId.m +2 -1
  78. package/ios/RNSentryOnDrawReporter.h +5 -5
  79. package/ios/RNSentryOnDrawReporter.m +26 -24
  80. package/ios/RNSentryRNSScreen.h +1 -1
  81. package/ios/RNSentryRNSScreen.m +18 -18
  82. package/ios/RNSentryReplay.m +42 -53
  83. package/ios/RNSentryReplayBreadcrumbConverter.h +3 -4
  84. package/ios/RNSentryReplayBreadcrumbConverter.m +139 -132
  85. package/ios/RNSentryTimeToDisplay.h +7 -0
  86. package/ios/RNSentryTimeToDisplay.m +44 -0
  87. package/package.json +17 -16
  88. package/scripts/expo-upload-sourcemaps.js +16 -0
  89. package/scripts/sentry-xcode-debug-files.sh +6 -0
  90. package/scripts/sentry-xcode.sh +4 -0
  91. package/sentry.gradle +13 -2
  92. package/src/js/NativeRNSentry.ts +1 -0
  93. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -0
  94. package/ts3.8/dist/js/index.d.ts +2 -2
  95. package/ts3.8/dist/js/integrations/debugsymbolicatorutils.d.ts +6 -2
  96. package/ts3.8/dist/js/integrations/spotlight.d.ts +4 -0
  97. package/ts3.8/dist/js/utils/ignorerequirecyclelogs.d.ts +6 -1
  98. package/ts3.8/dist/js/utils/sentryeventemitterfallback.d.ts +19 -0
  99. package/ts3.8/dist/js/vendor/react-native/index.d.ts +1 -1
  100. package/ts3.8/dist/js/version.d.ts +1 -1
  101. package/ts3.8/dist/js/wrapper.d.ts +4 -0
@@ -6,8 +6,8 @@
6
6
 
7
7
  @interface RNSentryBreadcrumb : NSObject
8
8
 
9
- + (SentryBreadcrumb *)from: (NSDictionary *) dict;
9
+ + (SentryBreadcrumb *)from:(NSDictionary *)dict;
10
10
 
11
- + (NSString *_Nullable) getCurrentScreenFrom: (NSDictionary *) dict;
11
+ + (NSString *_Nullable)getCurrentScreenFrom:(NSDictionary *)dict;
12
12
 
13
13
  @end
@@ -3,11 +3,11 @@
3
3
 
4
4
  @implementation RNSentryBreadcrumb
5
5
 
6
- +(SentryBreadcrumb*) from: (NSDictionary *) dict
6
+ + (SentryBreadcrumb *)from:(NSDictionary *)dict
7
7
  {
8
- SentryBreadcrumb* crumb = [[SentryBreadcrumb alloc] init];
8
+ SentryBreadcrumb *crumb = [[SentryBreadcrumb alloc] init];
9
9
 
10
- NSString * levelString = dict[@"level"];
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) getCurrentScreenFrom: (NSDictionary<NSString*, id> *_Nonnull) dict {
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* sharedInstance;
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) eventEmitter;
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
- NSObject *sentryDependencyContainerLock;
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
- @synchronized(sentryDependencyContainerLock) {
29
- _framesTrackerListener = [[RNSentryFramesTrackerListener alloc] initWithSentryFramesTracker:[[SentryDependencyContainer sharedInstance] framesTracker]
30
- andEventEmitter: eventEmitter];
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 *) framesTracker
14
- andEventEmitter:(RNSentryEmitNewFrameEvent) emitNewFrameEvent;
13
+ - (instancetype)initWithSentryFramesTracker:(SentryFramesTracker *)framesTracker
14
+ andEventEmitter:(RNSentryEmitNewFrameEvent)emitNewFrameEvent;
15
15
 
16
- - (void) startListening;
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) emitNewFrameEvent;
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
- [_framesTracker removeListener:self];
21
- NSNumber *newFrameTimestampInSeconds = [NSNumber numberWithDouble:[newFrameDate timeIntervalSince1970]];
20
+ [_framesTracker removeListener:self];
21
+ NSNumber *newFrameTimestampInSeconds =
22
+ [NSNumber numberWithDouble:[newFrameDate timeIntervalSince1970]];
22
23
 
23
- if (_emitNewFrameEvent) {
24
- _emitNewFrameEvent(newFrameTimestampInSeconds);
25
- }
24
+ if (_emitNewFrameEvent) {
25
+ _emitNewFrameEvent(newFrameTimestampInSeconds);
26
+ }
26
27
  }
27
28
 
28
- - (void)startListening {
29
- [_framesTracker addListener:self];
29
+ - (void)startListening
30
+ {
31
+ [_framesTracker addListener:self];
30
32
  }
31
33
 
32
34
  @end
package/ios/RNSentryId.m CHANGED
@@ -3,7 +3,8 @@
3
3
 
4
4
  @implementation RNSentryId
5
5
 
6
- + (SentryId *)newId {
6
+ + (SentryId *)newId
7
+ {
7
8
  return [[SentryId alloc] init];
8
9
  }
9
10
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  #if SENTRY_HAS_UIKIT
4
4
 
5
- #import <UIKit/UIKit.h>
6
- #import <React/RCTViewManager.h>
7
- #import "RNSentryFramesTrackerListener.h"
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* framesListener;
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* delegate;
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
- RNSentryOnDrawReporterView* view = [[RNSentryOnDrawReporterView alloc] init];
17
- return view;
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
- if (self->_fullDisplay) {
29
- self.onDrawNextFrame(@{
30
- @"newFrameTimestampInSeconds": newFrameTimestampInSeconds,
31
- @"type": @"fullDisplay"
32
- });
33
- return;
34
- }
35
-
36
- if (self->_initialDisplay) {
37
- self.onDrawNextFrame(@{
38
- @"newFrameTimestampInSeconds": newFrameTimestampInSeconds,
39
- @"type": @"initialDisplay"
40
- });
41
- return;
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] initWithSentryFramesTracker:[[SentryDependencyContainer sharedInstance] framesTracker]
45
- andEventEmitter:emitNewFrameEvent];
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
- if (_fullDisplay || _initialDisplay) {
53
- [_framesListener startListening];
54
- }
54
+ if (_fullDisplay || _initialDisplay) {
55
+ [_framesListener startListening];
56
+ }
55
57
  }
56
58
 
57
59
  @end
@@ -2,7 +2,7 @@
2
2
 
3
3
  #if SENTRY_HAS_UIKIT
4
4
 
5
- #import <Foundation/Foundation.h>
5
+ # import <Foundation/Foundation.h>
6
6
 
7
7
  @interface RNSentryRNSScreen : NSObject
8
8
 
@@ -2,28 +2,28 @@
2
2
 
3
3
  #if SENTRY_HAS_UIKIT
4
4
 
5
- #import <Sentry/SentryFramesTracker.h>
6
- #import <Sentry/SentryDependencyContainer.h>
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
- Class rnsscreenclass = NSClassFromString(@"RNSScreen");
15
- if (rnsscreenclass == nil)
16
- {
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);
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
@@ -6,70 +6,59 @@
6
6
  @implementation RNSentryReplay {
7
7
  }
8
8
 
9
- + (void)updateOptions:(NSMutableDictionary *)options {
10
- NSDictionary *experiments = options[@"_experiments"];
11
- [options removeObjectForKey:@"_experiments"];
12
- if (experiments == nil) {
13
- NSLog(@"Session replay disabled via configuration");
14
- return;
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
- if (experiments[@"replaysSessionSampleRate"] == nil &&
18
- experiments[@"replaysOnErrorSampleRate"] == nil) {
19
- NSLog(@"Session replay disabled via configuration");
20
- return;
21
- }
18
+ if (experiments[@"replaysSessionSampleRate"] == nil
19
+ && experiments[@"replaysOnErrorSampleRate"] == nil) {
20
+ NSLog(@"Session replay disabled via configuration");
21
+ return;
22
+ }
22
23
 
23
- NSLog(@"Setting up session replay");
24
- NSDictionary *replayOptions = options[@"mobileReplayOptions"] ?: @{};
24
+ NSLog(@"Setting up session replay");
25
+ NSDictionary *replayOptions = options[@"mobileReplayOptions"] ?: @{};
25
26
 
26
- [options setValue:@{
27
- @"sessionReplay" : @{
28
- @"sessionSampleRate" : experiments[@"replaysSessionSampleRate"]
29
- ?: [NSNull null],
30
- @"errorSampleRate" : experiments[@"replaysOnErrorSampleRate"]
31
- ?: [NSNull null],
32
- @"redactAllImages" : replayOptions[@"maskAllImages"] ?: [NSNull null],
33
- @"redactAllText" : replayOptions[@"maskAllText"] ?: [NSNull null],
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
- + (void)addReplayRNRedactClasses:(NSDictionary *_Nullable)replayOptions {
42
- NSMutableArray *_Nonnull classesToRedact = [[NSMutableArray alloc] init];
43
- if ([replayOptions[@"maskAllVectors"] boolValue] == YES) {
44
- Class _Nullable maybeRNSVGViewClass = NSClassFromString(@"RNSVGSvgView");
45
- if (maybeRNSVGViewClass != nil) {
46
- [classesToRedact addObject:maybeRNSVGViewClass];
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
- if ([replayOptions[@"maskAllText"] boolValue] == YES) {
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
- Class _Nullable maybeRCTParagraphComponentViewClass = NSClassFromString(@"RCTParagraphComponentView");
61
- if (maybeRCTParagraphComponentViewClass != nil) {
62
- [classesToRedact addObject:maybeRCTParagraphComponentViewClass];
49
+ if ([replayOptions[@"maskAllText"] boolValue] == YES) {
50
+ [classesToRedact addObject:@"RCTTextView"];
51
+ [classesToRedact addObject:@"RCTParagraphComponentView"];
63
52
  }
64
- }
65
- [PrivateSentrySDKOnly addReplayRedactClasses:classesToRedact];
53
+
54
+ return classesToRedact;
66
55
  }
67
56
 
68
- + (void)postInit {
69
- RNSentryReplayBreadcrumbConverter *breadcrumbConverter =
70
- [[RNSentryReplayBreadcrumbConverter alloc] init];
71
- [PrivateSentrySDKOnly configureSessionReplayWith:breadcrumbConverter
72
- screenshotProvider:nil];
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* _Nullable) getTouchPathMessageFrom:(NSArray* _Nullable) path;
10
+ + (NSString *_Nullable)getTouchPathMessageFrom:(NSArray *_Nullable)path;
12
11
 
13
- - (id<SentryRRWebEvent> _Nullable)convertFrom:(SentryBreadcrumb *_Nonnull) breadcrumb;
12
+ - (id<SentryRRWebEvent> _Nullable)convertFrom:(SentryBreadcrumb *_Nonnull)breadcrumb;
14
13
 
15
14
  @end
16
15
  #endif