From 6b7aad8f19f04ccb2a19de6618339d11e6eb2963 Mon Sep 17 00:00:00 2001 From: GitHub Date: Thu, 31 Jul 2025 13:59:44 +0000 Subject: [PATCH 01/12] chore: update scripts/update-cocoa.sh to 8.54.0 --- CHANGELOG.md | 8 ++++++++ packages/core/RNSentry.podspec | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f1945dbed..2cfdcc89d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ > make sure you follow our [migration guide](https://docs.sentry.io/platforms/react-native/migration/) first. +## Unreleased + +### Dependencies + +- Bump Cocoa SDK from v8.53.2 to v8.54.0 ([#5036](https://github.com/getsentry/sentry-react-native/pull/5036)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8540) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.53.2...8.54.0) + ## 6.19.0 ### Fixes diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 3413279979..74bd9abedd 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', '8.53.2' + s.dependency 'Sentry/HybridSDK', '8.54.0' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) From 83f91bb969b33a5b6e241d2e0a69b264777c8bc6 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 31 Jul 2025 17:55:04 +0300 Subject: [PATCH 02/12] Remove Cocoa Flags --- .../RNSentryReplayOptionsTests.swift | 70 +------------------ .../RNSentryCocoaTesterTests/RNSentryTests.h | 6 +- .../RNSentryCocoaTesterTests/RNSentryTests.m | 5 -- packages/core/ios/RNSentry.h | 5 -- packages/core/ios/RNSentry.mm | 19 +---- 5 files changed, 4 insertions(+), 101 deletions(-) diff --git a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayOptionsTests.swift b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayOptionsTests.swift index 3b8765547f..0d7ef3aa12 100644 --- a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayOptionsTests.swift +++ b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayOptionsTests.swift @@ -67,11 +67,7 @@ final class RNSentryReplayOptions: XCTestCase { ] as NSDictionary).mutableCopy() as! NSMutableDictionary RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.sessionSampleRate, 0.75) } @@ -82,11 +78,7 @@ final class RNSentryReplayOptions: XCTestCase { ] as NSDictionary).mutableCopy() as! NSMutableDictionary RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.onErrorSampleRate, 0.75) } @@ -116,11 +108,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.maskAllImages, true) assertContainsClass(classArray: actualOptions.sessionReplay.maskedViewClasses, stringClass: "RCTImageView") @@ -135,11 +123,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.maskAllImages, false) XCTAssertEqual(actualOptions.sessionReplay.maskedViewClasses.count, 0) @@ -154,11 +138,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.maskAllText, true) assertContainsClass(classArray: actualOptions.sessionReplay.maskedViewClasses, stringClass: "RCTTextView") @@ -182,11 +162,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.maskAllText, false) XCTAssertEqual(actualOptions.sessionReplay.maskedViewClasses.count, 0) @@ -200,11 +176,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertTrue(actualOptions.sessionReplay.enableViewRendererV2) } @@ -218,11 +190,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertTrue(actualOptions.sessionReplay.enableViewRendererV2) } @@ -236,11 +204,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertFalse(actualOptions.sessionReplay.enableViewRendererV2) } @@ -253,11 +217,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertFalse(actualOptions.sessionReplay.enableFastViewRendering) } @@ -271,11 +231,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertTrue(actualOptions.sessionReplay.enableFastViewRendering) } @@ -289,15 +245,11 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertFalse(actualOptions.sessionReplay.enableFastViewRendering) } - + func testReplayQualityDefault() { let optionsDict = ([ "dsn": "https://abc@def.ingest.sentry.io/1234567", @@ -306,11 +258,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.quality, SentryReplayOptions.SentryReplayQuality.medium) } @@ -324,11 +272,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.quality, SentryReplayOptions.SentryReplayQuality.low) } @@ -342,11 +286,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.quality, SentryReplayOptions.SentryReplayQuality.medium) } @@ -360,11 +300,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.quality, SentryReplayOptions.SentryReplayQuality.high) } @@ -378,11 +314,7 @@ final class RNSentryReplayOptions: XCTestCase { RNSentryReplay.updateOptions(optionsDict) - #if CROSS_PLATFORM_TEST let actualOptions = try! SentryOptionsInternal.initWithDict(optionsDict as! [String: Any]) - #else - let actualOptions = try! Options(dict: optionsDict as! [String: Any]) - #endif XCTAssertEqual(actualOptions.sessionReplay.quality, SentryReplayOptions.SentryReplayQuality.medium) } diff --git a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.h b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.h index fa80410d6c..54e8504da0 100644 --- a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.h +++ b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.h @@ -3,12 +3,8 @@ @class SentryOptions; -#if CROSS_PLATFORM_TEST @interface SentrySDKInternal (PrivateTests) -#else -@interface -SentrySDK (PrivateTests) -#endif + + (nullable SentryOptions *)options; @end diff --git a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m index 2020a8e5a3..f6c989a455 100644 --- a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m +++ b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m @@ -465,13 +465,8 @@ - (void)prepareNativeFrameMocksWithLocalSymbolication:(BOOL)debug SentryOptions *sentryOptions = [[SentryOptions alloc] init]; sentryOptions.debug = debug; // no local symbolication -#if CROSS_PLATFORM_TEST id sentrySDKMock = OCMClassMock([SentrySDKInternal class]); OCMStub([(Class)sentrySDKMock options]).andReturn(sentryOptions); -#else - id sentrySDKMock = OCMClassMock([SentrySDK class]); - OCMStub([(Class)sentrySDKMock options]).andReturn(sentryOptions); -#endif id sentryDependencyContainerMock = OCMClassMock([SentryDependencyContainer class]); OCMStub(ClassMethod([sentryDependencyContainerMock sharedInstance])) diff --git a/packages/core/ios/RNSentry.h b/packages/core/ios/RNSentry.h index 9fb651929a..dc037bc86d 100644 --- a/packages/core/ios/RNSentry.h +++ b/packages/core/ios/RNSentry.h @@ -15,12 +15,7 @@ typedef int (*SymbolicateCallbackType)(const void *, Dl_info *); @class SentryOptions; @class SentryEvent; -#if CROSS_PLATFORM_TEST @interface SentrySDKInternal : NSObject -#else -@interface -SentrySDK (Private) -#endif @property (nonatomic, nullable, readonly, class) SentryOptions *options; @end diff --git a/packages/core/ios/RNSentry.mm b/packages/core/ios/RNSentry.mm index 108631766a..d483c5f520 100644 --- a/packages/core/ios/RNSentry.mm +++ b/packages/core/ios/RNSentry.mm @@ -29,15 +29,9 @@ #import #import #import -#import -#if __has_include() -# define USE_SENTRY_OPTIONS 1 -# import -#else -# define USE_SENTRY_OPTIONS 0 -# import -#endif +#import #import +#import // This guard prevents importing Hermes in JSC apps #if SENTRY_PROFILING_ENABLED @@ -169,13 +163,8 @@ - (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull) [RNSentryReplay updateOptions:mutableOptions]; #endif -#if USE_SENTRY_OPTIONS - SentryOptions *sentryOptions = [[SentryOptions alloc] initWithDict:mutableOptions - didFailWithError:errorPointer]; -#else SentryOptions *sentryOptions = [SentryOptionsInternal initWithDict:mutableOptions didFailWithError:errorPointer]; -#endif if (*errorPointer != nil) { return nil; } @@ -361,11 +350,7 @@ - (void)stopObserving - (NSDictionary *)fetchNativeStackFramesBy:(NSArray *)instructionsAddr symbolicate:(SymbolicateCallbackType)symbolicate { -#if CROSS_PLATFORM_TEST BOOL shouldSymbolicateLocally = [SentrySDKInternal.options debug]; -#else - BOOL shouldSymbolicateLocally = [SentrySDK.options debug]; -#endif NSString *appPackageName = [[NSBundle mainBundle] executablePath]; NSMutableSet *_Nonnull imagesAddrToRetrieveDebugMetaImages = From 8ae835db6875291a799d77e785e91c9980ad9d43 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 31 Jul 2025 17:56:44 +0300 Subject: [PATCH 03/12] Update sample app native initialisation example --- .../ios/SentryNativeInitialiser.h | 7 ++++ .../ios/SentryNativeInitialiser.m | 38 +++++++++++++++++++ .../project.pbxproj | 38 +++++++++++++++---- .../sentryreactnativesample/AppDelegate.mm | 35 +---------------- 4 files changed, 77 insertions(+), 41 deletions(-) create mode 100644 samples/react-native/ios/SentryNativeInitialiser.h create mode 100644 samples/react-native/ios/SentryNativeInitialiser.m diff --git a/samples/react-native/ios/SentryNativeInitialiser.h b/samples/react-native/ios/SentryNativeInitialiser.h new file mode 100644 index 0000000000..52dea75f6a --- /dev/null +++ b/samples/react-native/ios/SentryNativeInitialiser.h @@ -0,0 +1,7 @@ +#import + +@interface SentryNativeInitialiser : NSObject + ++ (void)initializeSentry; + +@end diff --git a/samples/react-native/ios/SentryNativeInitialiser.m b/samples/react-native/ios/SentryNativeInitialiser.m new file mode 100644 index 0000000000..a1d7b4a7aa --- /dev/null +++ b/samples/react-native/ios/SentryNativeInitialiser.m @@ -0,0 +1,38 @@ +#import "SentryNativeInitialiser.h" +@import Sentry; + +@implementation SentryNativeInitialiser + ++ (void)initializeSentry +{ + [SentrySDK startWithConfigureOptions:^(SentryOptions *options) { + // Only options set here will apply to the iOS SDK + // Options from JS are not passed to the iOS SDK when initialized manually + options.dsn = @"https://1df17bd4e543fdb31351dee1768bb679@o447951.ingest.sentry.io/5428561"; + options.debug = YES; // Enabled debug when first installing is always helpful + + options.beforeSend = ^SentryEvent *(SentryEvent *event) + { + // We don't want to send an event after startup that came from a Unhandled JS Exception + // of react native Because we sent it already before the app crashed. + if (nil != event.exceptions.firstObject.type && + [event.exceptions.firstObject.type rangeOfString:@"Unhandled JS Exception"].location + != NSNotFound) { + NSLog(@"Unhandled JS Exception"); + return nil; + } + + return event; + }; + + // Enable the App start and Frames tracking measurements + // If this is disabled the app start and frames tracking + // won't be passed from native to JS transactions + PrivateSentrySDKOnly.appStartMeasurementHybridSDKMode = true; +#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST + PrivateSentrySDKOnly.framesTrackingMeasurementHybridSDKMode = true; +#endif + }]; +} + +@end diff --git a/samples/react-native/ios/sentryreactnativesample.xcodeproj/project.pbxproj b/samples/react-native/ios/sentryreactnativesample.xcodeproj/project.pbxproj index 0d2f979cb0..f8d8003717 100644 --- a/samples/react-native/ios/sentryreactnativesample.xcodeproj/project.pbxproj +++ b/samples/react-native/ios/sentryreactnativesample.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 5ACADB1A9924EDD0850FACBA /* libPods-sentryreactnativesample-sentryreactnativesampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AFC2BCCFBDE2DC231B5C04E5 /* libPods-sentryreactnativesample-sentryreactnativesampleTests.a */; }; 723FB93385E08A7032AE82F4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 916F55A329D66130A4DFF319 /* PrivacyInfo.xcprivacy */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + AE3C91AE2E3BB9B400DC7C20 /* SentryNativeInitialiser.m in Sources */ = {isa = PBXBuildFile; fileRef = AE3C91AD2E3BB9B000DC7C20 /* SentryNativeInitialiser.m */; }; F998F5A3F1731876C4EDA235 /* libPods-sentryreactnativesample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CA08EE94AE203638B8C8B74B /* libPods-sentryreactnativesample.a */; }; /* End PBXBuildFile section */ @@ -49,6 +50,8 @@ 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = sentryreactnativesample/LaunchScreen.storyboard; sourceTree = ""; }; 89C6BE57DB24E9ADA2F236DE /* Pods-sentryreactnativesample-sentryreactnativesampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-sentryreactnativesample-sentryreactnativesampleTests.release.xcconfig"; path = "Target Support Files/Pods-sentryreactnativesample-sentryreactnativesampleTests/Pods-sentryreactnativesample-sentryreactnativesampleTests.release.xcconfig"; sourceTree = ""; }; 916F55A329D66130A4DFF319 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = sentryreactnativesample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + AE3C91AC2E3BB98B00DC7C20 /* SentryNativeInitialiser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryNativeInitialiser.h; sourceTree = ""; }; + AE3C91AD2E3BB9B000DC7C20 /* SentryNativeInitialiser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryNativeInitialiser.m; sourceTree = ""; }; AFC2BCCFBDE2DC231B5C04E5 /* libPods-sentryreactnativesample-sentryreactnativesampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-sentryreactnativesample-sentryreactnativesampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; CA08EE94AE203638B8C8B74B /* libPods-sentryreactnativesample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-sentryreactnativesample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; @@ -94,6 +97,8 @@ 13B07FAE1A68108700A75B9A /* sentryreactnativesample */ = { isa = PBXGroup; children = ( + AE3C91AD2E3BB9B000DC7C20 /* SentryNativeInitialiser.m */, + AE3C91AC2E3BB98B00DC7C20 /* SentryNativeInitialiser.h */, 338BBBC72B614FA10035844C /* NativePlatformSampleModule.h */, 338BBBC62B614FA10035844C /* NativePlatformSampleModule.mm */, 33E2D62929A7719600B5042B /* RCTAssetsModule.h */, @@ -289,10 +294,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample/Pods-sentryreactnativesample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample/Pods-sentryreactnativesample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample/Pods-sentryreactnativesample-frameworks.sh\"\n"; @@ -306,10 +315,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample-sentryreactnativesampleTests/Pods-sentryreactnativesample-sentryreactnativesampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample-sentryreactnativesampleTests/Pods-sentryreactnativesample-sentryreactnativesampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample-sentryreactnativesampleTests/Pods-sentryreactnativesample-sentryreactnativesampleTests-resources.sh\"\n"; @@ -382,10 +395,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample-sentryreactnativesampleTests/Pods-sentryreactnativesample-sentryreactnativesampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample-sentryreactnativesampleTests/Pods-sentryreactnativesample-sentryreactnativesampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample-sentryreactnativesampleTests/Pods-sentryreactnativesample-sentryreactnativesampleTests-frameworks.sh\"\n"; @@ -399,10 +416,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample/Pods-sentryreactnativesample-resources-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample/Pods-sentryreactnativesample-resources-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-sentryreactnativesample/Pods-sentryreactnativesample-resources.sh\"\n"; @@ -427,6 +448,7 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */, 338BBBC82B614FA10035844C /* NativePlatformSampleModule.mm in Sources */, 33E2D62A29A7719600B5042B /* RCTAssetsModule.m in Sources */, + AE3C91AE2E3BB9B400DC7C20 /* SentryNativeInitialiser.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -566,7 +588,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CC = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh"; + CC = ""; CCACHE_BINARY = /opt/homebrew/bin/ccache; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; @@ -595,7 +617,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh"; + CXX = ""; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; @@ -626,8 +648,8 @@ "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", ); IPHONEOS_DEPLOYMENT_TARGET = 15.1; - LD = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh"; - LDPLUSPLUS = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh"; + LD = ""; + LDPLUSPLUS = ""; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, "$(inherited)", @@ -663,7 +685,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CC = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh"; + CC = ""; CCACHE_BINARY = /opt/homebrew/bin/ccache; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; @@ -692,7 +714,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; - CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh"; + CXX = ""; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; @@ -716,8 +738,8 @@ "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", ); IPHONEOS_DEPLOYMENT_TARGET = 15.1; - LD = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh"; - LDPLUSPLUS = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh"; + LD = ""; + LDPLUSPLUS = ""; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, "$(inherited)", diff --git a/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm b/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm index aedb222cbc..fa894c27ee 100644 --- a/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm +++ b/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm @@ -13,6 +13,7 @@ # import #endif +#import "SentryNativeInitialiser.h" #import #import @@ -23,44 +24,12 @@ @implementation AppDelegate -- (void)initializeSentry -{ - [SentrySDK startWithConfigureOptions:^(SentryOptions *options) { - // Only options set here will apply to the iOS SDK - // Options from JS are not passed to the iOS SDK when initialized manually - options.dsn = @"https://1df17bd4e543fdb31351dee1768bb679@o447951.ingest.sentry.io/5428561"; - options.debug = YES; // Enabled debug when first installing is always helpful - - options.beforeSend = ^SentryEvent *(SentryEvent *event) - { - // We don't want to send an event after startup that came from a Unhandled JS Exception - // of react native Because we sent it already before the app crashed. - if (nil != event.exceptions.firstObject.type && - [event.exceptions.firstObject.type rangeOfString:@"Unhandled JS Exception"].location - != NSNotFound) { - NSLog(@"Unhandled JS Exception"); - return nil; - } - - return event; - }; - - // Enable the App start and Frames tracking measurements - // If this is disabled the app start and frames tracking - // won't be passed from native to JS transactions - PrivateSentrySDKOnly.appStartMeasurementHybridSDKMode = true; -#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST - PrivateSentrySDKOnly.framesTrackingMeasurementHybridSDKMode = true; -#endif - }]; -} - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // When the native init is enabled the `autoInitializeNativeSdk` // in JS has to be set to `false` - // [self initializeSentry]; + // [SentryNativeInitialiser initializeSentry]; self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; self.dependencyProvider = [RCTAppDependencyProvider new]; From 702b2fc8cc2e1af829cc9bfe61fd27d4c952ae14 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 31 Jul 2025 18:09:56 +0300 Subject: [PATCH 04/12] Remove unused imports --- samples/react-native/ios/sentryreactnativesample/AppDelegate.mm | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm b/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm index fa894c27ee..4f2827d872 100644 --- a/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm +++ b/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm @@ -14,8 +14,6 @@ #endif #import "SentryNativeInitialiser.h" -#import -#import @interface AppDelegate () { From ed6a296a5b4d15728eb3017390bfd746e46ca897 Mon Sep 17 00:00:00 2001 From: GitHub Date: Tue, 5 Aug 2025 12:21:40 +0000 Subject: [PATCH 05/12] chore: update scripts/update-cocoa.sh to 8.54.0 --- CHANGELOG.md | 6 ++++++ packages/core/RNSentry.podspec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf80f66ae2..9ae42a44e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ - Support Metro 0.83 ([#5035](https://github.com/getsentry/sentry-react-native/pull/5035)) +### Dependencies + +- Bump Cocoa SDK from v8.53.2 to v8.54.0 ([#5036](https://github.com/getsentry/sentry-react-native/pull/5036)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8540) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.53.2...8.54.0) + ## 6.19.0 ### Fixes diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 3413279979..74bd9abedd 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', '8.53.2' + s.dependency 'Sentry/HybridSDK', '8.54.0' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) From 54af75e1786405e1cafe1bc45f6a768b100a02ac Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 6 Aug 2025 11:10:30 +0300 Subject: [PATCH 06/12] Test with cocoa fix --- packages/core/RNSentry.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 74bd9abedd..8e258db3ae 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', '8.54.0' + s.dependency 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :commit => '8501613e1809f0e4d555230c3be39c28cb394a03' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) From c59bb69fe8a9ccc26d2022ec214efdfb85bf9d2b Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 6 Aug 2025 11:27:17 +0300 Subject: [PATCH 07/12] Trigger CI --- packages/core/RNSentry.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 8e258db3ae..5dea30334b 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -44,6 +44,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags + # Temporary cocoa reference for testing purposes s.dependency 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :commit => '8501613e1809f0e4d555230c3be39c28cb394a03' if defined? install_modules_dependencies From a67956f374aad99bf2164a9f550ea144a2121bbe Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 6 Aug 2025 11:46:28 +0300 Subject: [PATCH 08/12] Revert "Trigger CI" This reverts commit c59bb69fe8a9ccc26d2022ec214efdfb85bf9d2b. --- packages/core/RNSentry.podspec | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 5dea30334b..8e258db3ae 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -44,7 +44,6 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - # Temporary cocoa reference for testing purposes s.dependency 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :commit => '8501613e1809f0e4d555230c3be39c28cb394a03' if defined? install_modules_dependencies From d6c0afc17f9e3780156d7a6c44f6990cb4c0d671 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 6 Aug 2025 12:15:29 +0300 Subject: [PATCH 09/12] Revert "Test with cocoa fix" This reverts commit 54af75e1786405e1cafe1bc45f6a768b100a02ac. --- packages/core/RNSentry.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 8e258db3ae..74bd9abedd 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :commit => '8501613e1809f0e4d555230c3be39c28cb394a03' + s.dependency 'Sentry/HybridSDK', '8.54.0' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) From ef4dd63f36b7486c3f8f5f8af5f307322d7fb6db Mon Sep 17 00:00:00 2001 From: GitHub Date: Wed, 13 Aug 2025 07:48:25 +0000 Subject: [PATCH 10/12] chore: update scripts/update-cocoa.sh to 8.54.0 --- CHANGELOG.md | 3 +++ packages/core/RNSentry.podspec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ee8fbaae0..4dec1f261b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ - Bump Bundler Plugins from v4.0.2 to v4.1.0 ([#5062](https://github.com/getsentry/sentry-react-native/pull/5062)) - [changelog](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/main/CHANGELOG.md#410) - [diff](https://github.com/getsentry/sentry-javascript-bundler-plugins/compare/4.0.2...4.1.0) +- Bump Cocoa SDK from v8.53.2 to v8.54.0 ([#5036](https://github.com/getsentry/sentry-react-native/pull/5036)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8540) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.53.2...8.54.0) ## 6.19.0 diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index b78039a056..86659c97f4 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -46,7 +46,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', '8.53.2' + s.dependency 'Sentry/HybridSDK', '8.54.0' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) From 8956b09eefe4ec2ff5fc435a009a0fb422e29c3d Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 13 Aug 2025 11:41:27 +0300 Subject: [PATCH 11/12] Test with 8.54.1-alpha.1 --- packages/core/RNSentry.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 86659c97f4..d92870666f 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -46,7 +46,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', '8.54.0' + s.dependency 'Sentry/HybridSDK', '8.54.1-alpha.1' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) From 522c496d6063e393f4a33edba5ab4f75968f988c Mon Sep 17 00:00:00 2001 From: Itay Brenner Date: Wed, 13 Aug 2025 14:57:38 -0300 Subject: [PATCH 12/12] meta: Bump Sentry-cocoa dependency to 8.54.1-alpha.2 --- packages/core/RNSentry.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index d92870666f..a0a460aaf5 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -46,7 +46,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', '8.54.1-alpha.1' + s.dependency 'Sentry/HybridSDK', '8.54.1-alpha.2' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture)