Manual invocation

Report view

In addition to detection of shake gesture or screenshot issue report view can be triggered programmatically:

!Objective-C

[Bugsee showReportController];

// or pre-fill some fields, user will be able to modify them
[Bugsee showReportControllerWithSummary:@"Some problem"
          description:@""
          severity:BugseeSeverityMedium];

!Swift

// To stop video recording use   
Bugsee.showReportController()

// or pre-fill some fields, user will be able to modify them
Bugsee.showReportController(summary: "Some problem",
    description: "",
    severity: BugseeSeverityMedium)

Issue create

You can build your own custom UI for collecting summary, description and severity from a user and use the following call to send it to Bugsee to upload.

Note: You should not use it for reporting errors automatically from within code, use Non-fatal errors for this instead.

!Objective-C

[Bugsee uploadWithSummary:@"Upload from code"
        description:@"Some description"
        severity:BugseeSeverityMedium];

!Swift

Bugsee.upload(summary: "Upload from code",
        description: "Some description",
        severity: BugseeSeverityMedium)

If you want to stop recording before showing custom report UI, it can be done the following way.

!Objective-C


// Create report to fill.
[Bugsee stop:^() {
        BugseeExtendedReport * report = [Bugsee createReport];

        // Fill report in a custom UI
        // ...

        [report setSummary:@"UI is broken."];
        [report setDescription:@"It happened when I pressed the button"];

        UIImage * image = report.screenshot;

        // Do something with screenshot here
        // ...

        // Store changed screenshot
        [report setScreenshot:image];

        // you also can add custom attributes for report
        [report setAttribute:@"attribute name" withValue:@"attribute value"];

        // Then upload with customized report and call [Bugsee relaunch] when report was prepared for upload in completion block.
        [Bugsee uploadReport:report withCompletion:^{
                [Bugsee relaunchWithOptions:nil];
        }];
}];

!Swift


// Create report to fill.
Bugsee.stop {
        let report = Bugsee.createReport()

        // Fill report in a custom UI
        // ...

        report?.setSummary("UI is broken.")
        report?.setDescription("It happened when I pressed the button")

        let image = report?.screenshot

        // Do something with image here

        report?.setScreenshot(image)

        report?.setAttribute("attribute name", value: "attribute value")

        // Then upload with customzied report and call [Bugsee relaunch] when report was prepared for upload in completion block.
        Bugsee.uploadReport(report!, completion: {
                Bugsee.relaunch()
        })
}

Non-fatal errors

It is possible to report non-fatal errors from code. These reports will get combined similar to crashes, and you will be provided with statistics and a break down by unique devices, IOS versions, etc.

!Objective-C

[Bugsee logError:[NSError errorWithDomain:@"com.example.errors.ServerIsDown"
                            code:10234 userInfo:@{
                                @"key1":@"value1",
                                @"key2": @"value2"}]];

!Swift

Bugsee.logError(NSError(domain: "com.example.errors.ServerIsDown",
                        code: 10234,
                        userInfo: ["key1": "value1", "key2": "value2"]))

Note: Make sure to set code and domain wisely, the errors are combined on code, domain and location of the error, if you put arbitraty data into domain the errors will not get combined properly. Put custom data into userInfo instead.

Asserts

You can also let Bugsee validate asserts and auto create issues and upload them once the assert fails.

!Objective-C

BUGSEE_ASSERT(balance > 0, @"Balance is wrong")

!Swift

// Unfortunately, there is no preprocessor in Swift, so you have to construct location string yourself
if balance < 0 Bugsee.logAssert(description: "Balance is wrong", location:"\(#function) (\(#file):\(#line))")