diff --git a/packages/core/android/src/main/java/io/sentry/react/RNSentrySDK.java b/packages/core/android/src/main/java/io/sentry/react/RNSentrySDK.java index eddceab791..b29862bc53 100644 --- a/packages/core/android/src/main/java/io/sentry/react/RNSentrySDK.java +++ b/packages/core/android/src/main/java/io/sentry/react/RNSentrySDK.java @@ -22,21 +22,16 @@ private RNSentrySDK() { throw new AssertionError("Utility class should not be instantiated"); } - private static void startWithOptions( - @NotNull final Context context, @NotNull final ReadableMap rnOptions) { - RNSentryStart.startWithOptions(context, rnOptions, null, logger); - } - /** * Start the Native Android SDK with the provided options * * @param context Android Context * @param options Map with options */ - public static void startWithOptions( + public static void init( @NotNull final Context context, @NotNull final Map options) { ReadableMap rnOptions = RNSentryMapConverter.mapToReadableMap(options); - startWithOptions(context, rnOptions); + RNSentryStart.startWithOptions(context, rnOptions, null, logger); } /** @@ -44,11 +39,11 @@ public static void startWithOptions( * * @param context Android Context */ - public static void start(@NotNull final Context context) { + public static void init(@NotNull final Context context) { try { JSONObject jsonObject = getOptionsFromConfigurationFile(context); ReadableMap rnOptions = RNSentryMapConverter.jsonObjectToReadableMap(jsonObject); - startWithOptions(context, rnOptions); + RNSentryStart.startWithOptions(context, rnOptions, null, logger); } catch (Exception e) { logger.log( SentryLevel.ERROR, "Failed to start Sentry with options from configuration file.", e); diff --git a/samples/react-native/android/app/src/main/java/io/sentry/reactnative/sample/MainApplication.kt b/samples/react-native/android/app/src/main/java/io/sentry/reactnative/sample/MainApplication.kt index 9daa12031e..142c767911 100644 --- a/samples/react-native/android/app/src/main/java/io/sentry/reactnative/sample/MainApplication.kt +++ b/samples/react-native/android/app/src/main/java/io/sentry/reactnative/sample/MainApplication.kt @@ -48,7 +48,7 @@ class MainApplication : } private fun initializeSentry() { -// RNSentrySDK.startWithOptions( +// RNSentrySDK.init( // this, // mapOf( // "dsn" to "https://1df17bd4e543fdb31351dee1768bb679@o447951.ingest.sentry.io/5428561", @@ -56,6 +56,6 @@ class MainApplication : // ), // ) - RNSentrySDK.start(this) + RNSentrySDK.init(this) } }