@protocol BuglifeDelegate <NSObject>
BuglifeDelegate protocol provides a mechanism for your application to configure
certain aspects of the Buglife reporter UI.
Buglife calls this method when the bug reporter is ready to accept attachments.
You should use this method to add attachments. Within your method implementation, use
Buglife.addAttachmentWithData(_:type:filename:)to add attachments, then call the
completionHandler. You may both add attachments & call the
completionHandleron any thread.
WarningYou only have a few seconds to add attachments & call the
completionHandler. If the
completionHandlerisn’t called, the bug report submission process will continue regardless.
Called when a user attempts to invoke the bug reporter UI. To prevent accidental invocations, the user is presented with a prompt before showing the full bug reporter UI. If this method is implemented by your application, the returned result is used as the title for the prompt. If the returned result is nil, the prompt does not display a title. If this method is not implemented, a default title is used.
- (nullable NSString *)buglife:(nonnull Buglife *)buglife titleForPromptWithInvocation:(LIFEInvocationOptions)invocation;
The Buglife instance requesting the title.
The invocation type used to present the bug reporter UI.
Called when the bug report form has been completed by the user.
If your application uses custom input fields, then this method gives your app an opportunity to examine values submitted for these fields by the user by inspecting the
- (void)buglifeDidCompleteReportWithAttributes: (nonnull NSDictionary<NSString *, NSString *> *)attributes;
optional func buglifeDidCompleteReport(attributes: [String : String] = [:])
A dictionary of attributes submitted for a bug report, where the key is an attribute name (e.g. specified by your custom input field), and the dictionary value is the attribute’s corresponding value, as inputted by the user (or its
defaultvalue). Custom attributes set programmatically may neeed to be cleared here.
Asks the delegate whether the
Thank youdialog should be presented after a bug report is completed. Returning YES from this method will result in the default dialog being presented after report completion. Returning NO from this method will omit presenting any dialog. You can also use this to present your own custom completion dialog.
Alert the delegate that the report was dismissed without sending the report.
- (void)buglife:(nonnull Buglife *)buglife userCanceledReportWithAttributes: (nonnull NSDictionary<NSString *, NSString *> *)attributes;
optional func buglife(_ buglife: Buglife, userCanceledReportWithAttributes attributes: [String : String] = [:])
A dictionary of attributes that would have been submitted for a bug report, where the key is an attribute name (e.g. spcified by your custom input field), and the dictionary value is the attribute’s corresponding value, as inputted by the user (or its
defaultvalue). Custom attributes set programmatically may need to be cleared here.