5757
5858#import " RNSentryExperimentalOptions.h"
5959#import " RNSentryVersion.h"
60-
61- @interface
62- SentrySDK (RNSentry)
63-
64- + (void )captureEnvelope:(SentryEnvelope *)envelope;
65-
66- + (void )storeEnvelope:(SentryEnvelope *)envelope;
67-
68- @end
60+ #import " SentrySDKWrapper.h"
6961
7062static bool hasFetchedAppStart;
7163
@@ -112,7 +104,7 @@ - (instancetype)init
112104 [PrivateSentrySDKOnly addSdkPackage: REACT_NATIVE_SDK_PACKAGE_NAME
113105 version: REACT_NATIVE_SDK_PACKAGE_VERSION ];
114106
115- [SentrySDK startWithOptions: sentryOptions];
107+ [SentrySDKWrapper startWithOptions: sentryOptions];
116108
117109#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
118110 BOOL appIsActive =
@@ -451,7 +443,7 @@ - (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAd
451443 __block NSMutableDictionary <NSString *, id > *serializedScope;
452444 // Temp work around until sorted out this API in sentry-cocoa.
453445 // TODO: If the callback isnt' executed the promise wouldn't be resolved.
454- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) {
446+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) {
455447 serializedScope = [[scope serialize ] mutableCopy ];
456448
457449 NSDictionary <NSString *, id > *user = [serializedScope valueForKey: @" user" ];
@@ -655,7 +647,7 @@ - (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAd
655647
656648RCT_EXPORT_METHOD (setUser : (NSDictionary *)userKeys otherUserKeys : (NSDictionary *)userDataKeys)
657649{
658- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) {
650+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) {
659651 [scope setUser: [RNSentry userFrom: userKeys otherUserKeys: userDataKeys]];
660652 }];
661653}
@@ -704,7 +696,7 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
704696
705697RCT_EXPORT_METHOD (addBreadcrumb : (NSDictionary *)breadcrumb)
706698{
707- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) {
699+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) {
708700 [scope addBreadcrumb: [RNSentryBreadcrumb from: breadcrumb]];
709701 }];
710702
@@ -718,12 +710,12 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
718710
719711RCT_EXPORT_METHOD (clearBreadcrumbs)
720712{
721- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) { [scope clearBreadcrumbs ]; }];
713+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) { [scope clearBreadcrumbs ]; }];
722714}
723715
724716RCT_EXPORT_METHOD (setExtra : (NSString *)key extra : (NSString *)extra)
725717{
726- [SentrySDK
718+ [SentrySDKWrapper
727719 configureScope: ^(SentryScope *_Nonnull scope) { [scope setExtraValue: extra forKey: key]; }];
728720}
729721
@@ -733,7 +725,7 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
733725 return ;
734726 }
735727
736- [SentrySDK configureScope: ^(SentryScope *_Nonnull scope) {
728+ [SentrySDKWrapper configureScope: ^(SentryScope *_Nonnull scope) {
737729 if (context == nil ) {
738730 [scope removeContextForKey: key];
739731 } else {
@@ -744,17 +736,17 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
744736
745737RCT_EXPORT_METHOD (setTag : (NSString *)key value : (NSString *)value)
746738{
747- [SentrySDK
739+ [SentrySDKWrapper
748740 configureScope: ^(SentryScope *_Nonnull scope) { [scope setTagValue: value forKey: key]; }];
749741}
750742
751- RCT_EXPORT_METHOD (crash) { [SentrySDK crash ]; }
743+ RCT_EXPORT_METHOD (crash) { [SentrySDKWrapper crash ]; }
752744
753745RCT_EXPORT_METHOD (closeNativeSdk
754746 : (RCTPromiseResolveBlock)resolve rejecter
755747 : (RCTPromiseRejectBlock)reject)
756748{
757- [SentrySDK close ];
749+ [SentrySDKWrapper close ];
758750 resolve (@YES );
759751}
760752
@@ -957,7 +949,7 @@ + (SentryUser *_Nullable)userFrom:(NSDictionary *)userKeys
957949 : (RCTPromiseResolveBlock)resolve rejecter
958950 : (RCTPromiseRejectBlock)reject)
959951{
960- resolve (@([SentrySDK crashedLastRun ]));
952+ resolve (@([SentrySDKWrapper crashedLastRun ]));
961953}
962954
963955// Thanks to this guard, we won't compile this code when we build for the old architecture.
0 commit comments