HomeDocumentationAPI Reference
Getting StartedAPI ReferenceBug ReportingCrash ReportingAPMHelp Center

Add Extra Attachment

It's possible to manually add an extra attachment to the report by passing a file URL to this method.

let url = fileURL()
Instabug.addFileAttachment(with: url)
//OR
Instabug.addFileAttachment(with: "Data".data(using: .utf8)!)
NSURL *url = self.fileURL;
[Instabug addFileAttachmentWithURL:url];
//OR
[Instabug addFileAttachmentWithData:[@"data" dataUsingEncoding:NSUTF8StringEncoding]];
Instabug.addFileAttachment(fileUri, "file_name.txt");
Instabug.addFileAttachment(filePath)
cordova.plugins.instabug.addFile(
    'FILE_PATH',
    function () {
        console.log('File added.');
    },
    function (error) {
        console.log('File could not be added - ' + error);
    }
);
//iOS
NSUrl url = new NSUrl(“url”);
Instabug.AddFileAttachmentWithURL(url);

//Android
Instabug.AddFileAttachment(Android.Net.Uri.Parse("sample text attachment"), "extra_text_attachment");
Instabug.addFileAttachment(filePath, fileName)