Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@
D4CD2A802DE9F91900DA9F59 /* SentryRedactRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4CD2A7C2DE9F91900DA9F59 /* SentryRedactRegion.swift */; };
D4CD2A812DE9F91900DA9F59 /* SentryRedactRegionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4CD2A7D2DE9F91900DA9F59 /* SentryRedactRegionType.swift */; };
D4D12E7A2DFC608800DC45C4 /* SentryScreenshotOptionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D12E792DFC607F00DC45C4 /* SentryScreenshotOptionsTests.swift */; };
D4D849792E82E2240086BF67 /* SentryReplayApiTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D849782E82E21F0086BF67 /* SentryReplayApiTests.swift */; };
D4DEE6592E439B2E00FCA5A9 /* SentryProfileTimeseriesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D4DEE6582E439B2E00FCA5A9 /* SentryProfileTimeseriesTests.m */; };
D4E3F35D2D4A864600F79E2B /* SentryNSDictionarySanitizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D42E48582D48FC8F00D251BC /* SentryNSDictionarySanitizeTests.swift */; };
D4E3F35E2D4A877300F79E2B /* SentryNSDictionarySanitize+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = D41909942D490006002B83D0 /* SentryNSDictionarySanitize+Tests.m */; };
Expand Down Expand Up @@ -1110,16 +1111,16 @@
FACEED132E3179A10007B4AC /* SentyOptionsInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = FACEED122E3179A10007B4AC /* SentyOptionsInternal.m */; };
FAE2DAB82E1F317900262307 /* SentryProfilingSwiftHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = FAE2DAB72E1F317900262307 /* SentryProfilingSwiftHelpers.m */; };
FAE2DABA2E1F318900262307 /* SentryProfilingSwiftHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE2DAB92E1F318900262307 /* SentryProfilingSwiftHelpers.h */; };
FAE579842E7CF21800B710F9 /* SentryMigrateSessionInit.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE5797E2E7CF21300B710F9 /* SentryMigrateSessionInit.swift */; };
FAE5798D2E7D9D4C00B710F9 /* SentrySysctl.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE579872E7D9D4900B710F9 /* SentrySysctl.swift */; };
FAE579BA2E7DBE9900B710F9 /* SentryGlobalEventProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE579B42E7DBE9400B710F9 /* SentryGlobalEventProcessor.swift */; };
FAE579C22E7DDDE700B710F9 /* SentryThreadWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE579BC2E7DDDE400B710F9 /* SentryThreadWrapper.swift */; };
FAE579842E7CF21800B710F9 /* SentryMigrateSessionInit.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE5797E2E7CF21300B710F9 /* SentryMigrateSessionInit.swift */; };
FAE579CC2E7DE14900B710F9 /* SentryFrameRemover.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE579C62E7DE14400B710F9 /* SentryFrameRemover.swift */; };
FAE80C242E4695B40010A595 /* SentryEvent+Serialize.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE80C232E4695AE0010A595 /* SentryEvent+Serialize.h */; };
FAEC270E2DF3526000878871 /* SentryUserFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */; };
FAEC273D2DF3933A00878871 /* NSData+Unzip.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEC273C2DF3933200878871 /* NSData+Unzip.m */; };
FAEEC0522E75E55F00E79CA9 /* SentrySerializationSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEEC04C2E75E55A00E79CA9 /* SentrySerializationSwift.swift */; };
FAEEBFE22E736D4B00E79CA9 /* SentryViewHierarchyProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEEBFDC2E736D4100E79CA9 /* SentryViewHierarchyProvider.swift */; };
FAEEC0522E75E55F00E79CA9 /* SentrySerializationSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEEC04C2E75E55A00E79CA9 /* SentrySerializationSwift.swift */; };
FAEFA12F2E4FAE1900C431D9 /* SentrySDKSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEFA1292E4FAE1700C431D9 /* SentrySDKSettings.swift */; };
FAF120182E70C08F006E1DA3 /* SentryEnvelopeHeaderHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF120122E70C088006E1DA3 /* SentryEnvelopeHeaderHelper.h */; };
FAF1201A2E70C0EE006E1DA3 /* SentryEnvelopeHeaderHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FAF120192E70C0EA006E1DA3 /* SentryEnvelopeHeaderHelper.m */; };
Expand Down Expand Up @@ -2170,6 +2171,7 @@
D4CD2A7C2DE9F91900DA9F59 /* SentryRedactRegion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryRedactRegion.swift; sourceTree = "<group>"; };
D4CD2A7D2DE9F91900DA9F59 /* SentryRedactRegionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryRedactRegionType.swift; sourceTree = "<group>"; };
D4D12E792DFC607F00DC45C4 /* SentryScreenshotOptionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScreenshotOptionsTests.swift; sourceTree = "<group>"; };
D4D849782E82E21F0086BF67 /* SentryReplayApiTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryReplayApiTests.swift; sourceTree = "<group>"; };
D4DEE6582E439B2E00FCA5A9 /* SentryProfileTimeseriesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryProfileTimeseriesTests.m; sourceTree = "<group>"; };
D4ECA3FF2E3CBEDE00C757EA /* SentryDummyPrivateEmptyClass.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDummyPrivateEmptyClass.m; sourceTree = "<group>"; };
D4ECA4002E3CBEDE00C757EA /* SentryDummyPublicEmptyClass.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDummyPublicEmptyClass.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2463,8 +2465,8 @@
FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUserFeedback.swift; sourceTree = "<group>"; };
FAEC273C2DF3933200878871 /* NSData+Unzip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+Unzip.m"; sourceTree = "<group>"; };
FAEC273E2DF393E000878871 /* NSData+Unzip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+Unzip.h"; sourceTree = "<group>"; };
FAEEC04C2E75E55A00E79CA9 /* SentrySerializationSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySerializationSwift.swift; sourceTree = "<group>"; };
FAEEBFDC2E736D4100E79CA9 /* SentryViewHierarchyProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewHierarchyProvider.swift; sourceTree = "<group>"; };
FAEEC04C2E75E55A00E79CA9 /* SentrySerializationSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySerializationSwift.swift; sourceTree = "<group>"; };
FAEFA1292E4FAE1700C431D9 /* SentrySDKSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySDKSettings.swift; sourceTree = "<group>"; };
FAF120122E70C088006E1DA3 /* SentryEnvelopeHeaderHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryEnvelopeHeaderHelper.h; path = include/SentryEnvelopeHeaderHelper.h; sourceTree = "<group>"; };
FAF120192E70C0EA006E1DA3 /* SentryEnvelopeHeaderHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryEnvelopeHeaderHelper.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4343,6 +4345,7 @@
D80694C12B7CC85800B820E6 /* SessionReplay */ = {
isa = PBXGroup;
children = (
D4D849782E82E21F0086BF67 /* SentryReplayApiTests.swift */,
D49480D22DC23E8E00A3B6E9 /* SentryReplayTypeTests.swift */,
D80694C22B7CC86E00B820E6 /* SentryReplayEventTests.swift */,
D80694C52B7CCFA100B820E6 /* SentryReplayRecordingTests.swift */,
Expand Down Expand Up @@ -6130,6 +6133,7 @@
623FD9062D3FA9C800803EDA /* NSNumberDecodableWrapperTests.swift in Sources */,
7B87C916295ECFD700510C52 /* SentryMetricKitEventTests.swift in Sources */,
7B6D98ED24C703F8005502FA /* Async.swift in Sources */,
D4D849792E82E2240086BF67 /* SentryReplayApiTests.swift in Sources */,
7BA0C04C28056556003E0326 /* SentryTransportAdapterTests.swift in Sources */,
7BE0DC29272A9E1C004FA8B7 /* SentryBreadcrumbTrackerTests.swift in Sources */,
D4FC681A2DD63465001B74FF /* SentryDispatchQueueWrapperTests.m in Sources */,
Expand Down
61 changes: 52 additions & 9 deletions Sources/Sentry/Public/SentryReplayApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,74 @@
NS_ASSUME_NONNULL_BEGIN

@interface SentryReplayApi : NSObject
SENTRY_NO_INIT

/**
* Marks this view to be masked during replays.
*
* When this method is called, the specified view will be masked (redacted) in session replays
* to protect sensitive information. The view's content will appear as a solid rectangle in
* the replay instead of showing the actual content.
*
* @param view The UIView to mask in session replays.
*
* @note This method is thread-safe and can be called from any thread.
*/
- (void)maskView:(UIView *)view NS_SWIFT_NAME(maskView(_:));

/**
* Marks this view to not be masked during redact step of session replay.
*
* When this method is called, the specified view will be excluded from masking during session
* replays, even if it would normally be masked based on the replay configuration. This allows
* specific views to remain visible in replays when they contain non-sensitive information.
*
* @param view The UIView to exclude from masking in session replays.
*
* @note This method is thread-safe and can be called from any thread.
*/
- (void)unmaskView:(UIView *)view NS_SWIFT_NAME(unmaskView(_:));

/**
* Pauses the replay.
*
* Temporarily stops recording frames for the session replay. The replay can be resumed
* later by calling resume. This is useful for temporarily suspending replay recording
* during sensitive operations or when the app goes into the background.
*
* @note This method is thread-safe and can be called from any thread.
*/
- (void)pause;

/**
* Resumes the ongoing replay.
*
* Resumes recording frames for the session replay after it was paused. If no replay
* session is currently active, this method has no effect.
*
* @note This method is thread-safe and can be called from any thread.
*/
- (void)resume;

/**
* Start recording a session replay if not started.
*
* Manually starts a session replay recording. If session replay is already running,
* this method has no effect. This is useful for manually controlling when replay
* recording begins, independent of the automatic session management.
*
* @note This method is thread-safe and can be called from any thread.
*/
- (void)start;

/**
* Stop the current session replay recording.
*
* Permanently stops the current session replay recording and clears any cached frames.
* To restart recording, you must call start again. This is useful for completely
* terminating replay functionality.
*
* @note This method is thread-safe and can be called from any thread.
*/
- (void)stop;

Expand All @@ -49,13 +89,13 @@ NS_ASSUME_NONNULL_BEGIN
*
* By calling this function an overlay will appear covering the parts
* of the app that will be masked for the session replay.
* This will only work if the debbuger is attached and it will
* This will only work if the debugger is attached and it will
* cause some slow frames.
*
* @note This method must be called from the main thread.
* @note This method is thread-safe and can be called from any thread.
*
* @warning This is an experimental feature and may still have bugs.
* Do not use this is production.
* Do not use this in production.
*/
- (void)showMaskPreview;

Expand All @@ -64,25 +104,28 @@ NS_ASSUME_NONNULL_BEGIN
*
* By calling this function an overlay will appear covering the parts
* of the app that will be masked for the session replay.
* This will only work if the debbuger is attached and it will
* This will only work if the debugger is attached and it will
* cause some slow frames.
*
* @param opacity The opacity of the overlay.
* @param opacity The opacity of the overlay (0.0 to 1.0).
*
* @note This method must be called from the main thread.
* @note This method is thread-safe and can be called from any thread.
*
* @warning This is an experimental feature and may still have bugs.
* Do not use this is production.
* Do not use this in production.
*/
- (void)showMaskPreview:(CGFloat)opacity;

/**
* Removes the overlay that shows replay masking.
*
* @note This method must be called from the main thread.
* Hides the mask preview overlay that was previously shown by calling showMaskPreview.
* If no overlay is currently displayed, this method has no effect.
*
* @note This method is thread-safe and can be called from any thread.
*
* @warning This is an experimental feature and may still have bugs.
* Do not use this is production.
* Do not use this in production.
*/
- (void)hideMaskPreview;

Expand Down
Loading
Loading