Skip to content

Commit bfc42d3

Browse files
authored
Merge 0f6f3a8 into 1ae5768
2 parents 1ae5768 + 0f6f3a8 commit bfc42d3

16 files changed

+156
-64
lines changed

Samples/iOS-ObjectiveC/iOS-ObjectiveC/AppDelegate.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#import "AppDelegate.h"
22
@import CoreData;
33
@import Sentry;
4-
54
@interface
65
AppDelegate ()
76

Sentry.xcodeproj/project.pbxproj

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@
812812
D820CDB72BB1895F00BA339D /* SentrySessionReplayIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = D820CDB62BB1895F00BA339D /* SentrySessionReplayIntegration.m */; };
813813
D820CDB82BB1895F00BA339D /* SentrySessionReplayIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = D820CDB52BB1895F00BA339D /* SentrySessionReplayIntegration.h */; };
814814
D8292D7D2A39A027009872F7 /* UrlSanitizedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8292D7C2A39A027009872F7 /* UrlSanitizedTests.swift */; };
815-
D82DD1CD2BEEB1A0001AB556 /* SentryBreadcrumbReplayConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D82DD1CC2BEEB1A0001AB556 /* SentryBreadcrumbReplayConverterTests.swift */; };
815+
D82DD1CD2BEEB1A0001AB556 /* SentrySRDefaultBreadcrumbConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D82DD1CC2BEEB1A0001AB556 /* SentrySRDefaultBreadcrumbConverterTests.swift */; };
816816
D8370B6A273DF1E900F66E2D /* SentryNSURLSessionTaskSearch.m in Sources */ = {isa = PBXBuildFile; fileRef = D8370B68273DF1E900F66E2D /* SentryNSURLSessionTaskSearch.m */; };
817817
D8370B6C273DF20F00F66E2D /* SentryNSURLSessionTaskSearch.h in Headers */ = {isa = PBXBuildFile; fileRef = D8370B6B273DF20F00F66E2D /* SentryNSURLSessionTaskSearch.h */; };
818818
D83D079B2B7F9D1C00CC9674 /* SentryMsgPackSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = D83D07992B7F9D1C00CC9674 /* SentryMsgPackSerializer.h */; };
@@ -881,7 +881,6 @@
881881
D8AFC03D2BDA79BF00118BE1 /* SentryReplayVideoMaker.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8AFC03C2BDA79BF00118BE1 /* SentryReplayVideoMaker.swift */; };
882882
D8AFC0572BDA895400118BE1 /* UIRedactBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8AFC0562BDA895400118BE1 /* UIRedactBuilder.swift */; };
883883
D8AFC05A2BDA89C100118BE1 /* RedactRegionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8AFC0582BDA899A00118BE1 /* RedactRegionTests.swift */; };
884-
D8AFC0622BDBEE4200118BE1 /* SentrySessionReplayIntegration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D8AFC0612BDBEDF100118BE1 /* SentrySessionReplayIntegration+Private.h */; };
885884
D8B0542E2A7D2C720056BAF6 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D8B0542D2A7D2C720056BAF6 /* PrivacyInfo.xcprivacy */; };
886885
D8B088B629C9E3FF00213258 /* SentryTracerConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = D8B088B429C9E3FF00213258 /* SentryTracerConfiguration.h */; };
887886
D8B088B729C9E3FF00213258 /* SentryTracerConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = D8B088B529C9E3FF00213258 /* SentryTracerConfiguration.m */; };
@@ -917,7 +916,7 @@
917916
D8F67AEE2BE0D19200C9197B /* UIImageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F67AED2BE0D19200C9197B /* UIImageHelper.swift */; };
918917
D8F67AF12BE0D33F00C9197B /* UIImageHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F67AEF2BE0D31A00C9197B /* UIImageHelperTests.swift */; };
919918
D8F67AF42BE10F9600C9197B /* UIRedactBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F67AF22BE10F7600C9197B /* UIRedactBuilderTests.swift */; };
920-
D8F67B1B2BE9728600C9197B /* SentryReplayBreadcrumbConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F67B1A2BE9728600C9197B /* SentryReplayBreadcrumbConverter.swift */; };
919+
D8F67B1B2BE9728600C9197B /* SentrySRDefaultBreadcrumbConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F67B1A2BE9728600C9197B /* SentrySRDefaultBreadcrumbConverter.swift */; };
921920
D8F67B222BEAB6CC00C9197B /* SentryRRWebEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F67B212BEAB6CC00C9197B /* SentryRRWebEvent.swift */; };
922921
D8F6A2472885512100320515 /* SentryPredicateDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F6A2452885512100320515 /* SentryPredicateDescriptor.m */; };
923922
D8F6A24B2885515C00320515 /* SentryPredicateDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = D8F6A24A2885515B00320515 /* SentryPredicateDescriptor.h */; };
@@ -1837,6 +1836,7 @@
18371836
D801990F286B089000C277F0 /* SentryCrashReportSinkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashReportSinkTests.swift; sourceTree = "<group>"; };
18381837
D802994D2BA836EF000F0081 /* SentryOnDemandReplay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryOnDemandReplay.swift; sourceTree = "<group>"; };
18391838
D802994F2BA83A88000F0081 /* SentryPixelBuffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryPixelBuffer.swift; sourceTree = "<group>"; };
1839+
D80382BE2C09C6FD0090E048 /* SentrySessionReplayIntegration-Hybrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentrySessionReplayIntegration-Hybrid.h"; path = "include/HybridPublic/SentrySessionReplayIntegration-Hybrid.h"; sourceTree = "<group>"; };
18401840
D80694C22B7CC86E00B820E6 /* SentryReplayEventTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryReplayEventTests.swift; sourceTree = "<group>"; };
18411841
D80694C52B7CCFA100B820E6 /* SentryReplayRecordingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryReplayRecordingTests.swift; sourceTree = "<group>"; };
18421842
D80694CB2B7E0A3E00B820E6 /* SentryReplayType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryReplayType.h; path = include/SentryReplayType.h; sourceTree = "<group>"; };
@@ -1868,7 +1868,7 @@
18681868
D820CDB62BB1895F00BA339D /* SentrySessionReplayIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySessionReplayIntegration.m; sourceTree = "<group>"; };
18691869
D8292D7A2A38AF04009872F7 /* HTTPHeaderSanitizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPHeaderSanitizer.swift; sourceTree = "<group>"; };
18701870
D8292D7C2A39A027009872F7 /* UrlSanitizedTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UrlSanitizedTests.swift; sourceTree = "<group>"; };
1871-
D82DD1CC2BEEB1A0001AB556 /* SentryBreadcrumbReplayConverterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryBreadcrumbReplayConverterTests.swift; sourceTree = "<group>"; };
1871+
D82DD1CC2BEEB1A0001AB556 /* SentrySRDefaultBreadcrumbConverterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySRDefaultBreadcrumbConverterTests.swift; sourceTree = "<group>"; };
18721872
D8370B68273DF1E900F66E2D /* SentryNSURLSessionTaskSearch.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryNSURLSessionTaskSearch.m; sourceTree = "<group>"; };
18731873
D8370B6B273DF20F00F66E2D /* SentryNSURLSessionTaskSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryNSURLSessionTaskSearch.h; path = include/SentryNSURLSessionTaskSearch.h; sourceTree = "<group>"; };
18741874
D83D07992B7F9D1C00CC9674 /* SentryMsgPackSerializer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryMsgPackSerializer.h; path = include/SentryMsgPackSerializer.h; sourceTree = "<group>"; };
@@ -1984,7 +1984,7 @@
19841984
D8F67AED2BE0D19200C9197B /* UIImageHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIImageHelper.swift; sourceTree = "<group>"; };
19851985
D8F67AEF2BE0D31A00C9197B /* UIImageHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIImageHelperTests.swift; sourceTree = "<group>"; };
19861986
D8F67AF22BE10F7600C9197B /* UIRedactBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIRedactBuilderTests.swift; sourceTree = "<group>"; };
1987-
D8F67B1A2BE9728600C9197B /* SentryReplayBreadcrumbConverter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryReplayBreadcrumbConverter.swift; sourceTree = "<group>"; };
1987+
D8F67B1A2BE9728600C9197B /* SentrySRDefaultBreadcrumbConverter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySRDefaultBreadcrumbConverter.swift; sourceTree = "<group>"; };
19881988
D8F67B212BEAB6CC00C9197B /* SentryRRWebEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryRRWebEvent.swift; sourceTree = "<group>"; };
19891989
D8F6A2452885512100320515 /* SentryPredicateDescriptor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryPredicateDescriptor.m; sourceTree = "<group>"; };
19901990
D8F6A24A2885515B00320515 /* SentryPredicateDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryPredicateDescriptor.h; path = include/SentryPredicateDescriptor.h; sourceTree = "<group>"; };
@@ -3589,6 +3589,7 @@
35893589
D86130112BB563FD004C0F5E /* SentrySessionReplayIntegrationTests.swift */,
35903590
D861301B2BB5A267004C0F5E /* SentrySessionReplayTests.swift */,
35913591
D8AFC0002BD252B900118BE1 /* SentryOnDemandReplayTests.swift */,
3592+
D82DD1CC2BEEB1A0001AB556 /* SentrySRDefaultBreadcrumbConverterTests.swift */,
35923593
D82DD1CC2BEEB1A0001AB556 /* SentryBreadcrumbReplayConverterTests.swift */,
35933594
D8DBE0D12C0EFFC300FAB1FD /* SentryReplayOptionsTests.swift */,
35943595
);
@@ -3616,6 +3617,7 @@
36163617
D820CDB52BB1895F00BA339D /* SentrySessionReplayIntegration.h */,
36173618
D8AFC0612BDBEDF100118BE1 /* SentrySessionReplayIntegration+Private.h */,
36183619
D820CDB62BB1895F00BA339D /* SentrySessionReplayIntegration.m */,
3620+
D80382BE2C09C6FD0090E048 /* SentrySessionReplayIntegration-Hybrid.h */,
36193621
);
36203622
name = SessionReplay;
36213623
sourceTree = "<group>";
@@ -3859,7 +3861,7 @@
38593861
D802994D2BA836EF000F0081 /* SentryOnDemandReplay.swift */,
38603862
D802994F2BA83A88000F0081 /* SentryPixelBuffer.swift */,
38613863
D8AFC03C2BDA79BF00118BE1 /* SentryReplayVideoMaker.swift */,
3862-
D8F67B1A2BE9728600C9197B /* SentryReplayBreadcrumbConverter.swift */,
3864+
D8F67B1A2BE9728600C9197B /* SentrySRDefaultBreadcrumbConverter.swift */,
38633865
D81988BF2BEBFFF70020E36C /* SentryReplayRecording.swift */,
38643866
);
38653867
path = SessionReplay;
@@ -4058,7 +4060,6 @@
40584060
6383953623ABA42C000C1594 /* SentryHttpTransport.h in Headers */,
40594061
84A8891C28DBD28900C51DFD /* SentryDevice.h in Headers */,
40604062
8E564AEF267AF24400FE117D /* SentryNetworkTracker.h in Headers */,
4061-
D8AFC0622BDBEE4200118BE1 /* SentrySessionReplayIntegration+Private.h in Headers */,
40624063
63FE715120DA4C1100CDBAE8 /* SentryCrashDebug.h in Headers */,
40634064
63FE70F520DA4C1000CDBAE8 /* SentryCrashMonitor_System.h in Headers */,
40644065
7B31C291277B04A000337126 /* SentryCrashPlatformSpecificDefines.h in Headers */,
@@ -4716,7 +4717,7 @@
47164717
D81988C72BEC18E20020E36C /* SentryRRWebVideoEvent.swift in Sources */,
47174718
621F61F12BEA073A005E654F /* SentryEnabledFeaturesBuilder.swift in Sources */,
47184719
D88817D826D7149100BF2251 /* SentryTraceContext.m in Sources */,
4719-
D8F67B1B2BE9728600C9197B /* SentryReplayBreadcrumbConverter.swift in Sources */,
4720+
D8F67B1B2BE9728600C9197B /* SentrySRDefaultBreadcrumbConverter.swift in Sources */,
47204721
8EBF870926140D37001A6853 /* SentryPerformanceTracker.m in Sources */,
47214722
D80CD8D02B75143F002F710B /* UrlSanitized.swift in Sources */,
47224723
D8F016B32B9622D6007B9AFB /* SentryId.swift in Sources */,
@@ -4981,7 +4982,7 @@
49814982
62B86CFC29F052BB008F3947 /* SentryTestLogConfig.m in Sources */,
49824983
D808FB92281BF6EC009A2A33 /* SentryUIEventTrackingIntegrationTests.swift in Sources */,
49834984
7BC6EC04255C235F0059822A /* SentryFrameTests.swift in Sources */,
4984-
D82DD1CD2BEEB1A0001AB556 /* SentryBreadcrumbReplayConverterTests.swift in Sources */,
4985+
D82DD1CD2BEEB1A0001AB556 /* SentrySRDefaultBreadcrumbConverterTests.swift in Sources */,
49854986
0AE455AD28F584D2006680E5 /* SentryReachabilityTests.m in Sources */,
49864987
63FE720420DA66EC00CDBAE8 /* SentryCrashString_Tests.m in Sources */,
49874988
62872B632BA1B86100A4FA7D /* NSLockTests.swift in Sources */,

Sources/Sentry/PrivateSentrySDKOnly.mm

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#import "SentryOptions.h"
1212
#import "SentrySDK+Private.h"
1313
#import "SentrySerialization.h"
14+
#import "SentrySessionReplayIntegration.h"
1415
#import "SentrySwift.h"
1516
#import "SentryThreadHandle.hpp"
1617
#import "SentryUser+Private.h"
@@ -307,18 +308,16 @@ + (SentryBreadcrumb *)breadcrumbWithDictionary:(NSDictionary *)dictionary
307308
+ (void)captureReplay
308309
{
309310
#if SENTRY_HAS_UIKIT && !TARGET_OS_VISION
310-
if (@available(iOS 16.0, *)) {
311-
NSArray *integrations = [[SentrySDK currentHub] installedIntegrations];
312-
SentrySessionReplayIntegration *replayIntegration;
313-
for (id obj in integrations) {
314-
if ([obj isKindOfClass:[SentrySessionReplayIntegration class]]) {
315-
replayIntegration = obj;
316-
break;
317-
}
311+
NSArray *integrations = [[SentrySDK currentHub] installedIntegrations];
312+
SentrySessionReplayIntegration *replayIntegration;
313+
for (id obj in integrations) {
314+
if ([obj isKindOfClass:[SentrySessionReplayIntegration class]]) {
315+
replayIntegration = obj;
316+
break;
318317
}
319-
320-
[replayIntegration captureReplay];
321318
}
319+
320+
[replayIntegration captureReplay];
322321
#else
323322
SENTRY_LOG_DEBUG(
324323
@"PrivateSentrySDKOnly.captureReplay only works with UIKit enabled and target is "
@@ -338,11 +337,7 @@ + (NSString *__nullable)getReplayId
338337
+ (void)addReplayIgnoreClasses:(NSArray<Class> *_Nonnull)classes
339338
{
340339
#if SENTRY_HAS_UIKIT && !TARGET_OS_VISION
341-
if (@available(iOS 16.0, tvOS 16.0, *)) {
342-
[SentryViewPhotographer.shared addIgnoreClasses:classes];
343-
} else {
344-
SENTRY_LOG_DEBUG(@"PrivateSentrySDKOnly.addIgnoreClasses only works with iOS 16 and newer");
345-
}
340+
[SentryViewPhotographer.shared addIgnoreClasses:classes];
346341
#else
347342
SENTRY_LOG_DEBUG(
348343
@"PrivateSentrySDKOnly.addReplayIgnoreClasses only works with UIKit enabled and target is "
@@ -353,12 +348,29 @@ + (void)addReplayIgnoreClasses:(NSArray<Class> *_Nonnull)classes
353348
+ (void)addReplayRedactClasses:(NSArray<Class> *_Nonnull)classes
354349
{
355350
#if SENTRY_HAS_UIKIT && !TARGET_OS_VISION
356-
if (@available(iOS 16.0, tvOS 16.0, *)) {
357-
[SentryViewPhotographer.shared addRedactClasses:classes];
358-
} else {
359-
SENTRY_LOG_DEBUG(
360-
@"PrivateSentrySDKOnly.addReplayRedactClasses only works with iOS 16 and newer");
351+
[SentryViewPhotographer.shared addRedactClasses:classes];
352+
#else
353+
SENTRY_LOG_DEBUG(
354+
@"PrivateSentrySDKOnly.addReplayRedactClasses only works with UIKit enabled and target is "
355+
@"not visionOS. Ensure you're using the right configuration of Sentry that links UIKit.");
356+
#endif
357+
}
358+
359+
+ (void)configureSessionReplayWith:(nullable id<SentryReplayBreadcrumbConverter>)breadcrumbConverter
360+
screenshotProvider:(nullable id<SentryViewScreenshotProvider>)screenshotProvider
361+
{
362+
#if SENTRY_HAS_UIKIT && !TARGET_OS_VISION
363+
NSArray *integrations = [[SentrySDK currentHub] installedIntegrations];
364+
SentrySessionReplayIntegration *replayIntegration;
365+
for (id obj in integrations) {
366+
if ([obj isKindOfClass:[SentrySessionReplayIntegration class]]) {
367+
replayIntegration = obj;
368+
break;
369+
}
361370
}
371+
372+
[replayIntegration configureReplayWith:breadcrumbConverter
373+
screenshotProvider:screenshotProvider];
362374
#else
363375
SENTRY_LOG_DEBUG(
364376
@"PrivateSentrySDKOnly.addReplayRedactClasses only works with UIKit enabled and target is "

Sources/Sentry/SentrySessionReplay.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,16 @@ @implementation SentrySessionReplay {
3939
SentryDisplayLinkWrapper *_displayLink;
4040
SentryCurrentDateProvider *_dateProvider;
4141
id<SentryRandom> _sentryRandom;
42-
id<SentryViewScreenshotProvider> _screenshotProvider;
4342
int _currentSegmentId;
4443
BOOL _processingScreenshot;
4544
BOOL _reachedMaximumDuration;
46-
SentryReplayBreadcrumbConverter *_breadcrumbConverter;
4745
}
4846

4947
- (instancetype)initWithSettings:(SentryReplayOptions *)replayOptions
5048
replayFolderPath:(NSURL *)folderPath
5149
screenshotProvider:(id<SentryViewScreenshotProvider>)screenshotProvider
5250
replayMaker:(id<SentryReplayVideoMaker>)replayMaker
51+
breadcrumbConverter:(id<SentryReplayBreadcrumbConverter>)breadcrumbConverter
5352
dateProvider:(SentryCurrentDateProvider *)dateProvider
5453
random:(id<SentryRandom>)random
5554
displayLinkWrapper:(SentryDisplayLinkWrapper *)displayLinkWrapper;
@@ -64,7 +63,7 @@ - (instancetype)initWithSettings:(SentryReplayOptions *)replayOptions
6463
_urlToCache = folderPath;
6564
_replayMaker = replayMaker;
6665
_reachedMaximumDuration = NO;
67-
_breadcrumbConverter = [[SentryReplayBreadcrumbConverter alloc] init];
66+
_breadcrumbConverter = breadcrumbConverter;
6867
}
6968
return self;
7069
}

Sources/Sentry/SentrySessionReplayIntegration.m

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ - (void)newSceneActivate
7373

7474
- (void)startWithOptions:(SentryReplayOptions *)replayOptions
7575
fullSession:(BOOL)shouldReplayFullSession
76+
{
77+
[self startWithOptions:replayOptions
78+
screenshotProvider:SentryViewPhotographer.shared
79+
breadcrumbConverter:[[SentrySRDefaultBreadcrumbConverter alloc] init]
80+
fullSession:shouldReplayFullSession];
81+
}
82+
83+
- (void)startWithOptions:(SentryReplayOptions *)replayOptions
84+
screenshotProvider:(id<SentryViewScreenshotProvider>)screenshotProvider
85+
breadcrumbConverter:(id<SentryReplayBreadcrumbConverter>)breadcrumbConverter
86+
fullSession:(BOOL)shouldReplayFullSession
7687
{
7788
if (@available(iOS 16.0, tvOS 16.0, *)) {
7889
NSURL *docs = [NSURL
@@ -96,14 +107,14 @@ - (void)startWithOptions:(SentryReplayOptions *)replayOptions
96107
: replayOptions.errorReplayDuration);
97108

98109
self.sessionReplay = [[SentrySessionReplay alloc]
99-
initWithSettings:replayOptions
100-
replayFolderPath:docs
101-
screenshotProvider:SentryViewPhotographer.shared
102-
replayMaker:replayMaker
103-
dateProvider:SentryDependencyContainer.sharedInstance.dateProvider
104-
random:SentryDependencyContainer.sharedInstance.random
105-
106-
displayLinkWrapper:[[SentryDisplayLinkWrapper alloc] init]];
110+
initWithSettings:replayOptions
111+
replayFolderPath:docs
112+
screenshotProvider:screenshotProvider
113+
replayMaker:replayMaker
114+
breadcrumbConverter:breadcrumbConverter
115+
dateProvider:SentryDependencyContainer.sharedInstance.dateProvider
116+
random:SentryDependencyContainer.sharedInstance.random
117+
displayLinkWrapper:[[SentryDisplayLinkWrapper alloc] init]];
107118

108119
[self.sessionReplay
109120
start:SentryDependencyContainer.sharedInstance.application.windows.firstObject
@@ -132,6 +143,18 @@ - (void)captureReplay
132143
[self.sessionReplay captureReplay];
133144
}
134145

146+
- (void)configureReplayWith:(nullable id<SentryReplayBreadcrumbConverter>)breadcrumbConverter
147+
screenshotProvider:(nullable id<SentryViewScreenshotProvider>)screenshotProvider
148+
{
149+
if (breadcrumbConverter) {
150+
self.sessionReplay.breadcrumbConverter = breadcrumbConverter;
151+
}
152+
153+
if (screenshotProvider) {
154+
self.sessionReplay.screenshotProvider = screenshotProvider;
155+
}
156+
}
157+
135158
- (SentryIntegrationOption)integrationOptions
136159
{
137160
return kIntegrationOptionEnableReplay;

0 commit comments

Comments
 (0)