Skip to content

Commit 658951f

Browse files
authored
Merge 5300cae into 781f560
2 parents 781f560 + 5300cae commit 658951f

File tree

4 files changed

+447
-42
lines changed

4 files changed

+447
-42
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
### Improvements
5353

5454
- Replace deprecated SCNetworkReachability with NWPathMonitor (#6019)
55+
- Expose attachment type on `SentryAttachment` for downstream SDKs (like sentry-godot) (#6521)
5556
- Increase attachment max size to 100MB (#6537)
5657

5758
## 8.57.0

Sources/Sentry/Public/SentryAttachment.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88

99
NS_ASSUME_NONNULL_BEGIN
1010

11+
/**
12+
* Attachment Type
13+
*/
14+
typedef NS_ENUM(NSInteger, SentryAttachmentType) {
15+
kSentryAttachmentTypeEventAttachment,
16+
kSentryAttachmentTypeViewHierarchy
17+
};
18+
1119
/**
1220
* You can use an attachment to store additional files alongside an event.
1321
*/
@@ -62,6 +70,30 @@ SENTRY_NO_INIT
6270
filename:(NSString *)filename
6371
contentType:(nullable NSString *)contentType;
6472

73+
/**
74+
* Initializes an attachment with data.
75+
* @param data The data for the attachment.
76+
* @param filename The name of the attachment to display in Sentry.
77+
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
78+
* @param attachmentType The type of the attachment. Default is @c "EventAttachment".
79+
*/
80+
- (instancetype)initWithData:(NSData *)data
81+
filename:(NSString *)filename
82+
contentType:(nullable NSString *)contentType
83+
attachmentType:(SentryAttachmentType)attachmentType;
84+
85+
/**
86+
* Initializes an attachment with data.
87+
* @param path The path of the file whose contents you want to upload to Sentry.
88+
* @param filename The name of the attachment to display in Sentry.
89+
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
90+
* @param attachmentType The type of the attachment. Default is@c "EventAttachment".
91+
*/
92+
- (instancetype)initWithPath:(NSString *)path
93+
filename:(NSString *)filename
94+
contentType:(nullable NSString *)contentType
95+
attachmentType:(SentryAttachmentType)attachmentType;
96+
6597
/**
6698
* The data of the attachment.
6799
*/
@@ -82,6 +114,11 @@ SENTRY_NO_INIT
82114
*/
83115
@property (readonly, nonatomic, copy, nullable) NSString *contentType;
84116

117+
/**
118+
* The type of the attachment.
119+
*/
120+
@property (readonly, nonatomic) SentryAttachmentType attachmentType;
121+
85122
@end
86123

87124
NS_ASSUME_NONNULL_END

Sources/Sentry/include/SentryAttachment+Private.h

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,8 @@ NS_ASSUME_NONNULL_BEGIN
66
FOUNDATION_EXPORT NSString *const kSentryAttachmentTypeNameEventAttachment;
77
FOUNDATION_EXPORT NSString *const kSentryAttachmentTypeNameViewHierarchy;
88

9-
/**
10-
* Attachment Type
11-
*/
12-
typedef NS_ENUM(NSInteger, SentryAttachmentType) {
13-
kSentryAttachmentTypeEventAttachment,
14-
kSentryAttachmentTypeViewHierarchy
15-
};
16-
179
NSString *nameForSentryAttachmentType(SentryAttachmentType attachmentType);
1810

1911
SentryAttachmentType typeForSentryAttachmentName(NSString *_Nullable name);
2012

21-
@interface SentryAttachment ()
22-
SENTRY_NO_INIT
23-
24-
/**
25-
* Initializes an attachment with data.
26-
* @param data The data for the attachment.
27-
* @param filename The name of the attachment to display in Sentry.
28-
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
29-
* @param attachmentType The type of the attachment. Default is @c "EventAttachment".
30-
*/
31-
- (instancetype)initWithData:(NSData *)data
32-
filename:(NSString *)filename
33-
contentType:(nullable NSString *)contentType
34-
attachmentType:(SentryAttachmentType)attachmentType;
35-
36-
/**
37-
* Initializes an attachment with data.
38-
* @param path The path of the file whose contents you want to upload to Sentry.
39-
* @param filename The name of the attachment to display in Sentry.
40-
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
41-
* @param attachmentType The type of the attachment. Default is@c "EventAttachment".
42-
*/
43-
- (instancetype)initWithPath:(NSString *)path
44-
filename:(NSString *)filename
45-
contentType:(nullable NSString *)contentType
46-
attachmentType:(SentryAttachmentType)attachmentType;
47-
48-
/**
49-
* The type of the attachment.
50-
*/
51-
@property (readonly, nonatomic) SentryAttachmentType attachmentType;
52-
53-
@end
54-
5513
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)