2121#import < Sentry/PrivateSentrySDKOnly.h>
2222#import < Sentry/SentryAppStartMeasurement.h>
2323#import < Sentry/SentryBinaryImageCache.h>
24+ #import < Sentry/SentryBreadcrumb.h>
2425#import < Sentry/SentryDebugImageProvider+HybridSDKs.h>
26+ #import < Sentry/SentryDebugMeta.h>
2527#import < Sentry/SentryDependencyContainer.h>
28+ #import < Sentry/SentryEvent.h>
29+ #import < Sentry/SentryException.h>
2630#import < Sentry/SentryFormatter.h>
31+ #import < Sentry/SentryOptions.h>
32+ #import < Sentry/SentryUser.h>
2733#if __has_include(<Sentry/SentryOptions+HybridSDKs.h>)
2834# define USE_SENTRY_OPTIONS 1
2935# import < Sentry/SentryOptions+HybridSDKs.h>
5763
5864#import " RNSentryExperimentalOptions.h"
5965#import " RNSentryVersion.h"
60-
61- @interface
62- SentrySDK (RNSentry)
63-
64- + (void )captureEnvelope:(SentryEnvelope *)envelope;
65-
66- + (void )storeEnvelope:(SentryEnvelope *)envelope;
67-
68- @end
66+ #import " SentrySDKWrapper.h"
6967
7068static bool hasFetchedAppStart;
7169
@@ -112,7 +110,7 @@ - (instancetype)init
112110 [PrivateSentrySDKOnly addSdkPackage: REACT_NATIVE_SDK_PACKAGE_NAME
113111 version: REACT_NATIVE_SDK_PACKAGE_VERSION];
114112
115- [SentrySDK startWithOptions: sentryOptions];
113+ [SentrySDKWrapper startWithOptions: sentryOptions];
116114
117115#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
118116 BOOL appIsActive =
@@ -363,7 +361,11 @@ - (void)stopObserving
363361- (NSDictionary *)fetchNativeStackFramesBy : (NSArray <NSNumber *> *)instructionsAddr
364362 symbolicate : (SymbolicateCallbackType)symbolicate
365363{
364+ #if CROSS_PLATFORM_TEST
365+ BOOL shouldSymbolicateLocally = [SentrySDKInternal.options debug ];
366+ #else
366367 BOOL shouldSymbolicateLocally = [SentrySDK.options debug ];
368+ #endif
367369 NSString *appPackageName = [[NSBundle mainBundle ] executablePath ];
368370
369371 NSMutableSet <NSString *> *_Nonnull imagesAddrToRetrieveDebugMetaImages =
@@ -451,7 +453,7 @@ - (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAd
451453 __block NSMutableDictionary <NSString *, id > *serializedScope;
452454 // Temp work around until sorted out this API in sentry-cocoa.
453455 // TODO: If the callback isnt' executed the promise wouldn't be resolved.
454- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) {
456+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) {
455457 serializedScope = [[scope serialize ] mutableCopy ];
456458
457459 NSDictionary <NSString *, id > *user = [serializedScope valueForKey: @" user" ];
@@ -655,7 +657,7 @@ - (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAd
655657
656658RCT_EXPORT_METHOD (setUser : (NSDictionary *)userKeys otherUserKeys : (NSDictionary *)userDataKeys)
657659{
658- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) {
660+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) {
659661 [scope setUser: [RNSentry userFrom: userKeys otherUserKeys: userDataKeys]];
660662 }];
661663}
@@ -704,7 +706,7 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
704706
705707RCT_EXPORT_METHOD (addBreadcrumb : (NSDictionary *)breadcrumb)
706708{
707- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) {
709+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) {
708710 [scope addBreadcrumb: [RNSentryBreadcrumb from: breadcrumb]];
709711 }];
710712
@@ -718,12 +720,12 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
718720
719721RCT_EXPORT_METHOD (clearBreadcrumbs)
720722{
721- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) { [scope clearBreadcrumbs ]; }];
723+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) { [scope clearBreadcrumbs ]; }];
722724}
723725
724726RCT_EXPORT_METHOD (setExtra : (NSString *)key extra : (NSString *)extra)
725727{
726- [SentrySDK
728+ [SentrySDKWrapper
727729 configureScope: ^(SentryScope *_Nonnull scope) { [scope setExtraValue: extra forKey: key]; }];
728730}
729731
@@ -733,7 +735,7 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
733735 return ;
734736 }
735737
736- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) {
738+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) {
737739 if (context == nil ) {
738740 [scope removeContextForKey: key];
739741 } else {
@@ -744,17 +746,17 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
744746
745747RCT_EXPORT_METHOD (setTag : (NSString *)key value : (NSString *)value)
746748{
747- [SentrySDK
749+ [SentrySDKWrapper
748750 configureScope: ^(SentryScope *_Nonnull scope) { [scope setTagValue: value forKey: key]; }];
749751}
750752
751- RCT_EXPORT_METHOD (crash) { [SentrySDK crash ]; }
753+ RCT_EXPORT_METHOD (crash) { [SentrySDKWrapper crash ]; }
752754
753755RCT_EXPORT_METHOD (closeNativeSdk
754756 : (RCTPromiseResolveBlock)resolve rejecter
755757 : (RCTPromiseRejectBlock)reject)
756758{
757- [SentrySDK close ];
759+ [SentrySDKWrapper close ];
758760 resolve (@YES );
759761}
760762
@@ -957,7 +959,7 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
957959 : (RCTPromiseResolveBlock)resolve rejecter
958960 : (RCTPromiseRejectBlock)reject)
959961{
960- resolve (@([SentrySDK crashedLastRun ]));
962+ resolve (@([SentrySDKWrapper crashedLastRun ]));
961963}
962964
963965// Thanks to this guard, we won't compile this code when we build for the old architecture.
0 commit comments