Skip to content

Initialize native SDKs before JS #3608

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

Open
4 of 9 tasks
krystofwoldrich opened this issue Feb 19, 2024 · 3 comments
Open
4 of 9 tasks

Initialize native SDKs before JS #3608

krystofwoldrich opened this issue Feb 19, 2024 · 3 comments

Comments

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Feb 19, 2024

Available in https://github.com/getsentry/sentry-react-native/releases/tag/6.7.0-alpha.0

Create sentry.options.json in the React Native project root and set options the same as you currently have in Sentry.init in JS.

{
    "dsn": "https://[email protected]/value",
}

Initialize Sentry on the native layers by newly provided native methods.

import io.sentry.react.RNSentrySDK

class MainApplication : Application(), ReactApplication {
    override fun onCreate() {
        super.onCreate()
        RNSentrySDK.init(this)
    }
}
#import <RNSentry/RNSentry.h>

@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [RNSentrySDK start];
    return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end

Development

Tasks

  • Create RNSentry.init for Android
  • Create RNSentry.init for Cocoa
  • Update @sentry/wizard to optionally use sentry.options.json
  • Add new manual init docs
  • Add JSON file schema
  • Add E2E tests using manual init
  • Update Sample App to use manual init by default

Native RNSentry.init tasks

@github-project-automation github-project-automation bot moved this to Needs Discussion in [DEPRECATED] Mobile SDKs Feb 19, 2024
@krystofwoldrich krystofwoldrich changed the title Capture start up crashes by default Capture start up crashes by default (auto init native SDKs before JS) Feb 19, 2024
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Backlog in [DEPRECATED] Mobile SDKs Feb 23, 2024
@realkosty
Copy link

@krystofwoldrich customer is asking:

do you have any timeline/estimate around when this issue could be fixed?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 16, 2024
@krystofwoldrich
Copy link
Member Author

@realkosty We don't have a timeline yet. But it's possible to capture the startup crashes when initializing the native SDKs manually. The How to set up for start up crashes at the moment part of the issue.

@krystofwoldrich krystofwoldrich changed the title Capture start up crashes by default (auto init native SDKs before JS) Capture app start crashes by default (auto init native SDKs before JS) Dec 11, 2024
@krystofwoldrich krystofwoldrich changed the title Capture app start crashes by default (auto init native SDKs before JS) Initialize native SDKs before JS Jan 14, 2025
@kahest
Copy link
Member

kahest commented Feb 6, 2025

@krystofwoldrich we should also update at least one sample app to use this IMO :) (may be part of the e2e test task above, so I didn't add an item, please go ahead if you want to track it separately)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Backlog
Development

No branches or pull requests

4 participants