Problem Statement
Both native SDKs now provide APIs to check if the previous app session ended in a crash:
- iOS (Cocoa SDK 9.8.0+):
SentrySDK.lastRunStatus — returns unknown, no-crash, or crash
- Android:
Sentry.isCrashedLastRun() — returns a boolean
There is currently no way to access this information from the React Native (JavaScript) layer.
Use Cases
- Show a recovery UI (e.g., "Sorry, the app crashed") after restarting from a crash
- Disable experimental features that may have caused a crash
- Send custom analytics or breadcrumbs about crash recovery
- Implement progressive rollout logic that backs off after crashes
Proposed Solution
Expose a unified JS API, e.g.:
import * as Sentry from '@sentry/react-native';
const status = Sentry.lastRunStatus();
// Returns: 'unknown' | 'no-crash' | 'crash'
Implementation Notes
- Bridge
SentrySDK.lastRunStatus on iOS and Sentry.isCrashedLastRun() on Android through the native modules
- Normalize the return value across platforms (iOS has 3 states, Android has a boolean — need to decide on a unified shape)
- Should be callable after
Sentry.init()
References
Problem Statement
Both native SDKs now provide APIs to check if the previous app session ended in a crash:
SentrySDK.lastRunStatus— returns unknown, no-crash, or crashSentry.isCrashedLastRun()— returns a booleanThere is currently no way to access this information from the React Native (JavaScript) layer.
Use Cases
Proposed Solution
Expose a unified JS API, e.g.:
Implementation Notes
SentrySDK.lastRunStatuson iOS andSentry.isCrashedLastRun()on Android through the native modulesSentry.init()References
SentrySDK.lastRunStatusto distinguish unknown, no-crash and crash sentry-cocoa#7469