-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(replay): Add SentryMask and SentryUnmask iOS components (#4224)
- Loading branch information
1 parent
077ecb1
commit 07257af
Showing
25 changed files
with
477 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayPostInitTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Sentry | ||
import XCTest | ||
|
||
final class RNSentryReplayPostInitTests: XCTestCase { | ||
|
||
func testMask() { | ||
XCTAssertEqual(ObjectIdentifier(RNSentryReplay.getMaskClass()), ObjectIdentifier(RNSentryReplayMask.self)) | ||
} | ||
|
||
func testUnmask() { | ||
XCTAssertEqual(ObjectIdentifier(RNSentryReplay.getUnmaskClass()), ObjectIdentifier(RNSentryReplayUnmask.self)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,8 @@ | |
|
||
+ (void)postInit; | ||
|
||
+ (Class)getMaskClass; | ||
|
||
+ (Class)getUnmaskClass; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#import <Sentry/SentryDefines.h> | ||
|
||
@interface RNSentryReplayBreadcrumbConverterHelper : NSObject | ||
|
||
+ (void)configureSessionReplayWithConverter; | ||
|
||
@end |
17 changes: 17 additions & 0 deletions
17
packages/core/ios/RNSentryReplayBreadcrumbConverterHelper.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#import "RNSentryReplayBreadcrumbConverterHelper.h" | ||
|
||
#if SENTRY_TARGET_REPLAY_SUPPORTED | ||
# import "RNSentryReplayBreadcrumbConverter.h" | ||
|
||
@implementation RNSentryReplayBreadcrumbConverterHelper | ||
|
||
+ (void)configureSessionReplayWithConverter | ||
{ | ||
RNSentryReplayBreadcrumbConverter *breadcrumbConverter = | ||
[[RNSentryReplayBreadcrumbConverter alloc] init]; | ||
[PrivateSentrySDKOnly configureSessionReplayWith:breadcrumbConverter screenshotProvider:nil]; | ||
} | ||
|
||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#import <Sentry/SentryDefines.h> | ||
|
||
#if SENTRY_HAS_UIKIT | ||
|
||
# import <React/RCTViewManager.h> | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
# import <React/RCTViewComponentView.h> | ||
# else | ||
# import <React/RCTView.h> | ||
# endif | ||
|
||
@interface RNSentryReplayMaskManager : RCTViewManager | ||
@end | ||
|
||
@interface RNSentryReplayMask : | ||
# ifdef RCT_NEW_ARCH_ENABLED | ||
RCTViewComponentView | ||
# else | ||
RCTView | ||
# endif | ||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#import <Sentry/SentryDefines.h> | ||
|
||
#if SENTRY_HAS_UIKIT | ||
|
||
# import "RNSentryReplayMask.h" | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
# import <react/renderer/components/RNSentrySpec/ComponentDescriptors.h> | ||
# import <react/renderer/components/RNSentrySpec/RCTComponentViewHelpers.h> | ||
// RCTFabricComponentsPlugins needed for RNSentryReplayMaskCls | ||
# import <React/RCTFabricComponentsPlugins.h> | ||
# endif | ||
|
||
@implementation RNSentryReplayMaskManager | ||
|
||
RCT_EXPORT_MODULE(RNSentryReplayMask) | ||
|
||
- (UIView *)view | ||
{ | ||
return [RNSentryReplayMask new]; | ||
} | ||
|
||
@end | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
@interface | ||
RNSentryReplayMask () <RCTRNSentryReplayMaskViewProtocol> | ||
@end | ||
# endif | ||
|
||
@implementation RNSentryReplayMask | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider | ||
{ | ||
return facebook::react::concreteComponentDescriptorProvider< | ||
facebook::react::RNSentryReplayMaskComponentDescriptor>(); | ||
} | ||
# endif | ||
|
||
@end | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
Class<RCTComponentViewProtocol> | ||
RNSentryReplayMaskCls(void) | ||
{ | ||
return RNSentryReplayMask.class; | ||
} | ||
# endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#import <Sentry/SentryDefines.h> | ||
|
||
#if SENTRY_HAS_UIKIT | ||
|
||
# import <React/RCTViewManager.h> | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
# import <React/RCTViewComponentView.h> | ||
# else | ||
# import <React/RCTView.h> | ||
# endif | ||
|
||
@interface RNSentryReplayUnmaskManager : RCTViewManager | ||
@end | ||
|
||
@interface RNSentryReplayUnmask : | ||
# ifdef RCT_NEW_ARCH_ENABLED | ||
RCTViewComponentView | ||
# else | ||
RCTView | ||
# endif | ||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#import <Sentry/SentryDefines.h> | ||
|
||
#if SENTRY_HAS_UIKIT | ||
|
||
# import "RNSentryReplayUnmask.h" | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
# import <react/renderer/components/RNSentrySpec/ComponentDescriptors.h> | ||
# import <react/renderer/components/RNSentrySpec/RCTComponentViewHelpers.h> | ||
// RCTFabricComponentsPlugins needed for RNSentryReplayUnmaskCls | ||
# import <React/RCTFabricComponentsPlugins.h> | ||
# endif | ||
|
||
@implementation RNSentryReplayUnmaskManager | ||
|
||
RCT_EXPORT_MODULE(RNSentryReplayUnmask) | ||
|
||
- (UIView *)view | ||
{ | ||
return [RNSentryReplayUnmask new]; | ||
} | ||
|
||
@end | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
@interface | ||
RNSentryReplayUnmask () <RCTRNSentryReplayUnmaskViewProtocol> | ||
@end | ||
# endif | ||
|
||
@implementation RNSentryReplayUnmask | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider | ||
{ | ||
return facebook::react::concreteComponentDescriptorProvider< | ||
facebook::react::RNSentryReplayUnmaskComponentDescriptor>(); | ||
} | ||
# endif | ||
|
||
@end | ||
|
||
# ifdef RCT_NEW_ARCH_ENABLED | ||
Class<RCTComponentViewProtocol> | ||
RNSentryReplayUnmaskCls(void) | ||
{ | ||
return RNSentryReplayUnmask.class; | ||
} | ||
# endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.