The attachments sent with each bug or crash report can be broken down into 2 categories. The default Instabug attachments and custom extra attachments.
The main attachment sent with any bug report is the screenshot taken when the SDK was invoked. The users can annotate this screenshot. There are several attachment types that can be sent with each report. All attachment types can be enabled or disabled.
The attachment options are:
- Extra screenshots.
- Images from phone gallery.
- Screen recording.
Attachment - Dashboard
By default, All attachment options are enabled if they are available in your current plan.
You can choose the attachment options that will be available to the reporter by passing its corresponding enum value as an argument in the following API call.
IBGBugReporting.enabledAttachmentTypes = IBGAttachmentTypeScreenShot | IBGAttachmentTypeScreenRecording;
BugReporting.enabledAttachmentTypes = [.screenShot, .screenRecording]
Here are the possible enum values:
IBGAttachmentTypeScreenshot; IBGAttachmentTypeExtraScreenshot; IBGAttachmentTypeGalleryImage; IBGAttachmentTypeScreenRecording;
extraScreenShot galleryImage screenRecording screenShot
Each of the parameters is a boolean used to indicate if a certain type is enabled or not.
The SDK allows you to attach custom files to reports. You can attach up to 3 files, each up to 5 MB.
Extra Attachment - Dashboard
Use the following method to add a new file attachment.
NSURL *url = self.fileURL; [Instabug addFileAttachmentWithURL:url];
let url = fileURL() Instabug.addFileAttachment(with: url)
A new copy of the file at
fileURL will be attached with each bug report being sent. The file is only copied at the time of sending the report, so you could safely call this API whenever the file is available on disk, and the copy attached to your bug reports will always contain that latest changes at the time of sending the report.
Each call to this method adds the file to the files attached until a maximum of 3 then it overrides the first file. The file has to be available locally at the provided path when the report is being sent.
To clear list of files to be attached to reports, use the following method:
This method doesn't delete any files from the file system. It will just remove them from the list of files to be attached to each report.