88
99NS_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
87124NS_ASSUME_NONNULL_END
0 commit comments