Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replay): Add Mask and Unmask Android implementation #4265

Merged
merged 57 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
0fc1b42
feat(replay): Add SentryMask and SentryUnmask native components
krystofwoldrich Oct 31, 2024
9933a86
add clang-format
krystofwoldrich Nov 4, 2024
e17ac31
apply the formatter
krystofwoldrich Nov 4, 2024
534cbce
Merge remote-tracking branch 'origin/main' into kw/feat/replay-custom…
krystofwoldrich Nov 4, 2024
ef863a1
Merge remote-tracking branch 'origin/main' into kw/internal/clag-format
krystofwoldrich Nov 4, 2024
d317e1e
Merge branch 'kw/internal/clag-format' into kw/feat/replay-custom-red…
krystofwoldrich Nov 4, 2024
eb9d2de
fix clang format
krystofwoldrich Nov 4, 2024
cbf400a
add native architecture masks for ios
krystofwoldrich Nov 5, 2024
be04dfc
Merge remote-tracking branch 'origin/main' into kw/feat/replay-custom…
krystofwoldrich Nov 5, 2024
77691bd
add js tests
krystofwoldrich Nov 5, 2024
45374be
fix eslint changing the native props interface to type
krystofwoldrich Nov 6, 2024
0a127d2
Fix mask components for non uikit builds
krystofwoldrich Nov 6, 2024
4f5b967
add changelog
krystofwoldrich Nov 6, 2024
eb64e8d
fix typo
krystofwoldrich Nov 6, 2024
32c45e4
fix ts3.8 type check test
krystofwoldrich Nov 6, 2024
691f8f4
Merge branch 'kw/fix/type-check' into kw/feat/replay-custom-redact-an…
krystofwoldrich Nov 6, 2024
02bb913
fix new arch build decoupled replay and replay mask
krystofwoldrich Nov 6, 2024
5315bb2
fix missing react native types
krystofwoldrich Nov 6, 2024
f07f155
Merge branch 'kw/fix/type-check' into kw/feat/replay-custom-redact-co…
krystofwoldrich Nov 6, 2024
1b1c435
Merge branch 'main' into kw/feat/replay-custom-redact-components
krystofwoldrich Nov 8, 2024
cdd3da8
Update mask sample
krystofwoldrich Nov 8, 2024
1170838
fix rn unmask class is added to unmask array
krystofwoldrich Nov 8, 2024
3a9e155
fix tests for custom classes
krystofwoldrich Nov 8, 2024
c02d06c
Update samples/react-native/src/App.tsx
krystofwoldrich Nov 11, 2024
9fe9c24
update redact example
krystofwoldrich Nov 11, 2024
845c260
fix changelog and macos sample
krystofwoldrich Nov 11, 2024
2edaeb0
fix rnsentry impl
krystofwoldrich Nov 11, 2024
503c992
Merge branch 'main' into kw/feat/replay-custom-redact-components
krystofwoldrich Nov 11, 2024
4f88064
fix class names tests
krystofwoldrich Nov 11, 2024
ddffa75
Merge branch 'kw/feat/replay-custom-redact-components' of github.com:…
krystofwoldrich Nov 11, 2024
e0ccb78
Update samples/react-native-macos/src/Screens/PlaygroundScreen.tsx
krystofwoldrich Nov 11, 2024
711e547
feat(replay): Add Mask and Unmask Android New Arch implementation
krystofwoldrich Nov 11, 2024
ed81fd7
use mask containers
krystofwoldrich Nov 12, 2024
dd2c350
Add backwards compatibility with legacy architecture
krystofwoldrich Nov 12, 2024
30586a3
revert disable profiling
krystofwoldrich Nov 12, 2024
d16bc9a
Merge branch '6.3.0-beta' into kw/feat/replay-custom-redact-components
krystofwoldrich Nov 21, 2024
32ddafe
Merge branch 'kw/feat/replay-custom-redact-components' into kw/feat/r…
krystofwoldrich Nov 21, 2024
d9cc0d9
fix custom fallback tests
krystofwoldrich Nov 21, 2024
e665141
Fix lint and typos
krystofwoldrich Nov 21, 2024
050acad
use mask/unmask classes directly
krystofwoldrich Nov 21, 2024
d50ffe2
fix changelog
krystofwoldrich Nov 21, 2024
414590c
Merge branch '6.3.0-beta' into kw/feat/replay-custom-redact-components
krystofwoldrich Nov 22, 2024
fad832e
Merge branch 'kw/feat/replay-custom-redact-components' into kw/feat/r…
krystofwoldrich Nov 22, 2024
eacc487
fix changelog
krystofwoldrich Nov 22, 2024
eb457fc
fix old RN builds, remove ts from shipped package
krystofwoldrich Nov 23, 2024
5965c22
Merge branch '6.3.0-beta' into kw/feat/replay-custom-redact-components
krystofwoldrich Nov 25, 2024
b41d759
fix custom mask tests
krystofwoldrich Nov 25, 2024
ab42222
Merge branch 'kw/feat/replay-custom-redact-components' into kw/feat/r…
krystofwoldrich Nov 25, 2024
8eaa867
add native component registry access explanation
krystofwoldrich Nov 25, 2024
4e18dc4
Apply suggestions from code review
krystofwoldrich Nov 25, 2024
aef7146
Merge branch 'kw/feat/replay-custom-redact-components' into kw/feat/r…
krystofwoldrich Nov 25, 2024
71664ae
use deprecated ReactModuleInfo constructor
krystofwoldrich Nov 25, 2024
af13626
fix lint
krystofwoldrich Nov 25, 2024
e77e2eb
Merge branch 'kw/feat/replay-custom-redact-components' into kw/feat/r…
krystofwoldrich Nov 25, 2024
2189770
remove unintentional sample text element
krystofwoldrich Nov 25, 2024
3bcd455
reuse class name from impl
krystofwoldrich Nov 25, 2024
68f6282
Merge branch 'main' into kw/feat/replay-custom-redact-android
krystofwoldrich Nov 25, 2024
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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@

## Unreleased

### Features

- Add Replay Custom Masking for iOS and Android ([#4224](https://github.com/getsentry/sentry-react-native/pull/4224), [#4265](https://github.com/getsentry/sentry-react-native/pull/4265))

```jsx
import * as Sentry from '@sentry/react-native';

const Example = () => {
return (
<View>
<Sentry.Mask>
<Text>${"All children of Sentry.Mask will be masked."}</Text>
</Sentry.Mask>
<Sentry.Unmask>
<Text>${"Only direct children of Sentry.Unmask will be unmasked."}</Text>
</Sentry.Unmask>
</View>
);
};
```

### Fixes

- Remove `.sentry` tmp directory and use environmental variables instead to save default Babel transformer path ([#4298](https://github.com/getsentry/sentry-react-native/pull/4298))
Expand Down
6 changes: 6 additions & 0 deletions packages/core/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
!react-native.config.js
!/ios/**/*
!/android/**/*

# New Architecture Codegen
!src/js/NativeRNSentry.ts
!src/js/RNSentryReplayMaskNativeComponent.ts
!src/js/RNSentryReplayUnmaskNativeComponent.ts

# Scripts
!scripts/collect-modules.sh
!scripts/copy-debugid.js
!scripts/has-sourcemap-debugid.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
332D33472CDBDBB600547D76 /* RNSentryReplayOptionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 332D33462CDBDBB600547D76 /* RNSentryReplayOptionsTests.swift */; };
336084392C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 336084382C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift */; };
3380C6C42CE25ECA0018B9B6 /* RNSentryReplayPostInitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3380C6C32CE25ECA0018B9B6 /* RNSentryReplayPostInitTests.swift */; };
33958C692BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33958C682BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m */; };
33AFDFED2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AFDFEC2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m */; };
33AFDFF12B8D15E500AAB120 /* RNSentryDependencyContainerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AFDFF02B8D15E500AAB120 /* RNSentryDependencyContainerTests.m */; };
Expand All @@ -28,6 +29,9 @@
3360843A2C32E3A8008CC412 /* RNSentryReplayBreadcrumbConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNSentryReplayBreadcrumbConverter.h; path = ../ios/RNSentryReplayBreadcrumbConverter.h; sourceTree = "<group>"; };
3360843C2C340C76008CC412 /* RNSentryBreadcrumbTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNSentryBreadcrumbTests.swift; sourceTree = "<group>"; };
3360898D29524164007C7730 /* RNSentryCocoaTesterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNSentryCocoaTesterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3380C6C12CDEC5850018B9B6 /* RNSentryReplayUnmask.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNSentryReplayUnmask.h; path = ../ios/Replay/RNSentryReplayUnmask.h; sourceTree = SOURCE_ROOT; };
3380C6C22CDEC6630018B9B6 /* RNSentryReplayMask.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNSentryReplayMask.h; path = ../ios/Replay/RNSentryReplayMask.h; sourceTree = SOURCE_ROOT; };
3380C6C32CE25ECA0018B9B6 /* RNSentryReplayPostInitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNSentryReplayPostInitTests.swift; sourceTree = "<group>"; };
338739072A7D7D2800950DDD /* RNSentryReplay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNSentryReplay.h; path = ../ios/RNSentryReplay.h; sourceTree = "<group>"; };
33958C672BFCEF5A00AD1FB6 /* RNSentryOnDrawReporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNSentryOnDrawReporter.h; path = ../ios/RNSentryOnDrawReporter.h; sourceTree = "<group>"; };
33958C682BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNSentryOnDrawReporterTests.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -95,13 +99,24 @@
33958C682BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m */,
3360843C2C340C76008CC412 /* RNSentryBreadcrumbTests.swift */,
332D33462CDBDBB600547D76 /* RNSentryReplayOptionsTests.swift */,
3380C6C32CE25ECA0018B9B6 /* RNSentryReplayPostInitTests.swift */,
);
path = RNSentryCocoaTesterTests;
sourceTree = "<group>";
};
3380C6C02CDEC56B0018B9B6 /* Replay */ = {
isa = PBXGroup;
children = (
3380C6C22CDEC6630018B9B6 /* RNSentryReplayMask.h */,
3380C6C12CDEC5850018B9B6 /* RNSentryReplayUnmask.h */,
);
path = Replay;
sourceTree = "<group>";
};
33AFE0122B8F319000AAB120 /* RNSentry */ = {
isa = PBXGroup;
children = (
3380C6C02CDEC56B0018B9B6 /* Replay */,
332D33482CDBDC7300547D76 /* RNSentry.h */,
3360843A2C32E3A8008CC412 /* RNSentryReplayBreadcrumbConverter.h */,
330F308D2C0F385A002A0D4E /* RNSentryBreadcrumb.h */,
Expand Down Expand Up @@ -228,6 +243,7 @@
336084392C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift in Sources */,
33F58AD02977037D008F60EA /* RNSentryTests.mm in Sources */,
33958C692BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m in Sources */,
3380C6C42CE25ECA0018B9B6 /* RNSentryReplayPostInitTests.swift in Sources */,
33AFDFED2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
#import "RNSentryBreadcrumb.h"
#import "RNSentryReplay.h"
#import "RNSentryReplayBreadcrumbConverter.h"
#import "RNSentryReplayMask.h"
#import "RNSentryReplayUnmask.h"
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ final class RNSentryReplayOptions: XCTestCase {
let sessionReplay = experimental["sessionReplay"] as! [String: Any]

let maskedViewClasses = sessionReplay["maskedViewClasses"] as! [String]
XCTAssertEqual(maskedViewClasses.count, 1)
XCTAssertEqual(maskedViewClasses[0], "RNSVGSvgView")

let actualOptions = try! Options(dict: optionsDict as! [String: Any])
XCTAssertEqual(actualOptions.experimental.sessionReplay.maskedViewClasses.count, 0)
XCTAssertTrue(maskedViewClasses.contains("RNSVGSvgView"))
}

func testMaskAllImages() {
Expand All @@ -128,9 +124,7 @@ final class RNSentryReplayOptions: XCTestCase {
let actualOptions = try! Options(dict: optionsDict as! [String: Any])

XCTAssertEqual(actualOptions.experimental.sessionReplay.maskAllImages, true)
XCTAssertEqual(actualOptions.experimental.sessionReplay.maskedViewClasses.count, 1)
XCTAssertNotNil(actualOptions.experimental.sessionReplay.maskedViewClasses[0])
XCTAssertEqual(ObjectIdentifier(actualOptions.experimental.sessionReplay.maskedViewClasses[0]), ObjectIdentifier(NSClassFromString("RCTImageView")!))
assertContainsClass(classArray: actualOptions.experimental.sessionReplay.maskedViewClasses, stringClass: "RCTImageView")
}

func testMaskAllImagesFalse() {
Expand Down Expand Up @@ -160,11 +154,16 @@ final class RNSentryReplayOptions: XCTestCase {
let actualOptions = try! Options(dict: optionsDict as! [String: Any])

XCTAssertEqual(actualOptions.experimental.sessionReplay.maskAllText, true)
XCTAssertEqual(actualOptions.experimental.sessionReplay.maskedViewClasses.count, 2)
XCTAssertNotNil(actualOptions.experimental.sessionReplay.maskedViewClasses[0])
XCTAssertNotNil(actualOptions.experimental.sessionReplay.maskedViewClasses[1])
XCTAssertEqual(ObjectIdentifier(actualOptions.experimental.sessionReplay.maskedViewClasses[0]), ObjectIdentifier(NSClassFromString("RCTTextView")!))
XCTAssertEqual(ObjectIdentifier(actualOptions.experimental.sessionReplay.maskedViewClasses[1]), ObjectIdentifier(NSClassFromString("RCTParagraphComponentView")!))
assertContainsClass(classArray: actualOptions.experimental.sessionReplay.maskedViewClasses, stringClass: "RCTTextView")
assertContainsClass(classArray: actualOptions.experimental.sessionReplay.maskedViewClasses, stringClass: "RCTParagraphComponentView")
}

func assertContainsClass(classArray: [AnyClass], stringClass: String) {
XCTAssertTrue(mapToObjectIdentifiers(classArray: classArray).contains(ObjectIdentifier(NSClassFromString(stringClass)!)))
}

func mapToObjectIdentifiers(classArray: [AnyClass]) -> [ObjectIdentifier] {
return classArray.map { ObjectIdentifier($0) }
}

func testMaskAllTextFalse() {
Expand Down
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))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
import io.sentry.protocol.SentryPackage;
import io.sentry.protocol.User;
import io.sentry.protocol.ViewHierarchy;
import io.sentry.react.replay.RNSentryReplayMask;
import io.sentry.react.replay.RNSentryReplayUnmask;
import io.sentry.util.DebugMetaPropertiesApplier;
import io.sentry.util.FileUtils;
import io.sentry.util.JsonSerializationUtils;
Expand Down Expand Up @@ -371,6 +373,9 @@ private SentryReplayOptions getReplayOptions(@NotNull ReadableMap rnOptions) {
androidReplayOptions.addMaskViewClass("com.horcrux.svg.SvgView"); // react-native-svg
}

androidReplayOptions.setMaskViewContainerClass(RNSentryReplayMask.class.getName());
androidReplayOptions.setUnmaskViewContainerClass(RNSentryReplayUnmask.class.getName());

return androidReplayOptions;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,35 @@
import com.facebook.react.module.model.ReactModuleInfo;
import com.facebook.react.module.model.ReactModuleInfoProvider;
import com.facebook.react.uimanager.ViewManager;
import java.util.Arrays;
import io.sentry.react.replay.RNSentryReplayMaskManager;
import io.sentry.react.replay.RNSentryReplayMaskManagerImpl;
import io.sentry.react.replay.RNSentryReplayUnmaskManager;
import io.sentry.react.replay.RNSentryReplayUnmaskManagerImpl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class RNSentryPackage extends TurboReactPackage {

private static final boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;

@Nullable
@Override
public NativeModule getModule(String name, ReactApplicationContext reactContext) {
if (name.equals(RNSentryModuleImpl.NAME)) {
if (RNSentryModuleImpl.NAME.equals(name)) {
return new RNSentryModule(reactContext);
} else if (isTurboModule) {
return getFabricComponentNativeModule(name);
} else {
return null;
}
}

private NativeModule getFabricComponentNativeModule(String name) {
if (RNSentryReplayMaskManagerImpl.REACT_CLASS.equals(name)) {
return new RNSentryReplayMaskManager();
} else if (RNSentryReplayUnmaskManagerImpl.REACT_CLASS.equals(name)) {
return new RNSentryReplayUnmaskManager();
} else {
return null;
}
Expand All @@ -29,7 +46,6 @@ public NativeModule getModule(String name, ReactApplicationContext reactContext)
public ReactModuleInfoProvider getReactModuleInfoProvider() {
return () -> {
final Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
moduleInfos.put(
RNSentryModuleImpl.NAME,
new ReactModuleInfo(
Expand All @@ -41,13 +57,40 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
false, // isCxxModule
isTurboModule // isTurboModule
));
if (isTurboModule) {
moduleInfos.put(
RNSentryReplayMaskManagerImpl.REACT_CLASS,
new ReactModuleInfo(
RNSentryReplayMaskManagerImpl.REACT_CLASS, // name
RNSentryReplayMaskManagerImpl.REACT_CLASS, // className
false, // canOverrideExistingModule
false, // needsEagerInit
false, // hasConstants, required in RN 0.65
false, // isCxxModule
true // isTurboModule
));
moduleInfos.put(
RNSentryReplayUnmaskManagerImpl.REACT_CLASS,
new ReactModuleInfo(
RNSentryReplayUnmaskManagerImpl.REACT_CLASS, // name
RNSentryReplayUnmaskManagerImpl.REACT_CLASS, // className
false, // canOverrideExistingModule
false, // needsEagerInit
false, // hasConstants, required in RN 0.65
false, // isCxxModule
true // isTurboModule
));
}
return moduleInfos;
};
}

@NonNull
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Arrays.asList(new RNSentryOnDrawReporterManager(reactContext));
return List.of(
new RNSentryOnDrawReporterManager(reactContext),
new RNSentryReplayMaskManager(),
new RNSentryReplayUnmaskManager());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.sentry.react.replay;

import android.content.Context;
import com.facebook.react.views.view.ReactViewGroup;

public class RNSentryReplayMask extends ReactViewGroup {
public RNSentryReplayMask(Context context) {
super(context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.sentry.react.replay;

import androidx.annotation.NonNull;
import com.facebook.react.uimanager.ThemedReactContext;

public final class RNSentryReplayMaskManagerImpl {

private RNSentryReplayMaskManagerImpl() {}

public static final String REACT_CLASS = "RNSentryReplayMask";

@NonNull
public static RNSentryReplayMask createViewInstance(@NonNull ThemedReactContext context) {
return new RNSentryReplayMask(context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.sentry.react.replay;

import android.content.Context;
import com.facebook.react.views.view.ReactViewGroup;

public class RNSentryReplayUnmask extends ReactViewGroup {
public RNSentryReplayUnmask(Context context) {
super(context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.sentry.react.replay;

import androidx.annotation.NonNull;
import com.facebook.react.uimanager.ThemedReactContext;

public final class RNSentryReplayUnmaskManagerImpl {

private RNSentryReplayUnmaskManagerImpl() {}

public static final String REACT_CLASS = "RNSentryReplayUnmask";

@NonNull
public RNSentryReplayUnmask createViewInstance(@NonNull ThemedReactContext context) {
return new RNSentryReplayUnmask(context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package io.sentry.react.replay;

import androidx.annotation.NonNull;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.ViewManagerDelegate;
import com.facebook.react.viewmanagers.RNSentryReplayMaskManagerDelegate;
import com.facebook.react.viewmanagers.RNSentryReplayMaskManagerInterface;

@ReactModule(name = RNSentryReplayMaskManagerImpl.REACT_CLASS)
public class RNSentryReplayMaskManager extends ViewGroupManager<RNSentryReplayMask>
implements RNSentryReplayMaskManagerInterface<RNSentryReplayMask> {
private final RNSentryReplayMaskManagerDelegate<RNSentryReplayMask, RNSentryReplayMaskManager>
delegate = new RNSentryReplayMaskManagerDelegate<>(this);

@Override
public ViewManagerDelegate<RNSentryReplayMask> getDelegate() {
return delegate;
}

@NonNull
@Override
public String getName() {
return RNSentryReplayMaskManagerImpl.REACT_CLASS;
}

@NonNull
@Override
public RNSentryReplayMask createViewInstance(@NonNull ThemedReactContext context) {
return new RNSentryReplayMask(context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package io.sentry.react.replay;

import androidx.annotation.NonNull;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.ViewManagerDelegate;
import com.facebook.react.viewmanagers.RNSentryReplayUnmaskManagerDelegate;
import com.facebook.react.viewmanagers.RNSentryReplayUnmaskManagerInterface;

@ReactModule(name = RNSentryReplayUnmaskManager.REACT_CLASS)
public class RNSentryReplayUnmaskManager extends ViewGroupManager<RNSentryReplayUnmask>
implements RNSentryReplayUnmaskManagerInterface<RNSentryReplayUnmask> {
private final RNSentryReplayUnmaskManagerDelegate<
RNSentryReplayUnmask, RNSentryReplayUnmaskManager>
delegate = new RNSentryReplayUnmaskManagerDelegate<>(this);

@Override
public ViewManagerDelegate<RNSentryReplayUnmask> getDelegate() {
return delegate;
}

@NonNull
@Override
public String getName() {
return REACT_CLASS;
}

@NonNull
@Override
public RNSentryReplayUnmask createViewInstance(@NonNull ThemedReactContext context) {
return new RNSentryReplayUnmask(context);
}

public static final String REACT_CLASS = "RNSentryReplayUnmask";
krystofwoldrich marked this conversation as resolved.
Show resolved Hide resolved
}
Loading
Loading