Skip to content

[Expo, iOS] When native enabled events are not sent #3961

Description

@timmyjose

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: ~5.22.0

react-native version: 0.74.3

Are you using Expo?

  • Yes (CNG - Continuous Native Generation, android and ios directories in version control, previously called "bare" workflow).
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look: N/A

Configuration:

(@sentry/react-native)

import { getVersion, getBuildNumber } from 'react-native-device-info'
...

Sentry.init({
  dsn: SENTRY_DSN,
  environment: ENV_NAME,
  normalizeDepth: 7,
  integrations: [
    new Sentry.ReactNativeTracing({
      enableAppStartTracking: false
    })
  ],
  enabled: !__DEV__,
  enableNative: Platform.OS === 'android',
  enableNativeCrashHandling: Platform.OS === 'android',
  release: `${getVersion()} (${getBuildNumber()})`, // workaround because of the current issue
  dist: getBuildNumber(), // workaround because of the current issue
  ignoreErrors: [/network-error error/]
})

I have the following issue:

Two issues. possibly both related to the same underlying issue.

Main issue: If enableNative: true, then notifications are not sent for iOS. No error logs.
Secondary Issue: No Device Information coming through for iOS. (Possibly related to the main issue?)

Steps to reproduce: N/A (possibly project-specific since the setup works in an expo 51 prototype).

Some possibly helpful information:

Logs (with debug: true:

No errors in logs.

 LOG  Sentry Logger [log]: Unhandled promise rejections will be caught by Sentry.
 LOG  Sentry Logger [log]: Integration installed: ReactNativeErrorHandlers
 LOG  Sentry Logger [log]: Integration installed: NativeLinkedErrors
 LOG  Sentry Logger [log]: Integration installed: InboundFilters
 LOG  Sentry Logger [log]: Integration installed: FunctionToString
 LOG  Sentry Logger [log]: Integration installed: Breadcrumbs
 LOG  Sentry Logger [log]: Integration installed: Dedupe
 LOG  Sentry Logger [log]: Integration installed: HttpContext
 LOG  Sentry Logger [log]: Integration installed: Release
 LOG  Sentry Logger [log]: Integration installed: EventOrigin
 LOG  Sentry Logger [log]: Integration installed: SdkInfo
 LOG  Sentry Logger [log]: Integration installed: ReactNativeInfo
 LOG  Sentry Logger [log]: Integration installed: DebugSymbolicator
 LOG  Sentry Logger [log]: Integration installed: RewriteFrames
 LOG  Sentry Logger [log]: Integration installed: DeviceContext
 LOG  Sentry Logger [log]: Integration installed: ModulesLoader
 LOG  Sentry Logger [log]: [ReactNativeTracing] Native frames instrumentation initialized.
 LOG  Sentry Logger [log]: [ReactNativeTracing] Not instrumenting route changes as routingInstrumentation has not been set.
 LOG  Sentry Logger [log]: Integration installed: ReactNativeTracing
 LOG  Sentry Logger [log]: Integration installed: ReactNativeProfiler

....

 LOG  Sentry Logger [log]: [TouchEvents] Touch event within element: TextInput
 LOG  Sentry Logger [log]: [ReactNativeTracing] User Interaction Tracing is disabled

Is Native SDK initialised?

If I try with this code:

Sentry.init({
   ...
   onReady: ({ didCallNativeInit}) => {
     if (didCallNativeInit) {
       console.log('Native SDK initialised successfully')
   }
   ...
}

then I see that the native SDK was initialised correctly.

sentry.json

Is auto-linking happening?

Yes:

Auto-linking React Native modules for target `<redacted>`: RNCAsyncStorage, RNDeviceInfo, RNFBApp, RNFBMessaging, RNGestureHandler, RNLocalize, RNNotifee, RNSVG, RNScreens, RNSentry, react-native-cloud-storage, react-native-compat, react-native-get-random-values, react-native-netinfo, react-native-quick-base64, react-native-rust-bridge, and react-native-safe-area-context

Is notification packet captured in beforeSend?

Yes. Please see the attachment, sentry.json.

Actual result:

  • If enableNative: true, then no notifications sent for iOS.
  • No Device Information available for iOS notifications .

Expected result:

  • enableNative: true works for iOS, and we get notifications in the Sentry dashboard.
  • Device Information is available for iOS notifications.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ExpoIssues related to Sentry React Native Expo supportiOS

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions