File tree Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ is_new_arch_enabled = ENV["RCT_NEW_ARCH_ENABLED"] == "1"
1414is_using_hermes = ( ENV [ 'USE_HERMES' ] == nil && is_hermes_default ) || ENV [ 'USE_HERMES' ] == '1'
1515new_arch_enabled_flag = ( is_new_arch_enabled ? folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED" : "" )
1616sentry_profiling_supported_flag = ( is_profiling_supported ? " -DSENTRY_PROFILING_SUPPORTED=1" : "" )
17- other_cflags = "$(inherited)" + new_arch_enabled_flag + sentry_profiling_supported_flag
17+ other_cflags = "$(inherited) -fcxx-modules -fmodules " + new_arch_enabled_flag + sentry_profiling_supported_flag
1818
1919Pod ::Spec . new do |s |
2020 s . name = 'RNSentry'
Original file line number Diff line number Diff line change 3636
3737#import " RNSentryEvents.h"
3838#import " RNSentryDependencyContainer.h"
39+ #import " RNSentryBreadcrumbConverter.h"
3940
4041#if SENTRY_HAS_UIKIT
4142#import " RNSentryRNSScreen.h"
@@ -90,6 +91,9 @@ + (BOOL)requiresMainQueueSetup {
9091
9192 [SentrySDK startWithOptions: sentryOptions];
9293
94+ RNSentryBreadcrumbConverter* breadcrumbConverter = [[RNSentryBreadcrumbConverter alloc ] init ];
95+ [PrivateSentrySDKOnly configureSessionReplayWith: breadcrumbConverter screenshotProvider: nil ];
96+
9397#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
9498 BOOL appIsActive = [[UIApplication sharedApplication ] applicationState ] == UIApplicationStateActive;
9599#else
Original file line number Diff line number Diff line change 1+ @import Sentry;
2+
3+ @class SentryRRWebEvent;
4+
5+ @interface RNSentryBreadcrumbConverter
6+ : NSObject <SentryReplayBreadcrumbConverter>
7+
8+ - (NSArray <SentryRRWebEvent *> *_Nonnull)
9+ convertWithBreadcrumbs:(NSArray <SentryBreadcrumb *> *_Nonnull)breadcrumbs
10+ from : (NSDate *_Nonnull)from
11+ until : (NSDate *_Nonnull)until ;
12+
13+ @end
Original file line number Diff line number Diff line change 1+ #import " RNSentryBreadcrumbConverter.h"
2+
3+ @implementation RNSentryBreadcrumbConverter {
4+ }
5+
6+ - (NSArray <SentryRRWebEvent *> *_Nonnull)
7+ convertWithBreadcrumbs:(NSArray <SentryBreadcrumb *> *_Nonnull)breadcrumbs
8+ from : (NSDate *_Nonnull)from
9+ until : (NSDate *_Nonnull)until {
10+ NSMutableArray <SentryRRWebEvent *> *outBreadcrumbs = [NSMutableArray array ];
11+ for (SentryBreadcrumb *breadcrumb in breadcrumbs) {
12+ if (breadcrumb.timestamp &&
13+ [breadcrumb.timestamp compare: from] != NSOrderedAscending &&
14+ [breadcrumb.timestamp compare: until] != NSOrderedDescending) {
15+ if ([breadcrumb.category isEqualToString: @" touch" ]) {
16+ SentryRRWebBreadcrumbEvent *rrwebBreadcrumb =
17+ [[SentryRRWebBreadcrumbEvent alloc ]
18+ initWithTimestamp: breadcrumb.timestamp
19+ category: @" ui.tap"
20+ message: breadcrumb.data ? [breadcrumb.data valueForKey: @" target" ] : nil
21+ level: breadcrumb.level
22+ data: breadcrumb.data];
23+ [outBreadcrumbs addObject: rrwebBreadcrumb];
24+ } else {
25+ // TODO delegate to the default breadcrumb converter
26+ }
27+ }
28+ }
29+ return outBreadcrumbs;
30+ }
31+
32+ @end
You can’t perform that action at this time.
0 commit comments