Skip to content

Commit 483afe5

Browse files
authored
chore(react-native): Updates migration guide and capture startup crashes for v8 GA (#16366)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR *Tell us what you're changing and why. If your PR **resolves an issue**, please link it so it closes automatically.* Updates migration guide and capture startup crashes for v8 GA Fixes getsentry/sentry-react-native#5597 and getsentry/sentry-react-native#5640 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent a5e1964 commit 483afe5

2 files changed

Lines changed: 41 additions & 16 deletions

File tree

docs/platforms/react-native/manual-setup/app-start-error-capture.mdx

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ sidebar_order: 50
44
description: "Learn how to capture app start errors and crashes that occur before JavaScript loads using native initialization."
55
---
66

7-
<Alert level="warning" title="Beta Testing">
8-
9-
Sentry React Native SDK v8 is currently in beta testing. This feature is available for early adopters and may undergo changes before the stable release.
10-
11-
</Alert>
12-
137
By default, the React Native SDK initializes the native SDK underneath the `init` method called on the JS layer. As a result, the SDK has a current limitation of not capturing native crashes that occur prior to the `init` method being called on the JS layer.
148

159
Starting with SDK version 8.0.0, you can initialize Sentry natively before JavaScript loads, enabling capture of app start errors and crashes that occur during:
@@ -50,7 +44,7 @@ Options from `sentry.options.json` are merged with options from `Sentry.init()`
5044

5145
Initialize Sentry in your `MainApplication` class:
5246

53-
```kotlin {filename:android/app/src/main/java/.../MainApplication.kt}
47+
```kotlin {tabTitle:Kotlin,filename:android/app/src/main/java/.../MainApplication.kt}
5448
import io.sentry.react.RNSentrySDK
5549

5650
class MainApplication : Application(), ReactApplication {
@@ -62,11 +56,24 @@ class MainApplication : Application(), ReactApplication {
6256
}
6357
```
6458

59+
```java {tabTitle:Java,filename:android/app/src/main/java/.../MainApplication.java}
60+
import io.sentry.react.RNSentrySDK;
61+
62+
public class MainApplication extends Application implements ReactApplication {
63+
@Override
64+
public void onCreate() {
65+
super.onCreate();
66+
RNSentrySDK.init(this);
67+
// ... rest of your initialization code
68+
}
69+
}
70+
```
71+
6572
## iOS Setup
6673

67-
Initialize Sentry in your `AppDelegate`:
74+
Initialize Sentry in your `AppDelegate` before starting React Native so app start crashes are captured.
6875

69-
```objective-c {filename:ios/YourApp/AppDelegate.mm}
76+
```objective-c {tabTitle:Objective-C,filename:ios/YourApp/AppDelegate.mm}
7077
#import <RNSentry/RNSentry.h>
7178

7279
@implementation AppDelegate
@@ -81,6 +88,23 @@ Initialize Sentry in your `AppDelegate`:
8188
@end
8289
```
8390
91+
```swift {tabTitle:Swift,filename:ios/YourApp/AppDelegate.swift}
92+
import RNSentry
93+
94+
@main
95+
class AppDelegate: UIResponder, UIApplicationDelegate {
96+
97+
func application(
98+
_ application: UIApplication,
99+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
100+
) -> Bool {
101+
RNSentrySDK.start()
102+
// ... rest of your initialization code
103+
return true
104+
}
105+
}
106+
```
107+
84108
## Expo Setup
85109

86110
If you're using Expo, you can enable native initialization automatically using the Expo plugin:

docs/platforms/react-native/migration/v7-to-v8.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ sidebar_order: 98
44
description: "Learn how to migrate from version 7 to version 8 of the Sentry React Native SDK"
55
---
66

7-
<Alert level="warning">
8-
9-
**Version 8 is currently in beta.** This migration guide is provided for early adopters. The API and features may change before the stable release.
10-
11-
</Alert>
12-
137
Version 8 of the Sentry React Native SDK updates the underlying native SDKs (Cocoa v9, CLI v3, Android Gradle Plugin v6) which introduce breaking changes in minimum version requirements and build tooling.
148

159
## Important Changes in Dependencies
@@ -33,8 +27,15 @@ The minimum supported versions have been updated:
3327
- **iOS**: **15.0+** (previously 11.0+)
3428
- **macOS**: **10.14+** (previously 10.13+)
3529
- **tvOS**: **15.0+** (previously 11.0+)
30+
- **Xcode**: **16.4+** (required)
31+
32+
If your app targets older versions, you'll need to update your deployment targets before upgrading to version 8.
33+
34+
**Note:** Xcode 16.4+ is required for proper Swift module compilation. Using older versions may result in build errors. Ensure your CI/CD environment uses Xcode 16.4 or later.
35+
36+
If you have custom `post_install` hooks in your `Podfile` that modify `SWIFT_VERSION` or other Swift compiler flags for all pods, exclude Sentry targets to avoid conflicts.
3637

37-
If your app targets older versions, you'll need to update your deployment targets before upgrading to version 8. For more details on the Cocoa SDK v9 changes, see the [Cocoa SDK 8.x to 9.x migration guide](/platforms/apple/migration/#migrating-from-8x-to-9x).
38+
For more details on the Cocoa SDK v9 changes, see the [Cocoa SDK 8.x to 9.x migration guide](/platforms/apple/migration/#migrating-from-8x-to-9x).
3839

3940
#### Android
4041

0 commit comments

Comments
 (0)