Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6b861fe
Convert `SentryReachability` to Swift
itaybre Aug 29, 2025
d0fdbf6
Update SDK API
itaybre Aug 29, 2025
0ddbca0
Update SentrySwift.h
itaybre Aug 29, 2025
7c9cc57
Update SentryReachability
itaybre Aug 29, 2025
203fcb6
Merge branch 'main' into itay/cocoa-533-convert-sentryreachability-to…
itaybre Aug 29, 2025
a7542a4
Remove unnecessary public signature
itaybre Aug 29, 2025
a2b516d
Merge branch 'itay/cocoa-533-convert-sentryreachability-to-swift' of …
itaybre Aug 29, 2025
e5422d3
Fix compile error on Xcode 14
itaybre Aug 29, 2025
c63a997
Use nil context
itaybre Aug 29, 2025
adaea94
Merge branch 'main' into itay/cocoa-533-convert-sentryreachability-to…
itaybre Sep 1, 2025
f35fc70
Fix build issue
itaybre Sep 1, 2025
05e9251
Merge branch 'itay/cocoa-533-convert-sentryreachability-to-swift' of …
itaybre Sep 1, 2025
c197ce5
Merge branch 'main' into itay/cocoa-533-convert-sentryreachability-to…
itaybre Sep 1, 2025
cb96bfa
Use NWPathMonitor for iOS12+
itaybre Sep 3, 2025
62f0e70
Use NSLock
itaybre Sep 4, 2025
18c3ac3
Merge branch 'main' of github.com:getsentry/sentry-cocoa into itay/co…
itaybre Sep 5, 2025
f2edc81
Update sdk_api.json
itaybre Sep 5, 2025
bc57b17
Fix build on iOS 16
itaybre Sep 5, 2025
3d18bf3
Add missing fix
itaybre Sep 5, 2025
ef2837b
Add missing fix
itaybre Sep 5, 2025
630ff02
Merge branch 'main' into itay/cocoa-533-convert-sentryreachability-to…
itaybre Sep 5, 2025
e54c73b
Merge branch 'main' into itay/cocoa-533-convert-sentryreachability-to…
itaybre Sep 9, 2025
1761d92
Fix SauceLabs tests
itaybre Sep 10, 2025
d8b7e03
Merge branch 'itay/cocoa-533-convert-sentryreachability-to-swift' of …
itaybre Sep 10, 2025
5de0617
Remove `SENTRY_HAS_REACHABILITY` macro and enable SentryReachability …
itaybre Sep 10, 2025
c535c23
Remove async queue requirement
itaybre Sep 11, 2025
07abf89
Merge branch 'main' of github.com:getsentry/sentry-cocoa into itay/co…
itaybre Oct 3, 2025
9438e65
Merge branch 'main' of github.com:getsentry/sentry-cocoa into itay/co…
itaybre Oct 7, 2025
849d04b
Add missing import
itaybre Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@
0A9BF4E928A125390068D266 /* TestSentryViewHierarchyProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9BF4E628A123270068D266 /* TestSentryViewHierarchyProvider.swift */; };
0A9BF4EB28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9BF4EA28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift */; };
0A9E917128DC7E7000FB4182 /* SentryInternalCDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A9E917028DC7E7000FB4182 /* SentryInternalCDefines.h */; };
0AAE201E28ED9B9400D0CD80 /* SentryReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AAE201D28ED9B9400D0CD80 /* SentryReachability.m */; };
0AAE202128ED9BCC00D0CD80 /* SentryReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AAE202028ED9BCC00D0CD80 /* SentryReachability.h */; };
0ADC33F128D9BE940078D980 /* TestSentryUIDeviceWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ADC33EF28D9BE690078D980 /* TestSentryUIDeviceWrapper.swift */; };
0AE455AD28F584D2006680E5 /* SentryReachabilityTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AE455AC28F584D2006680E5 /* SentryReachabilityTests.m */; };
15360CCF2432777500112302 /* SentrySessionTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 15360CCE2432777400112302 /* SentrySessionTracker.m */; };
15360CD2243277A000112302 /* SentrySessionTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 15360CD12432779F00112302 /* SentrySessionTracker.h */; };
15360CD62432832400112302 /* SentryAutoSessionTrackingIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = 15360CD52432832400112302 /* SentryAutoSessionTrackingIntegration.m */; };
Expand Down Expand Up @@ -1001,6 +998,7 @@
F48F75712E5FA630009D4E7D /* SentryBinaryImageCacheCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = F48F75702E5FA630009D4E7D /* SentryBinaryImageCacheCallbacks.m */; };
F48F75732E5FA649009D4E7D /* SentryBinaryImageCacheCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = F48F75722E5FA649009D4E7D /* SentryBinaryImageCacheCallbacks.h */; };
F48F767C2E60B555009D4E7D /* SentryNSTimerFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48F767B2E60B555009D4E7D /* SentryNSTimerFactory.swift */; };
F48F78692E61DE28009D4E7D /* SentryReachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48F78682E61DE28009D4E7D /* SentryReachability.swift */; };
F49236EB2E5E4B2F00663673 /* SentryBinaryImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = F49236EA2E5E4B2F00663673 /* SentryBinaryImageCache.swift */; };
F49D41982DEA27AF00D9244E /* SentryUseNSExceptionCallstackWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F49D41972DEA27AF00D9244E /* SentryUseNSExceptionCallstackWrapperTests.swift */; };
F49D419A2DEA2FB000D9244E /* SentryCrashExceptionApplicationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F49D41992DEA2FB000D9244E /* SentryCrashExceptionApplicationTests.swift */; };
Expand Down Expand Up @@ -1280,10 +1278,7 @@
0A9BF4E628A123270068D266 /* TestSentryViewHierarchyProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryViewHierarchyProvider.swift; sourceTree = "<group>"; };
0A9BF4EA28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewHierarchyIntegrationTests.swift; sourceTree = "<group>"; };
0A9E917028DC7E7000FB4182 /* SentryInternalCDefines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryInternalCDefines.h; path = include/SentryInternalCDefines.h; sourceTree = "<group>"; };
0AAE201D28ED9B9400D0CD80 /* SentryReachability.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryReachability.m; sourceTree = "<group>"; };
0AAE202028ED9BCC00D0CD80 /* SentryReachability.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryReachability.h; path = include/SentryReachability.h; sourceTree = "<group>"; };
0ADC33EF28D9BE690078D980 /* TestSentryUIDeviceWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryUIDeviceWrapper.swift; sourceTree = "<group>"; };
0AE455AC28F584D2006680E5 /* SentryReachabilityTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryReachabilityTests.m; sourceTree = "<group>"; };
15360CCE2432777400112302 /* SentrySessionTracker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentrySessionTracker.m; sourceTree = "<group>"; };
15360CD12432779F00112302 /* SentrySessionTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySessionTracker.h; path = include/SentrySessionTracker.h; sourceTree = "<group>"; };
15360CD52432832400112302 /* SentryAutoSessionTrackingIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryAutoSessionTrackingIntegration.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2341,6 +2336,7 @@
F48F75702E5FA630009D4E7D /* SentryBinaryImageCacheCallbacks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryBinaryImageCacheCallbacks.m; sourceTree = "<group>"; };
F48F75722E5FA649009D4E7D /* SentryBinaryImageCacheCallbacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryBinaryImageCacheCallbacks.h; path = ../../Sentry/include/SentryBinaryImageCacheCallbacks.h; sourceTree = "<group>"; };
F48F767B2E60B555009D4E7D /* SentryNSTimerFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNSTimerFactory.swift; sourceTree = "<group>"; };
F48F78682E61DE28009D4E7D /* SentryReachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryReachability.swift; sourceTree = "<group>"; };
F49236EA2E5E4B2F00663673 /* SentryBinaryImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryBinaryImageCache.swift; sourceTree = "<group>"; };
F49D41972DEA27AF00D9244E /* SentryUseNSExceptionCallstackWrapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUseNSExceptionCallstackWrapperTests.swift; sourceTree = "<group>"; };
F49D41992DEA2FB000D9244E /* SentryCrashExceptionApplicationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashExceptionApplicationTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2671,8 +2667,6 @@
638DC99F1EBC6B6400A66E41 /* SentryRequestOperation.m */,
7BDB03B6251364F800BAE198 /* _SentryDispatchQueueWrapperInternal.h */,
7BDB03BA2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m */,
0AAE202028ED9BCC00D0CD80 /* SentryReachability.h */,
0AAE201D28ED9B9400D0CD80 /* SentryReachability.m */,
);
name = Networking;
sourceTree = "<group>";
Expand Down Expand Up @@ -3519,7 +3513,6 @@
7B01CE3C271993AB00B5AF31 /* SentryTransportFactoryTests.swift */,
7B5CAF7C27F5AD0600ED0DB6 /* TestNSURLRequestBuilder.h */,
7B5CAF7D27F5AD3500ED0DB6 /* TestNSURLRequestBuilder.m */,
0AE455AC28F584D2006680E5 /* SentryReachabilityTests.m */,
629690522AD3E060000185FA /* SentryReachabilitySwiftTests.swift */,
0A9415B928F96CAC006A5DD1 /* TestSentryReachability.swift */,
D4FC68192DD63465001B74FF /* SentryDispatchQueueWrapperTests.m */,
Expand Down Expand Up @@ -4709,6 +4702,7 @@
F429D3992E85360F00DBF387 /* RetryAfterHeaderParser.swift */,
F429D37D2E8532A300DBF387 /* HttpDateParser.swift */,
F429D3A82E8562EF00DBF387 /* RateLimitParser.swift */,
F48F78682E61DE28009D4E7D /* SentryReachability.swift */,
);
path = Networking;
sourceTree = "<group>";
Expand Down Expand Up @@ -4988,7 +4982,6 @@
D8739D172BEEA33F007D2F66 /* SentryLevelHelper.h in Headers */,
8E4A037825F6F52100000D77 /* SentrySampleDecision.h in Headers */,
63FE717920DA4C1100CDBAE8 /* SentryCrashReportStore.h in Headers */,
0AAE202128ED9BCC00D0CD80 /* SentryReachability.h in Headers */,
A839D89824864B80003B7AFD /* SentrySystemEventBreadcrumbs.h in Headers */,
7B14089624878F090035403D /* SentryCrashStackEntryMapper.h in Headers */,
63FE714920DA4C1100CDBAE8 /* SentryCrashStackCursor_Backtrace.h in Headers */,
Expand Down Expand Up @@ -5582,6 +5575,7 @@
7B8713B426415BAA006D6004 /* SentryAppStartTracker.m in Sources */,
7BDB03BB2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m in Sources */,
FA6FC0A32E0B5ACE00ED2669 /* SentrySdkPackage.swift in Sources */,
F48F78692E61DE28009D4E7D /* SentryReachability.swift in Sources */,
D8739D142BEE5049007D2F66 /* SentryRRWebSpanEvent.swift in Sources */,
FAAB2F972E4D345800FE8B7E /* SentryUIDeviceWrapper.swift in Sources */,
7B6C5EDE264E8DF00010D138 /* SentryFramesTracker.m in Sources */,
Expand Down Expand Up @@ -5740,7 +5734,6 @@
7DB3A687238EA75E00A2D442 /* SentryHttpTransport.m in Sources */,
63FE70D520DA4C1000CDBAE8 /* SentryCrashMonitor_NSException.m in Sources */,
62F70E952D423BCD00634054 /* SentryMechanismCodable.swift in Sources */,
0AAE201E28ED9B9400D0CD80 /* SentryReachability.m in Sources */,
6283085F2D50AA8C00EAEF77 /* SentryMessage.swift in Sources */,
7BC63F0A28081288009D9E37 /* SentrySwizzleWrapper.m in Sources */,
6276350C2D59FACC00F7CEF6 /* SentryEventDecoder.swift in Sources */,
Expand Down Expand Up @@ -6231,7 +6224,6 @@
D808FB92281BF6EC009A2A33 /* SentryUIEventTrackingIntegrationTests.swift in Sources */,
7BC6EC04255C235F0059822A /* SentryFrameTests.swift in Sources */,
D82DD1CD2BEEB1A0001AB556 /* SentrySRDefaultBreadcrumbConverterTests.swift in Sources */,
0AE455AD28F584D2006680E5 /* SentryReachabilityTests.m in Sources */,
63FE720420DA66EC00CDBAE8 /* SentryCrashString_Tests.m in Sources */,
62872B632BA1B86100A4FA7D /* LocksTests.swift in Sources */,
849AC40029E0C1FF00889C16 /* SentryFormatterTests.swift in Sources */,
Expand Down
1 change: 0 additions & 1 deletion SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#import "SentryLogC.h"
#import "SentryNetworkTracker.h"
#import "SentryPerformanceTracker+Testing.h"
#import "SentryReachability.h"
#import "SentrySDK+Private.h"
#import "SentrySDKInternal+Tests.h"
#import "SentryScopeSyncC.h"
Expand Down
6 changes: 0 additions & 6 deletions Sources/Sentry/Public/SentryDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@
-(instancetype)init NS_UNAVAILABLE; \
+(instancetype) new NS_UNAVAILABLE;

#if !TARGET_OS_WATCH && !(TARGET_OS_VISION && SENTRY_NO_UIKIT == 1)
# define SENTRY_HAS_REACHABILITY 1
#else
# define SENTRY_HAS_REACHABILITY 0
#endif

@class SentryBreadcrumb;
@class SentryEvent;
@class SentrySamplingContext;
Expand Down
15 changes: 1 addition & 14 deletions Sources/Sentry/SentryBreadcrumbTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#import "SentryHub.h"
#import "SentryInternalDefines.h"
#import "SentryLogC.h"
#import "SentryReachability.h"
#import "SentryScope.h"
#import "SentrySwift.h"
#import "SentrySwizzle.h"
Expand All @@ -26,10 +25,7 @@
static NSString *const SentryBreadcrumbTrackerSwizzleSendAction
= @"SentryBreadcrumbTrackerSwizzleSendAction";

@interface SentryBreadcrumbTracker ()
#if SENTRY_HAS_REACHABILITY
<SentryReachabilityObserver>
#endif // !TARGET_OS_WATCH
@interface SentryBreadcrumbTracker () <SentryReachabilityObserver>

@property (nonatomic, weak) id<SentryBreadcrumbDelegate> delegate;

Expand All @@ -39,12 +35,10 @@ @implementation SentryBreadcrumbTracker {
BOOL _reportAccessibilityIdentifier;
}

#if SENTRY_HAS_REACHABILITY
- (void)dealloc
{
[SentryDependencyContainer.sharedInstance.reachability removeObserver:self];
}
#endif // !TARGET_OS_WATCH

- (instancetype)initReportAccessibilityIdentifier:(BOOL)report
{
Expand All @@ -59,9 +53,7 @@ - (void)startWithDelegate:(id<SentryBreadcrumbDelegate>)delegate
_delegate = delegate;
[self addEnabledCrumb];
[self trackApplicationNotifications];
#if SENTRY_HAS_REACHABILITY
[self trackNetworkConnectivityChanges];
#endif // !TARGET_OS_WATCH
}

#if SENTRY_HAS_UIKIT
Expand All @@ -81,9 +73,7 @@ - (void)stop
removeSwizzleSendActionForKey:SentryBreadcrumbTrackerSwizzleSendAction];
#endif // SENTRY_HAS_UIKIT
_delegate = nil;
#if SENTRY_HAS_REACHABILITY
[self stopTrackNetworkConnectivityChanges];
#endif // !TARGET_OS_WATCH
}

- (void)trackApplicationNotifications
Expand Down Expand Up @@ -143,7 +133,6 @@ - (void)trackApplicationNotifications
#endif // SENTRY_HAS_UIKIT || SENTRY_TARGET_MACOS_HAS_UI
}

#if SENTRY_HAS_REACHABILITY
- (void)trackNetworkConnectivityChanges
{
[SentryDependencyContainer.sharedInstance.reachability addObserver:self];
Expand All @@ -163,8 +152,6 @@ - (void)connectivityChanged:(BOOL)connected typeDescription:(nonnull NSString *)
[self.delegate addBreadcrumb:crumb];
}

#endif // !TARGET_OS_WATCH

- (void)addBreadcrumbWithType:(NSString *)type
withCategory:(NSString *)category
withLevel:(SentryLevel)level
Expand Down
8 changes: 0 additions & 8 deletions Sources/Sentry/SentryDependencyContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
# import <SentryWatchdogTerminationBreadcrumbProcessor.h>
#endif // SENTRY_HAS_UIKIT

#if !TARGET_OS_WATCH
# import "SentryReachability.h"
#endif // !TARGET_OS_WATCH

/**
* Macro for implementing lazy initialization with a double-checked lock. The double-checked lock
* speeds up the dependency retrieval by around 5%, so it's worth having it. Measured with
Expand Down Expand Up @@ -123,9 +119,7 @@ + (instancetype)sharedInstance
+ (void)reset
{
@synchronized(sentryDependencyContainerInstanceLock) {
#if SENTRY_HAS_REACHABILITY
[instance->_reachability removeAllObservers];
#endif // !TARGET_OS_WATCH

#if SENTRY_HAS_UIKIT
[instance->_framesTracker stop];
Expand Down Expand Up @@ -189,9 +183,7 @@ - (instancetype)init
andRateLimitParser:rateLimitParser
currentDateProvider:_dateProvider];

#if SENTRY_HAS_REACHABILITY
_reachability = [[SentryReachability alloc] init];
#endif // !SENTRY_HAS_REACHABILITY

isInitialializingDependencyContainer = NO;
}
Expand Down
13 changes: 1 addition & 12 deletions Sources/Sentry/SentryHttpTransport.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@
#import "SentrySerialization.h"
#import "SentrySwift.h"

#if !TARGET_OS_WATCH
# import "SentryReachability.h"
#endif // !TARGET_OS_WATCH

@interface SentryHttpTransport ()
#if SENTRY_HAS_REACHABILITY
<SentryReachabilityObserver>
#endif // !TARGET_OS_WATCH
@interface SentryHttpTransport () <SentryReachabilityObserver>

@property (nonatomic, readonly) NSTimeInterval cachedEnvelopeSendDelay;
@property (nonatomic, strong) SentryFileManager *fileManager;
Expand Down Expand Up @@ -99,14 +92,11 @@ - (id)initWithDsn:(SentryDsn *)dsn

[self sendAllCachedEnvelopes];

#if SENTRY_HAS_REACHABILITY
[SentryDependencyContainer.sharedInstance.reachability addObserver:self];
#endif // !TARGET_OS_WATCH
}
return self;
}

#if SENTRY_HAS_REACHABILITY
- (void)connectivityChanged:(BOOL)connected typeDescription:(nonnull NSString *)typeDescription
{
if (connected) {
Expand All @@ -121,7 +111,6 @@ - (void)dealloc
{
[SentryDependencyContainer.sharedInstance.reachability removeObserver:self];
}
#endif // !TARGET_OS_WATCH

- (void)sendEnvelope:(SentryEnvelope *)envelope
{
Expand Down
Loading
Loading