mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Add support for attaching NSData objects to a feedback compose view
This commit is contained in:
@@ -71,9 +71,10 @@
|
|||||||
- NSString
|
- NSString
|
||||||
- NSURL
|
- NSURL
|
||||||
- UIImage
|
- UIImage
|
||||||
|
- NSData
|
||||||
|
|
||||||
These are automatically concatenated to one text string, while any image attachments are
|
These are automatically concatenated to one text string, while any images and NSData
|
||||||
added as attachments to the feedback.
|
objects are added as attachments to the feedback.
|
||||||
|
|
||||||
@param items Array of data objects to prefill the feedback text message.
|
@param items Array of data objects to prefill the feedback text message.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -103,6 +103,8 @@
|
|||||||
} else if ([item isKindOfClass:[UIImage class]]) {
|
} else if ([item isKindOfClass:[UIImage class]]) {
|
||||||
UIImage *image = item;
|
UIImage *image = item;
|
||||||
[self.attachments addObject:[BITFeedbackMessageAttachment attachmentWithData:UIImageJPEGRepresentation(image, 0.7f) contentType:@"image/jpeg"]];
|
[self.attachments addObject:[BITFeedbackMessageAttachment attachmentWithData:UIImageJPEGRepresentation(image, 0.7f) contentType:@"image/jpeg"]];
|
||||||
|
} else if ([item isKindOfClass:[NSData class]]) {
|
||||||
|
[self.attachments addObject:[BITFeedbackMessageAttachment attachmentWithData:item contentType:@"'application/octet-stream'"]];
|
||||||
} else {
|
} else {
|
||||||
BITHockeyLog(@"Unknown item type %@", item);
|
BITHockeyLog(@"Unknown item type %@", item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user