|
| 1 | +/* |
| 2 | + File: Instabug/IBGBugReporting.h |
| 3 | + |
| 4 | + Contains: API for using Instabug's SDK. |
| 5 | + |
| 6 | + Copyright: (c) 2013-2019 by Instabug, Inc., all rights reserved. |
| 7 | + |
| 8 | + Version: 9.1.3 |
| 9 | + */ |
| 10 | + |
| 11 | +#import <Foundation/Foundation.h> |
| 12 | +#import "IBGTypes.h" |
| 13 | + |
| 14 | +NS_SWIFT_NAME(BugReporting) |
| 15 | +@interface IBGBugReporting : NSObject |
| 16 | + |
| 17 | +/** |
| 18 | + @brief Acts as master switch for the Bug Reporting. |
| 19 | + |
| 20 | + @discussion It's enabled by default. When disabled, both "Report a bug" and "Suggest an improvement" will be removed from Instabug Prompt Options. In addition, when disabled +showWithReportType:options: won’t have an effect. |
| 21 | + */ |
| 22 | +@property (class, atomic, assign) BOOL enabled; |
| 23 | + |
| 24 | +/** |
| 25 | + @brief Sets a block of code to be executed just before the SDK's UI is presented. |
| 26 | + |
| 27 | + @discussion This block is executed on the UI thread. Could be used for performing any UI changes before the SDK's UI |
| 28 | + is shown. |
| 29 | + */ |
| 30 | +@property(class, atomic, strong) void(^willInvokeHandler)(void); |
| 31 | + |
| 32 | +/** |
| 33 | + @brief Sets a block of code to be executed right after the SDK's UI is dismissed. |
| 34 | + |
| 35 | + @discussion This block is executed on the UI thread. Could be used for performing any UI changes after the SDK's UI |
| 36 | + is dismissed. |
| 37 | +
|
| 38 | + The block has the following parameters: |
| 39 | + |
| 40 | + - dismissType: How the SDK was dismissed. |
| 41 | + - reportType: Type of report that has been sent. Will be set to IBGReportTypeBug in case the SDK has been dismissed |
| 42 | + without selecting a report type, so you might need to check dismissType before reportType. |
| 43 | + |
| 44 | + @see IBGReportType, IBGDismissType |
| 45 | + */ |
| 46 | +@property(class, atomic, strong) void(^didDismissHandler)(IBGDismissType dismissType, IBGReportType reportType); |
| 47 | + |
| 48 | +/** |
| 49 | + @brief Sets a block of code to be executed when a prompt option is selected |
| 50 | + |
| 51 | + @param didSelectPromptOptionHandler A block of code that gets executed when a prompt option is selected. |
| 52 | + |
| 53 | + The block has the following parameters: |
| 54 | + - prompOption: The option selected in prompt. |
| 55 | + */ |
| 56 | +@property(class, atomic, strong) void(^didSelectPromptOptionHandler)(IBGPromptOption promptOption); |
| 57 | + |
| 58 | +/** |
| 59 | + @brief Sets the events that invoke the feedback form. |
| 60 | + |
| 61 | + @discussion Default is set by `startWithToken:invocationEvent:`. |
| 62 | + |
| 63 | + @see IBGInvocationEvent |
| 64 | + */ |
| 65 | +@property(class, atomic, assign) IBGInvocationEvent invocationEvents; |
| 66 | + |
| 67 | +/** |
| 68 | + @brief Sets the threshold value of the shake gesture for iPhone/iPod Touch. |
| 69 | +
|
| 70 | + @discussion Default for iPhone is 2.5. The lower the threshold, the easier it will be to invoke Instabug with the |
| 71 | + shake gesture. A threshold which is too low will cause Instabug to be invoked unintentionally. |
| 72 | + */ |
| 73 | +@property(class, atomic, assign) CGFloat shakingThresholdForiPhone; |
| 74 | + |
| 75 | +/** |
| 76 | + @brief Sets the threshold value of the shake gesture for iPad. |
| 77 | + |
| 78 | + @discussion Default for iPad is 0.6. The lower the threshold, the easier it will be to invoke Instabug with the |
| 79 | + shake gesture. A threshold which is too low will cause Instabug to be invoked unintentionally. |
| 80 | + */ |
| 81 | +@property(class, atomic, assign) CGFloat shakingThresholdForiPad; |
| 82 | + |
| 83 | +/** |
| 84 | + @brief Sets the default edge at which the floating button will be shown. Different orientations are already handled. |
| 85 | + |
| 86 | + @discussion Default for `floatingButtonEdge` is `CGRectMaxXEdge`. |
| 87 | + */ |
| 88 | +@property(class, atomic, assign) CGRectEdge floatingButtonEdge; |
| 89 | + |
| 90 | +/** |
| 91 | + @brief Sets the default offset from the top at which the floating button will be shown. |
| 92 | + |
| 93 | + @discussion Default for `floatingButtonOffsetFromTop` is 50 |
| 94 | + */ |
| 95 | +@property(class, atomic, assign) CGFloat floatingButtonTopOffset; |
| 96 | + |
| 97 | +/** |
| 98 | + @brief Sets whether attachments in bug reporting and in-app messaging are enabled. |
| 99 | + */ |
| 100 | +@property(class, atomic, assign) IBGAttachmentType enabledAttachmentTypes; |
| 101 | + |
| 102 | +/** |
| 103 | + @brief Controls if Instabug Prompt Options should contain "Report a problem” and/or "Suggest an improvement" or not. |
| 104 | + |
| 105 | + @discussion By default, both options are enabled. |
| 106 | + */ |
| 107 | +@property(class, atomic, assign) IBGBugReportingReportType promptOptionsEnabledReportTypes; |
| 108 | + |
| 109 | +/** |
| 110 | + @brief Sets whether the extended bug report mode should be disabled, enabled with required fields or enabled with optional fields. |
| 111 | + |
| 112 | + @discussion This feature is disabled by default. When enabled, it adds more fields for your reporters to fill in. You can set whether the extra fields are required or optional. |
| 113 | + 1. Expected Results. |
| 114 | + 2. Actual Results. |
| 115 | + 3. Steps to Reproduce. |
| 116 | + |
| 117 | + An enum to disable the extended bug report mode, enable it with required or with optional fields. |
| 118 | + */ |
| 119 | +@property(class, atomic, assign) IBGExtendedBugReportMode extendedBugReportMode; |
| 120 | + |
| 121 | +/** |
| 122 | + @brief Use to specify different options that would affect how Instabug is shown and other aspects about the reporting experience. |
| 123 | + |
| 124 | + @discussion See IBGInvocationOptions. |
| 125 | + */ |
| 126 | +@property(class, atomic, assign) IBGBugReportingOption bugReportingOptions; |
| 127 | + |
| 128 | +/** |
| 129 | + @brief Sets the default position at which the Instabug screen recording button will be shown. Different orientations are already handled. |
| 130 | + |
| 131 | + @discussion Default for `position` is `bottomRight`. |
| 132 | + */ |
| 133 | +@property(class, atomic, assign) IBGPosition videoRecordingFloatingButtonPosition; |
| 134 | + |
| 135 | +/** |
| 136 | + @method +showWithReportType:options: |
| 137 | + @brief Shows the compose view of a bug report or a feedback. |
| 138 | + |
| 139 | + @see IBGBugReportingReportType |
| 140 | + @see IBGBugReportingOption |
| 141 | + */ |
| 142 | ++ (void)showWithReportType:(IBGBugReportingReportType)reportType |
| 143 | + options:(IBGBugReportingOption)options; |
| 144 | + |
| 145 | +/** |
| 146 | + @brief Dismisses any Instabug views that are currently being shown. |
| 147 | + */ |
| 148 | ++ (void)dismiss; |
| 149 | + |
| 150 | +/** |
| 151 | + @brief Enables/disables inspect view hierarchy when reporting a bug/feedback. |
| 152 | + */ |
| 153 | +@property (class, atomic, assign) BOOL shouldCaptureViewHierarchy; |
| 154 | + |
| 155 | +/** |
| 156 | + @brief Sets whether the SDK is recording the screen or not. |
| 157 | + |
| 158 | + @discussion Enabling auto screen recording would give you an insight on the scenario a user has performed before encountering a bug. screen recording is attached with each bug being sent. |
| 159 | + |
| 160 | + Auto screen recording is disabled by default. |
| 161 | + */ |
| 162 | +@property (class, atomic, assign) BOOL autoScreenRecordingEnabled; |
| 163 | + |
| 164 | +/** |
| 165 | + @brief Sets maximum auto screen recording video duration. |
| 166 | + |
| 167 | + @discussion sets maximum auto screen recording video duration with max value 30 seconds and min value greater than 1 sec. |
| 168 | + */ |
| 169 | +@property (class, atomic, assign) CGFloat autoScreenRecordingDuration; |
| 170 | + |
| 171 | +/* |
| 172 | + +------------------------------------------------------------------------+ |
| 173 | + | Deprecated APIs | |
| 174 | + +------------------------------------------------------------------------+ |
| 175 | + | The following section includes all deprecated APIs. | |
| 176 | + | | |
| 177 | + | We've made a few changes to our APIs starting from version 8.0 to make | |
| 178 | + | them more intuitive and easily reachable. | |
| 179 | + | | |
| 180 | + | While the APIs below still function, they will be completely removed | |
| 181 | + | in a future release. | |
| 182 | + | | |
| 183 | + | To adopt the new changes, please refer to our migration guide at: | |
| 184 | + | https://docs.instabug.com/docs/ios-sdk-8-1-migration-guide | |
| 185 | + +------------------------------------------------------------------------+ |
| 186 | + */ |
| 187 | + |
| 188 | +@end |
0 commit comments