Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -48,6 +48,7 @@
### Improvements

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

## 8.57.0
Expand Down
37 changes: 37 additions & 0 deletions Sources/Sentry/Public/SentryAttachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

NS_ASSUME_NONNULL_BEGIN

/**
* Attachment Type
*/
typedef NS_ENUM(NSInteger, SentryAttachmentType) {
kSentryAttachmentTypeEventAttachment,
kSentryAttachmentTypeViewHierarchy
};

/**
* You can use an attachment to store additional files alongside an event.
*/
Expand Down Expand Up @@ -62,6 +70,30 @@ SENTRY_NO_INIT
filename:(NSString *)filename
contentType:(nullable NSString *)contentType;

/**
* Initializes an attachment with data.
* @param data The data for the attachment.
* @param filename The name of the attachment to display in Sentry.
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
* @param attachmentType The type of the attachment. Default is @c "EventAttachment".
*/
- (instancetype)initWithData:(NSData *)data
filename:(NSString *)filename
contentType:(nullable NSString *)contentType
attachmentType:(SentryAttachmentType)attachmentType;

/**
* Initializes an attachment with data.
* @param path The path of the file whose contents you want to upload to Sentry.
* @param filename The name of the attachment to display in Sentry.
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
* @param attachmentType The type of the attachment. Default is@c "EventAttachment".
*/
- (instancetype)initWithPath:(NSString *)path
filename:(NSString *)filename
contentType:(nullable NSString *)contentType
attachmentType:(SentryAttachmentType)attachmentType;

/**
* The data of the attachment.
*/
Expand All @@ -82,6 +114,11 @@ SENTRY_NO_INIT
*/
@property (readonly, nonatomic, copy, nullable) NSString *contentType;

/**
* The type of the attachment.
*/
@property (readonly, nonatomic) SentryAttachmentType attachmentType;

@end

NS_ASSUME_NONNULL_END
42 changes: 0 additions & 42 deletions Sources/Sentry/include/SentryAttachment+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,8 @@ NS_ASSUME_NONNULL_BEGIN
FOUNDATION_EXPORT NSString *const kSentryAttachmentTypeNameEventAttachment;
FOUNDATION_EXPORT NSString *const kSentryAttachmentTypeNameViewHierarchy;

/**
* Attachment Type
*/
typedef NS_ENUM(NSInteger, SentryAttachmentType) {
kSentryAttachmentTypeEventAttachment,
kSentryAttachmentTypeViewHierarchy
};

NSString *nameForSentryAttachmentType(SentryAttachmentType attachmentType);

SentryAttachmentType typeForSentryAttachmentName(NSString *_Nullable name);

@interface SentryAttachment ()
SENTRY_NO_INIT

/**
* Initializes an attachment with data.
* @param data The data for the attachment.
* @param filename The name of the attachment to display in Sentry.
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
* @param attachmentType The type of the attachment. Default is @c "EventAttachment".
*/
- (instancetype)initWithData:(NSData *)data
filename:(NSString *)filename
contentType:(nullable NSString *)contentType
attachmentType:(SentryAttachmentType)attachmentType;

/**
* Initializes an attachment with data.
* @param path The path of the file whose contents you want to upload to Sentry.
* @param filename The name of the attachment to display in Sentry.
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
* @param attachmentType The type of the attachment. Default is@c "EventAttachment".
*/
- (instancetype)initWithPath:(NSString *)path
filename:(NSString *)filename
contentType:(nullable NSString *)contentType
attachmentType:(SentryAttachmentType)attachmentType;

/**
* The type of the attachment.
*/
@property (readonly, nonatomic) SentryAttachmentType attachmentType;

@end

NS_ASSUME_NONNULL_END
Loading