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:^() {
        BugseeReport * report = [Bugsee createReport];

        [Bugsee takeScreenshot:^(BugseeScreenshot * _Nullable screenshot) {
                // Fill report in a custom UI
                // ...

                report.summary = @"UI is broken.";
                report.descr = @"It happened when I pressed the button";

                UIImage * image = screenshot.image;
                //Do something with image here
                screenshot.image = image;
                //If you change the image you need to assign YES to annotaded property of the screenshot.
                screenshot.annotated = YES;
                report.screenshot = screenshot;

                // you also can add custom attributes for report
                report.attributes = [NSMutableDictionary dictionaryWithCapacity:1];
                [report.attributes setValue:@"value of attribute" forKey:@"Custom attribute key"];

                // Then upload with customzied report and call [Bugsee relaunch] when report was prepared for upload in completion block.
                [Bugsee uploadWithReport:report completion:^{
                        [Bugsee relaunch];
                }];
        }];
}];

!Swift


// Create report to fill.
Bugsee.stop {
        // Fill report in a custom UI
        // ...
        let report = Bugsee.createReport()
        report?.summary = "UI is broken."
        report?.descr = "It happened when I pressed the button"

        Bugsee.takeScreenshot({ (screenshot) in
                let image = screenshot?.image
                //Do something with image here
                screenshot?.image = image!
                //If you change the image you need to assign true to annotaded property of the screenshot.
                screenshot?.annotated = true

                report?.attributes = NSMutableDictionary(capacity: 1)
                report?.attributes.setValue("value of attribute", forKey: "Custom attribute key")

                // Then upload with customzied report and call [Bugsee relaunch] when report was prepared for upload in completion block.
                Bugsee.upload(report: 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"}]];

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.

!Swift

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

Asserts

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

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))")