Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
### Improvements

- Replace deprecated SCNetworkReachability with NWPathMonitor (#6019)
- Enable ViewHierarchy attachments for downstream SDKs (like sentry-godot) (#6521)

## 8.57.0

Expand Down
4 changes: 4 additions & 0 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@
D8FFE50C2703DBB400607131 /* SwizzlingCallTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FFE50B2703DAAE00607131 /* SwizzlingCallTests.swift */; };
F40E42352EA1887000E53876 /* SentryFramesTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F40E42342EA1887000E53876 /* SentryFramesTracker.swift */; };
F40E423C2EA18E8000E53876 /* SentryDelayedFramesTrackerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F40E423B2EA18E8000E53876 /* SentryDelayedFramesTrackerWrapper.swift */; };
F40E42FB2EAAAD4500E53876 /* PrivateSentrySDKOnlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F40E42FA2EAAAD4500E53876 /* PrivateSentrySDKOnlyTests.swift */; };
F41362112E1C55AF00B84443 /* SentryScopePersistentStore+Tags.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41362102E1C55AF00B84443 /* SentryScopePersistentStore+Tags.swift */; };
F41362132E1C566100B84443 /* SentryScopePersistentStore+User.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41362122E1C566100B84443 /* SentryScopePersistentStore+User.swift */; };
F41362152E1C568400B84443 /* SentryScopePersistentStore+Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41362142E1C568400B84443 /* SentryScopePersistentStore+Context.swift */; };
Expand Down Expand Up @@ -2357,6 +2358,7 @@
D8FFE50B2703DAAE00607131 /* SwizzlingCallTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwizzlingCallTests.swift; sourceTree = "<group>"; };
F40E42342EA1887000E53876 /* SentryFramesTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryFramesTracker.swift; sourceTree = "<group>"; };
F40E423B2EA18E8000E53876 /* SentryDelayedFramesTrackerWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryDelayedFramesTrackerWrapper.swift; sourceTree = "<group>"; };
F40E42FA2EAAAD4500E53876 /* PrivateSentrySDKOnlyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivateSentrySDKOnlyTests.swift; sourceTree = "<group>"; };
F41362102E1C55AF00B84443 /* SentryScopePersistentStore+Tags.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryScopePersistentStore+Tags.swift"; sourceTree = "<group>"; };
F41362122E1C566100B84443 /* SentryScopePersistentStore+User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryScopePersistentStore+User.swift"; sourceTree = "<group>"; };
F41362142E1C568400B84443 /* SentryScopePersistentStore+Context.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryScopePersistentStore+Context.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3060,6 +3062,7 @@
92235CAF2E155B2600865983 /* SentryLoggerTests.swift */,
928BED2A2E16977A00B4D398 /* SentryLogBatcherTests.swift */,
F49D41992DEA2FB000D9244E /* SentryCrashExceptionApplicationTests.swift */,
F40E42FA2EAAAD4500E53876 /* PrivateSentrySDKOnlyTests.swift */,
7B6438AD26A710E6000D0F65 /* Categories */,
D8BC28D32C00C6A60054DA4D /* Extensions */,
7BD7299B24654CD500EA3610 /* Helper */,
Expand Down Expand Up @@ -6395,6 +6398,7 @@
D8B76B062808066D000A58C4 /* SentryScreenshotIntegrationTests.swift in Sources */,
7B8CA85726DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift in Sources */,
D452FE6D2DDC873A00AFF56F /* SentryWatchdogTerminationAttributesProcessorTests.swift in Sources */,
F40E42FB2EAAAD4500E53876 /* PrivateSentrySDKOnlyTests.swift in Sources */,
7BAF3DD2243DD05C008A5414 /* SentryTransportInitializerTests.swift in Sources */,
7B68D93625FF5F1A0082D139 /* SentryAppState+Equality.m in Sources */,
7B5CAF7E27F5AD3500ED0DB6 /* TestNSURLRequestBuilder.m in Sources */,
Expand Down
13 changes: 13 additions & 0 deletions Sources/Sentry/PrivateSentrySDKOnly.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "PrivateSentrySDKOnly.h"
#import "SentryAppStartMeasurement.h"
#import "SentryAttachment+Private.h"
#import "SentryBreadcrumb+Private.h"
#import "SentryClient.h"
#import "SentryHub+Private.h"
Expand Down Expand Up @@ -302,6 +303,18 @@ + (SentryBreadcrumb *)breadcrumbWithDictionary:(NSDictionary *)dictionary
return [[SentryBreadcrumb alloc] initWithDictionary:dictionary];
}

+ (void)addViewHierarchyAttachment:(NSString *)path
{
SentryAttachment *attachment =
[[SentryAttachment alloc] initWithPath:path
filename:@"view-hierarchy.json"
contentType:@"application/json"
attachmentType:kSentryAttachmentTypeViewHierarchy];

[SentrySDKInternal.currentHub
configureScope:^(SentryScope *scope) { [scope addAttachment:attachment]; }];
}

#if SENTRY_TARGET_REPLAY_SUPPORTED

+ (UIView *)sessionReplayMaskingOverlay:(id<SentryRedactOptions>)options
Expand Down
13 changes: 13 additions & 0 deletions Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,19 @@ typedef void (^SentryOnAppStartMeasurementAvailable)(

+ (SentryBreadcrumb *)breadcrumbWithDictionary:(NSDictionary *)dictionary;

/**
* Adds an view attachment to the Scope's list of attachments.
* File is not read until an event needs to be sent.
* The view hierarchy json should follow the representation defined in RFC#33
* https://github.com/getsentry/rfcs/blob/main/text/0033-view-hierarchy.md
*
* This method is intended for downstream SDKs like sentry-godot which havbe a custom view hierarchy
* logic.
*
* @param path The path to the view-hierarchy.json file
*/
+ (void)addViewHierarchyAttachment:(NSString *)path;

@end

NS_ASSUME_NONNULL_END
Loading
Loading