Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Expose `enableNetworkBreadcrumbs` (iOS) to disable native HTTP request breadcrumbs ([#6764](https://github.com/getsentry/sentry-react-native/pull/6764))
- Expose `enableNetworkEventBreadcrumbs` (Android) to disable native network connectivity breadcrumbs ([#6764](https://github.com/getsentry/sentry-react-native/pull/6764))
- Expose native breadcrumb off-switches: `enableAutoBreadcrumbTracking` (iOS); `enableActivityLifecycleBreadcrumbs`, `enableAppLifecycleBreadcrumbs`, `enableSystemEventBreadcrumbs`, `enableAppComponentBreadcrumbs` (Android) ([#6768](https://github.com/getsentry/sentry-react-native/pull/6768))
- Expose `reportAccessibilityIdentifier` (iOS) to omit PII accessibility identifiers from the view hierarchy ([#6771](https://github.com/getsentry/sentry-react-native/pull/6771))

### Fixes

Expand Down
1 change: 1 addition & 0 deletions packages/core/etc/sentry-react-native.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export interface BaseReactNativeOptions {
replaysOnErrorSampleRate?: number;
replaysSessionQuality?: SentryReplayQuality;
replaysSessionSampleRate?: number;
reportAccessibilityIdentifier?: boolean;
screenshot?: {
maskAllText?: boolean;
maskAllImages?: boolean;
Expand Down
14 changes: 14 additions & 0 deletions packages/core/src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,20 @@ export interface BaseReactNativeOptions {
*/
attachViewHierarchy?: boolean;

/**
* When enabled, the native iOS SDK includes each view's `accessibilityIdentifier` in the
* captured view hierarchy (see `attachViewHierarchy`).
*
* Accessibility identifiers are developer-defined and may contain personally identifiable
* information (PII). Set this to `false` to omit them from the view hierarchy. Note that the
* native SDK does not gate this on `sendDefaultPii`, so it defaults to `true` regardless of
* that option.
*
* @default true
* @platform ios
*/
reportAccessibilityIdentifier?: boolean;

/**
* When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.
* [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)
Expand Down
17 changes: 17 additions & 0 deletions packages/core/test/wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,23 @@ describe('Tests Native Wrapper', () => {
expect(initParameter.enableAppComponentBreadcrumbs).toBe(false);
});

test('forwards reportAccessibilityIdentifier to the Native SDK', async () => {
await NATIVE.initNativeSdk({
dsn: VALID_DSN,
enableNative: true,
autoInitializeNativeSdk: true,
reportAccessibilityIdentifier: false,
devServerUrl: undefined,
defaultSidecarUrl: undefined,
mobileReplayOptions: undefined,
});

expect(RNSentry.initNativeSdk).toHaveBeenCalled();
// @ts-expect-error mock value
const initParameter = RNSentry.initNativeSdk.mock.calls[0][0];
expect(initParameter.reportAccessibilityIdentifier).toBe(false);
});

test('filter beforeSend when initializing Native SDK', async () => {
await NATIVE.initNativeSdk({
dsn: VALID_DSN,
Expand Down
Loading