From 1909f941059ae0168678a8e81026bd566a962bc3 Mon Sep 17 00:00:00 2001 From: GitHub Date: Fri, 5 Sep 2025 08:07:02 +0000 Subject: [PATCH 1/3] chore: update scripts/update-cocoa.sh to 8.55.1 --- CHANGELOG.md | 3 +++ packages/core/RNSentry.podspec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85244c7772..4616d6cdea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ - Bump JavaScript SDK from v10.8.0 to v10.10.0 ([#5142](https://github.com/getsentry/sentry-react-native/pull/5142), [#5145](https://github.com/getsentry/sentry-react-native/pull/5145)) - [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#10100) - [diff](https://github.com/getsentry/sentry-javascript/compare/10.8.0...10.10.0) +- Bump Cocoa SDK from v8.53.2 to v8.55.1 ([#5036](https://github.com/getsentry/sentry-react-native/pull/5036)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8551) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.53.2...8.55.1) ## 7.0.1 diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index b78039a056..aff579cd9a 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.55.1' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) From 1243af4ae15238cfe1091be69352ab8884318702 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 5 Sep 2025 11:44:22 +0200 Subject: [PATCH 2/3] Removes temporary flags after Cocoa Bump (#5038) * Remove Cocoa Flags * Update sample app native initialisation example * Bump sample app tests to xcode 16.2 --------- Co-authored-by: GitHub Co-authored-by: LucasZF --- .github/workflows/sample-application.yml | 4 ++ .../RNSentryReplayOptionsTests.swift | 70 +------------------ .../RNSentryCocoaTesterTests/RNSentryTests.h | 6 +- .../RNSentryCocoaTesterTests/RNSentryTests.m | 5 -- packages/core/ios/RNSentry+fetchNativeStack.m | 5 +- packages/core/ios/RNSentry.h | 5 -- packages/core/ios/RNSentry.mm | 20 +----- .../ios/SentryNativeInitializer.h | 7 ++ .../ios/SentryNativeInitializer.m | 38 ++++++++++ .../project.pbxproj | 6 ++ .../sentryreactnativesample/AppDelegate.mm | 37 +--------- 11 files changed, 62 insertions(+), 141 deletions(-) create mode 100644 samples/react-native/ios/SentryNativeInitializer.h create mode 100644 samples/react-native/ios/SentryNativeInitializer.m diff --git a/.github/workflows/sample-application.yml b/.github/workflows/sample-application.yml index 0ca61647c5..764bf88a6d 100644 --- a/.github/workflows/sample-application.yml +++ b/.github/workflows/sample-application.yml @@ -43,6 +43,7 @@ jobs: build-type: ['dev', 'production'] include: - platform: ios + xcode-version: '16.2' runs-on: macos-14 - platform: macos runs-on: macos-15 @@ -84,6 +85,9 @@ jobs: - name: Gradle cache uses: gradle/gradle-build-action@v3 + - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer + if: ${{ matrix.platform == 'ios' }} + - name: Setup Global Xcode Tools if: ${{ matrix.platform == 'ios' }} run: which xcbeautify || brew install xcbeautify diff --git a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayOptionsTests.swift b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayOptionsTests.swift index ff3dccba6f..5dcd2be3ec 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.enableExperimentalViewRenderer) } @@ -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 b7940cad2b..9aa577f107 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+fetchNativeStack.m b/packages/core/ios/RNSentry+fetchNativeStack.m index 3e1f37a3b8..72515ff235 100644 --- a/packages/core/ios/RNSentry+fetchNativeStack.m +++ b/packages/core/ios/RNSentry+fetchNativeStack.m @@ -22,11 +22,8 @@ - (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 = diff --git a/packages/core/ios/RNSentry.h b/packages/core/ios/RNSentry.h index c13773f6c2..074c8f270e 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 326af7bb41..8d65efc5b3 100644 --- a/packages/core/ios/RNSentry.mm +++ b/packages/core/ios/RNSentry.mm @@ -28,16 +28,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 @@ -247,13 +240,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; } @@ -467,11 +455,7 @@ - (void)stopObserving contexts[@"os"] = os; } -#if CROSS_PLATFORM_TEST NSString *releaseName = SentrySDKInternal.options.releaseName; -#else - NSString *releaseName = [SentrySDK options].releaseName; -#endif if (releaseName) { contexts[@"release"] = releaseName; } diff --git a/samples/react-native/ios/SentryNativeInitializer.h b/samples/react-native/ios/SentryNativeInitializer.h new file mode 100644 index 0000000000..9d0c2b1d1a --- /dev/null +++ b/samples/react-native/ios/SentryNativeInitializer.h @@ -0,0 +1,7 @@ +#import + +@interface SentryNativeInitializer : NSObject + ++ (void)initializeSentry; + +@end diff --git a/samples/react-native/ios/SentryNativeInitializer.m b/samples/react-native/ios/SentryNativeInitializer.m new file mode 100644 index 0000000000..20a4bcaa44 --- /dev/null +++ b/samples/react-native/ios/SentryNativeInitializer.m @@ -0,0 +1,38 @@ +#import "SentryNativeInitializer.h" +@import Sentry; + +@implementation SentryNativeInitializer + ++ (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..1350418ccb 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 /* SentryNativeInitializer.m in Sources */ = {isa = PBXBuildFile; fileRef = AE3C91AD2E3BB9B000DC7C20 /* SentryNativeInitializer.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 /* SentryNativeInitializer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryNativeInitializer.h; sourceTree = ""; }; + AE3C91AD2E3BB9B000DC7C20 /* SentryNativeInitializer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryNativeInitializer.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 /* SentryNativeInitializer.m */, + AE3C91AC2E3BB98B00DC7C20 /* SentryNativeInitializer.h */, 338BBBC72B614FA10035844C /* NativePlatformSampleModule.h */, 338BBBC62B614FA10035844C /* NativePlatformSampleModule.mm */, 33E2D62929A7719600B5042B /* RCTAssetsModule.h */, @@ -427,6 +432,7 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */, 338BBBC82B614FA10035844C /* NativePlatformSampleModule.mm in Sources */, 33E2D62A29A7719600B5042B /* RCTAssetsModule.m in Sources */, + AE3C91AE2E3BB9B400DC7C20 /* SentryNativeInitializer.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm b/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm index aedb222cbc..0df8934ff1 100644 --- a/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm +++ b/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm @@ -13,8 +13,7 @@ # import #endif -#import -#import +#import "SentryNativeInitializer.h" @interface AppDelegate () { @@ -23,44 +22,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]; + // [SentryNativeInitializer initializeSentry]; self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; self.dependencyProvider = [RCTAppDependencyProvider new]; From 933d0fb791e63add9b97df1def9ab7e340705d6c Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 5 Sep 2025 11:44:55 +0200 Subject: [PATCH 3/3] chore(ci): Fixes iOS binary size diff failure (#5144) * chore: update scripts/update-cocoa.sh to 8.54.0 * Remove Cocoa Flags * Update sample app native initialisation example * Remove unused imports * chore: update scripts/update-cocoa.sh to 8.54.0 * Test with cocoa fix * Trigger CI * Revert "Trigger CI" This reverts commit c59bb69fe8a9ccc26d2022ec214efdfb85bf9d2b. * Revert "Test with cocoa fix" This reverts commit 54af75e1786405e1cafe1bc45f6a768b100a02ac. * chore: update scripts/update-cocoa.sh to 8.54.0 * Test with 8.54.1-alpha.1 * Test with 8.54.1-apha.2 * trigger ci * chore: update scripts/update-cocoa.sh to 8.55.0 * chore: update scripts/update-cocoa.sh to 8.55.0 * Remove duplicate changelog Co-authored-by: LucasZF * ref: Rename SentryNativeInitialiser to SentryNativeInitializer * Revert unneeded changes * chore: update scripts/update-cocoa.sh to 8.55.0 * chore: update scripts/update-cocoa.sh to 8.55.0 * chore: update scripts/update-cocoa.sh to 8.55.0 * Set SDK_V9=0 * Revert "Set SDK_V9=0" This reverts commit 8f067d0d610b891597a6dc6c36610bd692fa8c9a. * Set SDK_V9=0 in sample app dev build * Revert "Set SDK_V9=0 in sample app dev build" This reverts commit bc32ea1ac932fa78c3e4583fe86d0ec516e2b52e. * Reapply "Set SDK_V9=0 in sample app dev build" This reverts commit d0f56da41ba63e4a63a37ab4aa9d86e358461a63. * Revert "Reapply "Set SDK_V9=0 in sample app dev build"" This reverts commit e9deb8274d5b67fd920b85ab78c8b420bf3d174b. * chore: update scripts/update-cocoa.sh to 8.55.0 * chore: update scripts/update-cocoa.sh to 8.55.0 * Remove changelog duplication * Remove flags * chore: update scripts/update-cocoa.sh to 8.55.0 * test without bundler-cache * Revert "test without bundler-cache" This reverts commit 32601ac1c3fa7a84f1a14f9d457620184529499c. * Try force disabling sdk-v9 * Revert "Try force disabling sdk-v9" This reverts commit 55c7ed564c5d91b6b58fc7d1774886749fbce7ae. * chore: update scripts/update-cocoa.sh to 8.55.0 * Test with xcode 16.2 * chore(ci): Fixes iOS binary size diff failure --------- Co-authored-by: GitHub Co-authored-by: LucasZF --- performance-tests/metrics-ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/performance-tests/metrics-ios.yml b/performance-tests/metrics-ios.yml index 6210780f8f..f29781987f 100644 --- a/performance-tests/metrics-ios.yml +++ b/performance-tests/metrics-ios.yml @@ -11,4 +11,4 @@ startupTimeTest: binarySizeTest: diffMin: 600 KiB - diffMax: 1300 KiB + diffMax: 1400 KiB