|
8 | 8 |
|
9 | 9 | #import <Foundation/Foundation.h>
|
10 | 10 | #import <InstabugCore/InstabugCore.h>
|
11 |
| -#import "IBGReport.h" |
| 11 | +#import <InstabugCore/IBGTypes.h> |
12 | 12 |
|
| 13 | +NS_SWIFT_NAME(BugReporting) |
13 | 14 | @interface IBGBugReporting : NSObject
|
14 | 15 |
|
| 16 | +/** |
| 17 | + @brief Sets a block of code to be executed just before the SDK's UI is presented. |
| 18 | + |
| 19 | + @discussion This block is executed on the UI thread. Could be used for performing any UI changes before the SDK's UI |
| 20 | + is shown. |
| 21 | + */ |
15 | 22 | @property(class, atomic, strong) void(^willInvokeHandler)(void);
|
| 23 | + |
| 24 | +/** |
| 25 | + @brief Sets a block of code to be executed right after the SDK's UI is dismissed. |
| 26 | + |
| 27 | + @discussion This block is executed on the UI thread. Could be used for performing any UI changes after the SDK's UI |
| 28 | + is dismissed. |
| 29 | +
|
| 30 | + The block has the following parameters: |
| 31 | + |
| 32 | + - dismissType: How the SDK was dismissed. |
| 33 | + - reportType: Type of report that has been sent. Will be set to IBGReportTypeBug in case the SDK has been dismissed |
| 34 | + without selecting a report type, so you might need to check dismissType before reportType. |
| 35 | + |
| 36 | + @see IBGReportType, IBGDismissType |
| 37 | + */ |
16 | 38 | @property(class, atomic, strong) void(^didDismissHandler)(IBGDismissType dismissType, IBGReportType reportType);
|
17 |
| -@property(class, atomic, strong) void(^willSendReportHandler)(IBGReport *report); |
| 39 | + |
| 40 | +/** |
| 41 | + @brief Sets a block of code to be executed when a prompt option is selected |
| 42 | + |
| 43 | + @param didSelectPromptOptionHandler A block of code that gets executed when a prompt option is selected. |
| 44 | + |
| 45 | + The block has the following parameters: |
| 46 | + - prompOption: The option selected in prompt. |
| 47 | + */ |
18 | 48 | @property(class, atomic, strong) void(^didSelectPromptOptionHandler)(IBGPromptOption promptOption);
|
19 | 49 |
|
20 |
| -@property(class, atomic, assign) BOOL introMessageEnabled; |
| 50 | +/** |
| 51 | + @brief Sets the events that invoke the feedback form. |
| 52 | + |
| 53 | + @discussion Default is set by `startWithToken:invocationEvent:`. |
| 54 | + |
| 55 | + @see IBGInvocationEvent |
| 56 | + */ |
21 | 57 | @property(class, atomic, assign) IBGInvocationEvent invocationEvents;
|
| 58 | + |
| 59 | +/** |
| 60 | + @brief Sets the threshold value of the shake gesture for iPhone/iPod Touch |
| 61 | +
|
| 62 | + @discussion Default for iPhone is 2.5. |
| 63 | + */ |
22 | 64 | @property(class, atomic, assign) CGFloat shakingThresholdForiPhone;
|
| 65 | + |
| 66 | +/** |
| 67 | + @brief Sets the threshold value of the shake gesture for iPad. |
| 68 | + |
| 69 | + @discussion Default for iPad is 0.6. |
| 70 | + */ |
23 | 71 | @property(class, atomic, assign) CGFloat shakingThresholdForiPad;
|
| 72 | + |
| 73 | +/** |
| 74 | + @brief Sets the default edge at which the floating button will be shown. Different orientations are already handled. |
| 75 | + |
| 76 | + @discussion Default for `floatingButtonEdge` is `CGRectMaxXEdge`. |
| 77 | + */ |
24 | 78 | @property(class, atomic, assign) CGRectEdge floatingButtonEdge;
|
| 79 | + |
| 80 | +/** |
| 81 | + @brief Sets the default offset from the top at which the floating button will be shown. |
| 82 | + |
| 83 | + @discussion Default for `floatingButtonOffsetFromTop` is 50 |
| 84 | + */ |
25 | 85 | @property(class, atomic, assign) CGFloat floatingButtonTopOffset;
|
| 86 | + |
| 87 | +/** |
| 88 | + @brief Sets whether attachments in bug reporting and in-app messaging are enabled. |
| 89 | + */ |
26 | 90 | @property(class, atomic, assign) IBGAttachmentType enabledAttachmentTypes;
|
| 91 | + |
| 92 | +/** |
| 93 | + @brief Enables/disables prompt options when SDK is invoked. |
| 94 | + |
| 95 | + @discussion When only a single option is enabled, it become the default invocation mode. |
| 96 | + If all options are disabled, bug reporting becomes the default invocation mode. |
| 97 | + |
| 98 | + By default, all three options are enabled. |
| 99 | + */ |
27 | 100 | @property(class, atomic, assign) IBGPromptOption promptOptions;
|
| 101 | + |
| 102 | +/** |
| 103 | + @brief Sets whether the extended bug report mode should be disabled, enabled with required fields or enabled with optional fields. |
| 104 | + |
| 105 | + @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. |
| 106 | + 1. Expected Results. |
| 107 | + 2. Actual Results. |
| 108 | + 3. Steps to Reproduce. |
| 109 | + |
| 110 | + An enum to disable the extended bug report mode, enable it with required or with optional fields. |
| 111 | + */ |
28 | 112 | @property(class, atomic, assign) IBGExtendedBugReportMode extendedBugReportMode;
|
29 | 113 |
|
| 114 | +@property(class, atomic, assign) IBGBugReportingInvocationOption invocationOptions; |
| 115 | + |
| 116 | +/** |
| 117 | + @brief Sets the welcome message mode to live, beta or disabled. |
| 118 | + |
| 119 | + @discussion By default, the welcome message live mode is enabled. It appears automatically after 10 seconds from the user's first session. You can change it to the beta mode or disable it. |
| 120 | + The live mode consists of one step to inform the users how to report a bug or feedback. The beta mode consists of three steps to welcome your testers on board, inform them how to report a bug or feedback and to motivate them to always be on the latest app version. Please note, the into message appears only if the invocation event isn't set to none. |
| 121 | + */ |
| 122 | +@property (class, atomic, assign) IBGWelcomeMessageMode welcomeMessageMode; |
| 123 | + |
30 | 124 | /**
|
31 | 125 | @brief Invokes the SDK manually with the default invocation mode.
|
32 | 126 |
|
33 | 127 | @discussion Shows a view that asks the user whether they want to start a chat, report a problem or suggest an improvement.
|
34 | 128 | */
|
35 | 129 | + (void)invoke;
|
36 | 130 |
|
37 |
| -+ (void)invokeWithOptions:(IBGBugReportingInvocationOption)options; |
| 131 | +/** |
| 132 | + @brief Invokes the SDK with a specific mode. |
| 133 | + |
| 134 | + @discussion Invokes the SDK and show a specific view with specified options, instead of showing a prompt for users to choose from. |
| 135 | + |
| 136 | + @see IBGInvocationMode |
| 137 | + @see IBGBugReportingInvocationOption |
| 138 | + */ |
| 139 | ++ (void)invokeWithMode:(IBGInvocationMode)invocationMode options:(IBGBugReportingInvocationOption)options; |
38 | 140 |
|
39 | 141 | /**
|
40 | 142 | @brief Dismisses any Instabug views that are currently being shown.
|
41 | 143 | */
|
42 | 144 | + (void)dismiss;
|
43 | 145 |
|
44 | 146 | /**
|
45 |
| - @brief Present a view that educates the user on how to invoke the SDK with the currently set invocation event. |
| 147 | + @brief Shows the welcome message in a specific mode. |
| 148 | + |
| 149 | + @discussion By default, the welcome message live mode is enabled. It appears automatically after 10 seconds from the user's first session. You can show it manually in a specific mode through this API. |
| 150 | + The live mode consists of one step to inform the users how to report a bug or feedback. The beta mode consists of three steps to welcome your testers on board, inform them how to report a bug or feedback and to motivate them to always be on the latest app version. Please note, the into message appears only if the invocation event isn't set to none. |
46 | 151 |
|
47 |
| - @discussion Does nothing if invocation event is set to anything other than IBGInvocationEventShake or IBGInvocationEventScreenshot. |
| 152 | + @param welcomeMessageMode An enum to set the welcome message mode to live, beta or disabled. |
48 | 153 | */
|
49 |
| -+ (void)showIntroMessage; |
| 154 | ++ (void)showWelcomeMessageWithMode:(IBGWelcomeMessageMode)welcomeMessageMode; |
50 | 155 |
|
51 | 156 |
|
52 | 157 | @end
|
0 commit comments