Welcome to Instabug's Documentation!
Here you'll find a comprehensive technical guide
to help you start working with the Instabug SDK efficiently.

Get Started
Suggest Edits

Building Instabug

 

You can use these methods to build Instabug in your project so that you can invoke it. This method takes a string token and any number of invocation events as an argument. This method will require that you have Instabug already installed. For more information on how to fully install and integrate Instabug, please refer to the relevant documentation sections here:

Instabug.start(withToken: "YOUR-TOKEN-HERE", invocationEvents: [.shake, .screenshot]);
[Instabug startWithToken:@"YOUR-TOKEN-HERE" invocationEvents: IBGInvocationEventShake | IBGInvocationEventScreenshot]
new Instabug.Builder(this, "APP_TOKEN").build();
//iOS
Instabug.startWithToken('IOS_APP_TOKEN', [Instabug.invocationEvent.shake]);

//Android
new RNInstabugReactnativePackage.Builder("TOKEN",MainApplication.this)
							.build();
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);
//iOS
Instabug.StartWithToken("YOUR_APP_TOKEN", IBGInvocationEvent.Shake | IBGInvocationEvent.Screenshot);

//Android
new Instabug.Builder(this, "TOKEN").Build();

Invocation Event Parameters:

//No Trigger
.none
//Shake
.shake
//Screenshot
.screenshot
//Two Finger Swipe Left
.twoFingersSwipeLeft
//Right Edge Pan
.rightEdgePan
//Floating Button
.floatingButton
//No Trigger
IBGInvocationEventNone
//Shake
IBGInvocationEventShake
//Screenshot
IBGInvocationEventScreenshot
//Two Finger Swipe Left
IBGInvocationEventTwoFingersSwipeLeft
//Right Edge Pan
IBGInvocationEventRightEdgePan
//Floating Button
IBGInvocationEventFloatingButton
//No Trigger
NONE
//Shake
SHAKE
//Screenshot
SCREENSHOT_GESTURE
//Two Finger Swipe Left
TWO_FINGER_SWIPE_LEFT
//Floating Button
FLOATING_BUTTON
//iOS
//No Trigger
Instabug.invocationEvent.none
//Shake
Instabug.invocationEvent.shake
//Screenshot
Instabug.invocationEvent.screenshot
//Two Finger Swipe Left
Instabug.invocationEvent.twoFingersSwipe
//Floating Button
Instabug.invocationEvent.floatingButton

//Android
"none"
"shake"
"screenshot"
"swipe"
"button"
//No Trigger
cordova.plugins.bugReporting.invocationEvents.none
//Shake
cordova.plugins.bugReporting.invocationEvents.shake
//Floating Button
cordova.plugins.bugReporting.invocationEvents.button
//Screenshot
cordova.plugins.bugReporting.invocationEvents.screenshot
//Two Finger Swipe Left
cordova.plugins.bugReporting.invocationEvents.swipe
//iOS
IBGInvocationEvent.None
IBGInvocationEvent.Shake
IBGInvocationEvent.Screenshot
IBGInvocationEvent.TwoFingersSwipeLeft
IBGInvocationEvent.RightEdgePan
IBGInvocationEvent.FloatingButton

//Android 
InstabugInvocationEvent.Shake
InstabugInvocationEvent.Screenshot
InstabugInvocationEvent.FloatingButton
InstabugInvocationEvent.ScreenshotGesture
InstabugInvocationEvent.TwoFingerSwipeLeft
InstabugInvocationEvent.None
Suggest Edits

Displaying Instabug

 

Instabug can be invoked either through the normal event set or manually as shown in this API. You can show the Instabug invocation or immediately show an Instabug related view rather than the invocation.

 
Suggest Edits

Show Prompt Options

 

This API is used to show the Instabug invocation menu manually and does not take any arguments.

//Invoke Instabug
Instabug.show()
//Invoke Instabug
[Instabug show];
Instabug.show();
Instabug.show();
cordova.plugins.instabug.show(successCb, errorCb)
Instabug.Show();
Suggest Edits

Show Specific Mode

 

You can show Instabug with a specific mode and option directly using these APIs. If you're showing a bug reporting mode specifically, the API has two fields, Report Type and Option.

All the possible invocation modes are listed to the right. These modes can be used to show a specific view right away. The possible modes are:

  • Show New Bug Page
  • Show New Feedback Page
  • Show New Chat Page
  • Show Chats List Page

Here are all the possible invocation options used to customize the new bug or feedback experience.

  • Hide email field on new bug/feedback page
  • Show email field on new bug/feedback page but only optionally
  • Require user to fill comment field before submitting new feedback or bug

You can pass any number of invocation options in a single method call. If no invocation option is passed, the email field will automatically be shown and set to required and the comment field will be set to optional.

Method

// Compose a new bug report
BugReporting.show(with: .bug, options: [])
// Compose a new feedback
BugReporting.show(with: .feedback, options: [])
// Compose a new chat
Chats.show()
// Show the perevious chats list
Replies.show()
// Compose a new bug report
[IBGBugReporting showWithReportType:IBGBugReportingReportTypeBug options:0];
// Compose a new feedback
[IBGBugReporting showWithReportType:IBGBugReportingReportTypeFeedback options:0];
// Compose a new chat
[IBGChats show];
// Show the perevious chats list only of the the user already have a chats history. Calling this API won't have an effect otherwise.
[IBGReplies show];
// Compose a new bug report
BugReporting.show(BugReporting.ReportType.BUG)
// Compose a new feedback
BugReporting.show(BugReporting.ReportType.FEEDBACK)
// Compose a new chat
Chats.show();
// Show the perevious chats list
Replies.show();

// Compose a new bug report
BugReporting.showWithOptions(BugReporting.reportType.bug, [BugReporting.option.emailFieldHidden]);
// Compose a new feedback
BugReporting.showWithOptions(BugReporting.reportType.feedback, [BugReporting.option.emailFieldOptional]);
// Compose a new chat
Chats.show();
// Show the previous chats list
Replies.show();
// Compose a new bug report
cordova.plugins.bugReporting.showWithOptions(cordova.plugins.bugReporting.reportType.bug, [cordova.plugins.bugReporting.invocationOptions.emailFieldHidden], successCb, errorCb)
// Compose a new feedback
cordova.plugins.bugReporting.showWithOptions(cordova.plugins.bugReporting.reportType.feedback, [cordova.plugins.bugReporting.invocationOptions.emailFieldHidden], successCb, errorCb)
// Compose a new chat
cordova.plugins.chats.show(boolean, successCb, errorCb)
// Show the previous chats list
cordova.plugins.replies.show(successCb, errorCb)
// Compose a new bug report
IBGBugReporting.ShowWithReportType(IBGBugReportingReportType.Bug, IBGBugReportingOption.EmailFieldHidden);
// Compose a new feedback
IBGBugReporting.ShowWithReportType(IBGBugReportingReportType.Feedback, IBGBugReportingOption.EmailFieldHidden);
// Compose a new chat
IBGChats.Show();
// Show the previous chats list
IBGReplies.Show();

Report Type Parameters:

//Show New Bug
.bug
//Show New Feedback
.feedback
//Show New Bug
IBGBugReportingReportTypeBug
//Show New Feedback
IBGBugReportingReportTypeFeedback
//Show New Bug
BugReporting.ReportType.BUG
//Show New Feedback
BugReporting.ReportType.FEEDBACK
//Show New Bug
BugReporting.reportType.bug
//Show New Feedback
BugReporting.reportType.feedback
//Show New Bug
cordova.plugins.bugReporting.reportType.bug
//Show New Feedback
cordova.plugins.bugReporting.reportType.feedback
//Show New Bug
IBGBugReportingReportType.Bug
//Show New Feedback
IBGBugReportingReportType.Feedback

Option Parameters:

//Hide email
.emailFieldHidden
//Show email as optional
.emailFieldOptional
//Make comment required
.commentFieldRequired
//Disable post sending dialog
.disablePostSendingDialog
//Hide email
IBGBugReportingInvocationOptionEmailFieldHidden
//Show email as optional
IBGBugReportingInvocationOptionEmailFieldOptional
//Make comment required
IBGBugReportingInvocationOptionCommentFieldRequired
//Disable post sending dialog
IBGBugReportingInvocationOptionDisablePostSendingDialog
//Hide email
EMAIL_FIELD_HIDDEN
//Show email as optional
EMAIL_FIELD_OPTIONAL
//Make comment required
COMMENT_FIELD_REQUIRED
//No post sending dialog
DISABLE_POST_SENDING_DIALOG
//Hide email
BugReporting.option.emailFieldHidden;
//Show email as optional
BugReporting.option.emailFieldOptional;
//Make comment required
BugReporting.option.commentFieldRequired;
//No post sending dialog
BugReporting.option.disablePostSendingDialog;
//Hide email
cordova.plugins.bugReporting.invocationOptions.emailFieldHidden
//Show email as optional
cordova.plugins.bugReporting.invocationOptions.emailFieldOptional
//Make comment required
cordova.plugins.bugReporting.invocationOptions.commentFieldRequired
//No post sending dialog
cordova.plugins.bugReporting.invocationOptions.disablePostSendingDialog
//Hide email
IBGBugReportingOption.EmailFieldHidden
//Show email as optional
IBGBugReportingOption.EmailFieldOptional
//Make comment required
IBGBugReportingOption.CommentFieldRequired
Suggest Edits

Change Invocation Event

 

You can change the way Instabug is invoked at runtime using this method. This method takes any number of Invocation Events as an argument.

Below are all the possible invocation event triggers:

Method

BugReporting.invocationEvents = [.shake, .screenshot]
IBGBugReporting.invocationEvents = IBGInvocationEventShake | IBGInvocationEventScreenshot;
BugReporting.setInvocationEvents(InstabugInvocationEvent.SHAKE, InstabugInvocationEvent.SCREENSHOT)
BugReporting.setInvocationEvents([Instabug.invocationEvent.shake])
cordova.plugins.bugReporting.setInvocationEvents(events, success, error)
//iOS Only
IBGBugReporting.InvocationEvents = IBGInvocationEvent.FloatingButton;

Invocation Event Parameters:

//No Trigger
.none
//Shake
.shake
//Screenshot
.screenshot
//Two Finger Swipe Left
.twoFingersSwipeLeft
//Right Edge Pan
.rightEdgePan
//Floating Button
.floatingButton
//No Trigger
IBGInvocationEventNone
//Shake
IBGInvocationEventShake
//Screenshot
IBGInvocationEventScreenshot
//Two Finger Swipe Left
IBGInvocationEventTwoFingersSwipeLeft
//Right Edge Pan
IBGInvocationEventRightEdgePan
//Floating Button
IBGInvocationEventFloatingButton
//No Trigger
NONE
//Shake
SHAKE
//Screenshot
SCREENSHOT_GESTURE
//Two Finger Swipe Left
TWO_FINGER_SWIPE_LEFT
//Floating Button
FLOATING_BUTTON
//No Trigger
Instabug.invocationEvent.none
//Shake
Instabug.invocationEvent.shake
//Screenshot
Instabug.invocationEvent.screenshot
//Two Finger Swipe Left
Instabug.invocationEvent.twoFingersSwipe
//Floating Button
Instabug.invocationEvent.floatingButton
//No Trigger
cordova.plugins.bugReporting.invocationEvents.none
//Shake
cordova.plugins.bugReporting.invocationEvents.shake
//Floating Button
cordova.plugins.bugReporting.invocationEvents.button
//Screenshot
cordova.plugins.bugReporting.invocationEvents.screenshot
//Two Finger Swipe Left
cordova.plugins.bugReporting.invocationEvents.swipe
//iOS
IBGInvocationEvent.None
IBGInvocationEvent.Shake
IBGInvocationEvent.Screenshot
IBGInvocationEvent.TwoFingersSwipeLeft
IBGInvocationEvent.RightEdgePan
IBGInvocationEvent.FloatingButton

//Android 
InstabugInvocationEvent.Shake
InstabugInvocationEvent.Screenshot
InstabugInvocationEvent.FloatingButton
InstabugInvocationEvent.ScreenshotGesture
InstabugInvocationEvent.TwoFingerSwipeLeft
InstabugInvocationEvent.None
Suggest Edits

Set Shaking Threshold

 

You can use this API to adjust the shaking sensitivity. This will allow the device to show the invocation with weaker or stronger shakes in case the shake invocation method is used. The threshold takes floats on iOS and integers on Android..

BugReporting.shakingThresholdForiPhone = 3.0;
BugReporting.shakingThresholdForiPad = 1.0;
IBGBugReporting.shakingThresholdForiPhone = 3.0;
IBGBugReporting.shakingThresholdForiPad = 1.0;
BugReporting.setShakingThreshold(800);
//iOS
BugReporting.setShakingThresholdForiPhone(iPhoneShakingThreshold);
BugReporting.setShakingThresholdForiPad(iPadShakingThreshold);

//Android
BugReporting.setShakingThresholdForAndroid(androidThreshold);
//Can be changed through the activate method
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
       shakingThresholdAndroid:12, //Default value: 11
       shakingThresholdIPhone: 2,  //Default value: 2.5
       shakingThresholdIPad: 0.5   //Default value: 0.6
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

//Can be changed through this API as well
cordova.plugins.instabug.setShakingThreshold(3.0, () => {}, (error) => {})
//iOS
IBGBugReporting.ShakingThresholdForiPhone = 3.0;
IBGBugReporting.ShakingThresholdForiPad = 1.0;

//Android
BugReporting.SetShakingThreshold(5);
Suggest Edits

Set Prompt Options (Disabling Features)

 

This API is used to change the options shown in the Instabug invocation. Any number of prompt options can be passed to this API. Only the options set will show. Below are all the possible options:

  • Show the "Report a Bug" option
  • Show the "Suggest an Improvement" option
  • Show the "Ask a Question" option

While disabling the Bug Reporting option, removes both "Report a Bug" and "Suggest an Improvement", you can also set the enabled report types if you'd only like one or the other.

Enable or Disable Feature

// Disable the Bugs & Feedback. If disabled, both "Report a problem" & "Suggest an improvement" are removed from the Instabug's prompt, and manually showing the bug reporting or feedback doesn't have an effect.
BugReporting.enabled = false

// Disable the Chats. If disabled, The "Ask a question" (this is the new content instead of "Talk to us") option is removed from Instabug's prompt, the compose button in the chats list is removed, and manually showing the chats compose view of the chats doesn't have an effect.
Chats.enabled = false

// Disable the Replies. If disabled, the chats list button is removed from Instabug's prompt, the in-app notifications are disabled, and manually showing the chats list doesn't have an effect. 
Replies.enabled = false
// Disable the Bugs & Feedback. If disabled, both "Report a problem" & "Suggest an improvement" are removed from the Instabug's prompt, and manually showing the bug reporting or feedback doesn't have an effect.
IBGBugReporting.enabled = NO;

// Disable the Chats. If disabled, The "Ask a question" (this is the new content instead of "Talk to us") option is removed from Instabug's prompt, the compose button in the chats list is removed, and manually showing the chats compose view of the chats doesn't have an effect.
IBGChats.enabled = NO;

// Disable the Replies. If disabled, the chats list button is removed from Instabug's prompt, the in-app notifications are disabled, and manually showing the chats list doesn't have an effect. 
IBGReplies.enabled = NO;
// Disable the Bugs & Feedback. If disabled, both "Report a problem" & "Suggest an improvement" are removed from the Instabug's prompt, and manually showing the bug reporting or feedback doesn't have an effect.
BugReporting.setState(Feature.State.DISABLED);

// Disable the Chats. If disabled, The "Ask a question" (this is the new content instead of "Talk to us") option is removed from Instabug's prompt, the compose button in the chats list is removed, and manually showing the chats compose view of the chats doesn't have an effect.
Chats.setState(Feature.State.DISABLED);

// Disable the Replies. If disabled, the chats list button is removed from Instabug's prompt, the in-app notifications are disabled, and manually showing the chats list doesn't have an effect. 
Replies.setState(Feature.State.DISABLED);
// Disable the Bugs & Feedback. If disabled, both "Report a problem" & "Suggest an improvement" are removed from the Instabug's prompt, and manually showing the bug reporting or feedback doesn't have an effect.
BugReporting.setEnabled(true);

// Disable the Chats. If disabled, The "Ask a question" (this is the new content instead of "Talk to us") option is removed from Instabug's prompt, the compose button in the chats list is removed, and manually showing the chats compose view of the chats doesn't have an effect.
Chats.setEnabled(true);

// Disable the Replies. If disabled, the chats list button is removed from Instabug's prompt, the in-app notifications are disabled, and manually showing the chats list doesn't have an effect. 
Replies.setEnabled(true);
// Disable the Bugs & Feedback. If disabled, both "Report a problem" & "Suggest an improvement" are removed from the Instabug's prompt, and manually showing the bug reporting or feedback doesn't have an effect.
cordova.plugins.bugReporting.setEnabled(boolean, successCb, errorCb)

// Disable the Chats. If disabled, The "Ask a question" (this is the new content instead of "Talk to us") option is removed from Instabug's prompt, the compose button in the chats list is removed, and manually showing the chats compose view of the chats doesn't have an effect.
cordova.plugins.chats.setEnabled(boolean, successCb, errorCb)

// Disable the Replies. If disabled, the chats list button is removed from Instabug's prompt, the in-app notifications are disabled, and manually showing the chats list doesn't have an effect. 
cordova.plugins.replies.setEnabled(boolean, successCb, errorCb)
// Disable the Bugs & Feedback. If disabled, both "Report a problem" & "Suggest an improvement" are removed from the Instabug's prompt, and manually showing the bug reporting or feedback doesn't have an effect.
IBGBugReporting.Enabled = true;

// Disable the Chats. If disabled, The "Ask a question" (this is the new content instead of "Talk to us") option is removed from Instabug's prompt, the compose button in the chats list is removed, and manually showing the chats compose view of the chats doesn't have an effect.
IBGChats.Enabled = true;

// Disable the Replies. If disabled, the chats list button is removed from Instabug's prompt, the in-app notifications are disabled, and manually showing the chats list doesn't have an effect. 
IBGReplies.Enabled = true;

Set Enabled Report Types

IBGBugReporting.promptOptionsEnabledReportTypes = IBGBugReportingReportTypeBug | IBGBugReportingReportTypeFeedback;
BugReporting.promptOptionsEnabledReportTypes = [.bug, .feedback]
BugReporting.setReportTypes(BugReporting.ReportType.ReportTypeBug, BugReporting.ReportType.ReportTypeFeedback);
//Arguments: chat, bug, feedback all boolean values
BugReporting.setReportTypes([BugReporting.reportType.bug, BugReporting.reportType.feedback]);
cordova.plugins.bugReporting.setReportTypes([cordova.plugins.bugReporting.reportType.bug, cordova.plugins.bugReporting.reportType.feedback], successCb, errorCb)
//iOS
IBGBugReporting.SetPromptOptionsEnabledReportTypes(IBGBugReportingReportType.Bug)
  
//Android
BugReporting.SetReportTypes(IBGBugReportingReportType.Bug)

Report Types:

//Report a Bug
.bug
  
//Suggest an Improvement
.feedback
//Report a Bug
IBGBugReportingReportTypeBug
  
//Suggest an Improvement
IBGBugReportingReportTypeFeedback
//Bug
BugReporting.ReportType.ReportTypeBug

//Feedback
BugReporting.ReportType.ReportTypeFeedback
//Bug
BugReporting.reportType.bug

//Feedback
BugReporting.reportType.feedback
//Report a Bug
cordova.plugins.bugReporting.reportType.bug
  
//Suggest an Improvement
cordova.plugins.bugReporting.reportType.feedback
//Report a Bug
IBGBugReportingReportType.Bug
  
//Suggest an Improvement
IBGBugReportingReportType.Feedback
Suggest Edits

Email and Comment Requirement (Options)

 

This API is to manipulate email and comment fields requirement. By default, users will be required to enter their email but the comment section will be optional. This method can take any number of arguments with the arguments being Options.

The comments section can be required for a user to send a bug and the email field can also be hidden or set to optional. Below are all the options:

  • Hide email field on new bug/feedback page
  • Show email field on new bug/feedback page but only optionally
  • Require user to fill comment field before submitting new feedback or bug

Method

BugReporting.bugReportingOptions = .emailFieldOptional
IBGBugReporting.bugReportingOptions = IBGBugReportingOptionEmailFieldOptional;
BugReporting.setOptions(Option.EMAIL_FIELD_OPTIONAL);
BugReporting.setInvocationOptions([BugReporting.invocationOptions.emailFieldOptional, BugReporting.invocationOptions.commentFieldRequired]);
cordova.plugins.bugReporting.setOptions(cordova.plugins.bugReporting.invocationOptions.emailFieldOptional, successCb, errorCb)
IBGBugReporting.BugReportingOptions = IBGBugReportingOption.EmailFieldOptional;

Options Parameters:

//Hide email
.emailFieldHidden
//Show email as optional
.emailFieldOptional
//Make comment required
.commentFieldRequired
//Disable post sending dialog
.disablePostSendingDialog
//No option
.none 
//Hide email
IBGBugReportingOptionEmailFieldHidden
//Show email as optional
IBGBugReportingOptionEmailFieldOptional
//Make comment required
IBGBugReportingOptionCommentFieldRequired
//Disable post sending dialog
IBGBugReportingOptionDisablePostSendingDialog
//No option
IBGBugReportingOptionNone
//Hide email
Option.EMAIL_FIELD_HIDDEN
//Show email as optional
Option.EMAIL_FIELD_OPTIONAL
//Make comment required
Option.COMMENT_FIELD_REQUIRED
//Hide email
BugReporting.invocationOptions.emailFieldHidden
//Show email as optional
BugReporting.invocationOptions.emailFieldOptional
//Make comment required
BugReporting.invocationOptions.commentFieldRequired
cordova.plugins.bugReporting.invocationOptions.emailFieldHidden
cordova.plugins.bugReporting.invocationOptions.emailFieldOptional
cordova.plugins.bugReporting.invocationOptions.commentFieldRequired
cordova.plugins.bugReporting.invocationOptions.disablePostSendingDialog
//Hide email
IBGBugReportingOption.EmailFieldHidden
//Show email as optional
IBGBugReportingOption.EmailFieldOptional
//Make comment required
IBGBugReportingOption.CommentFieldRequired
Suggest Edits

Extended Bug Report Mode

 

This method can be used to show additional details in your bug reports. You can find more details on what it does here:

There is a single argument for this method that determines if the mode is enabled or not. The possible options are:

  • Disable extended bug report mode
  • Enable extended bug report mode and set fields to required
  • Enable extended bug report mode and set fields to optional

Method

BugReporting.extendedBugReportMode = .enabledWithRequiredFields
IBGBugReporting.extendedBugReportMode = IBGExtendedBugReportModeEnabledWithRequiredFields;
BugReporting.setExtendedBugReportState(ExtendedBugReport.State.ENABLED_WITH_REQUIRED_FIELDS);
BugReporting.setExtendedBugReportMode(BugReporting.extendedBugReportMode.enabledWithRequiredFields;);
cordova.plugins.instabug.setExtendedBugReportMode(
            "enabledWithRequiredFields",
            function () {
                console.log('Changed mode of visual user steps successfully!');
            },
            function (error) {
                console.log('Problem occurred - ' + error);
            }
        );
IBGBugReporting.ExtendedBugReportMode = IBGExtendedBugReportMode.EnabledWithOptionalFields;

Report Mode Options Parameters:

//Disabled
.disabled
//Enabled and Required
.enabledWithRequiredFields
//Enabled and Optional
.enabledWithOptionalFields
//Disabled
IBGExtendedBugReportModeDisabled
//Enabled and Required
IBGExtendedBugReportModeEnabledWithRequiredFields
//Enabled and Optional
IBGExtendedBugReportModeEnabledWithOptionalFields
//Disabled
ExtendedBugReport.State.DISABLED
//Enabled and Required
ExtendedBugReport.State.ENABLED_WITH_REQUIRED_FIELDS
//Enabled and Optional
ExtendedBugReport.State.ENABLED_WITH_OPTIONAL_FIELDS
//Disabled
BugReporting.extendedBugReportMode.disabled
//Enabled and Required
BugReporting.extendedBugReportMode.enabledWithRequiredFields;
//Enabled and Optional
BugReporting.extendedBugReportMode.enabledWithOptionalFields
//Disabled
cordova.plugins.bugReporting.extendedBugReportMode.disabled
//Enabled and Required
cordova.plugins.bugReporting.extendedBugReportMode.enabledWithRequiredFields
//Enabled and Optional
cordova.plugins.bugReporting.extendedBugReportMode.enabledWithOptionalFields
//Disabled
IBGExtendedBugReportMode.Disabled
//Enabled and Required
IBGExtendedBugReportMode.EnabledWithRequiredFields
//Enabled and Optional
IBGExtendedBugReportMode.EnabledWithOptionalFields
Suggest Edits

Set Private View

 

You can use this API to set any particular view as private so that it is always hidden in screenshots.

view.instabug_privateView = true
view.instabug_privateView = YES;
//Should be added in the onCreate after the superclass call
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
Suggest Edits

Enable or Disable Crash Reporting

 

By default, crash reporting is enabled and will send crashes to your dashboard as soon as you integrate the SDK. If you would prefer to disable this feature, you can this API, and pass it a boolean to enable or disable it.

CrashReporting.enabled = false
IBGCrashReporting.enabled = NO;
// Enable
CrashReporting.setState(Feature.State.ENABLED);
// Disable
CrashReporting.setState(Feature.State.DISABLED);
CrashReporting.setEnabled(false);
Suggest Edits

Report Exception

 

You can manually report exceptions to the dashboard using this API. The method takes an exception as an argument.

CrashReporting.report(exception)
[IBGCrashReporting reportException:exception];
CrashReporting.reportException(new NullPointerException("Test issue"));
try {
      throw new SyntaxError();
    } catch (error) {
      alert(error.name);
      CrashReporting.reportJSException(error);
    }
Suggest Edits

Report Error

 

You can manually report errors to the dashboard using this API. The method takes an error as an argument.

let error = NSError(domain: "domain", code: 500, userInfo: nil)
CrashReporting.reportError(error)
NSError *error = [[NSError alloc] initWithDomain:@"domain" code:500 userInfo:nil];
[IBGCrashReporting reportError:error];
CrashReporting.reportException(new NullPointerException("Test issue"));
try {
      throw new SyntaxError();
    } catch (error) {
      alert(error.name);
      Instabug.reportJSException(error);
    }
Suggest Edits

Show Replies List

 

This API can be used to display the replies page which contains the chat history of the user.

Replies.show()
[IBGReplies show];
Replies.show();
Replies.show();
cordova.plugins.replies.show(successCb, errorCb)
IBGReplies.Show();
Suggest Edits

Push Notifications

 

Chats can be set up to show notifications outside the application if push notifications are set up. These notifications can be handled as required.

You can find more information on push notifications in the sections below.

 
Suggest Edits

Register Push Token

 

In order to receive push notifications, registering your token is necessary. You can use this API to register this token.

Replies.didRegisterForRemoteNotifications(withDeviceToken: deviceToken)
[IBGReplies didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
Replies.setPushNotificationRegistrationToken("PUSH_NOTIFICATION_TOKEN");
Suggest Edits

Set Channel ID

Android Only

 

You can pass a string to this method to set the push notifications as part of a specific channel.

Replies.setPushNotificationChannelId(String pushNotificationChannelId);
Suggest Edits

Show Notification

 

You can use this API to show a notification when you know that it is Instabug related.

Replies.didReceiveRemoteNotification(userInfo)
[IBGReplies didReceiveRemoteNotification:notificationDictionary];
Replies.showNotification(data);
Suggest Edits

Enable or Disable Push Notifications

 

If you would like to disable or enable push notifications at runtime, this method would do the trick.

[IBGReplies setPushNotificationsEnabled:NO];
[IBGReplies setPushNotificationsEnabled:NO];
Replies.setPushNotificationState(Feature.State.ENABLED);
Suggest Edits

Set Notification Icon

Android only

 

Use this API to set the icon you'd like to show for Instabug related notifications. This method takes @DrawableRes int parameter.

Replies.setNotificationIcon(@DrawableRes int notificationIcon);
Suggest Edits

In-App Notifications

 

This section covers all the different details regarding in-app notifications, ranging from sounds to enabling or disabling the notification itself.

 
Suggest Edits

Managing Sounds

Android only

 

There are different types of sounds that play when different events occur. These sounds can all be disabled or enabled based on need.

In-App Notification Sound

Replies.setInAppNotificationEnabled(false);
//Android Only
Replies.setInAppNotificationSound(true);
//Android Only
Replies.setInAppNotificationSound(false);

System Notification Sound

Replies.setSystemReplyNotificationSoundEnabled(boolean shouldPlaySound);

Conversation Sound

Replies.setShouldPlayConversationSounds(false);
//iOS
//Not supported on iOS

//Android
new Instabug.Builder(this, "ANDROID_APP_TOKEN")
  	.SetInvocationEvent(InstabugInvocationEvent.Shake)
  	.SetShouldPlayConversationSounds(false)
  	.Build();
Suggest Edits

Enable or Disable In-App Notifications

 

By default, your users will receive in-app notifications when they receive a new message. This in-app popup notification can be disabled or enabled as required using this API.

Replies.inAppNotificationsEnabled = false
IBGReplies.inAppNotificationsEnabled = NO;
Replies.setInAppNotificationEnabled(false);
Replies.setInAppNotificationsEnabled(false);
cordova.plugins.replies.setInAppNotificationEnabled(boolean, successCb, errorCb);
//iOS
Replies.InAppNotificationsEnabled = false;

//Android
Replies.setInAppNotificationEnabled(false);
Suggest Edits

Check for Existing Chats

 

This method returns a boolean variable that depicts whether or not the user has existing chats.

Replies.hasChats()
[IBGReplies hasChats];
Replies.hasChats();
Replies.hasChats();
cordova.plugins.replies.hasChats(successCb, errorCb)
IBGReplies.HasChats();
Suggest Edits

Get Unread Count

 

This API returns an integer representing the number unread messages by the user.

Replies.unreadRepliesCount
IBGReplies.unreadRepliesCount;
Replies.getUnreadRepliesCount();
Replies.getUnreadRepliesCount((count) => {
  Alert.alert("UnReadMessages", "Messages: " + count);
});
cordova.plugins.replies.getUnreadMessagesCount((count) => {}, (error) => {});
//iOS
Replies.UnreadRepliesCount;

//Android
Replies.getUnreadRepliesCount();
Suggest Edits

Enable or Disable Replies

 

You can completely disable replies to prevent your users from being able to see the replies page as well as disabling in-app notifications.

Replies.enabled = false
IBGReplies.enabled = NO;
Replies.setState(Feature.State.DISABLED);
Replies.setEnabled(true);
cordova.plugins.replies.setEnabled(boolean, successCb, errorCb)
IBGReplies.Enabled = true;
Suggest Edits

Identify User

 

This API is primarily used to identify your user, sort of like a log in kind of method. The API takes two strings, the user's email being the first, and the user's name for the second.

Instabug.identifyUser(withEmail: "john.appleseed@apple.com", name: "John Appleseed")
[Instabug identifyUserWithEmail:@"john.appleseed@apple.com" name:@"John Appleseed"];
Instabug.identifyUser("user name", "email");
Instabug.identifyUserWithEmail("john.appleseed@apple.com", "John Appleseed");
cordova.plugins.instabug.identifyUserWithEmail(
    'john.appleseed@apple.com',
  	'John',
    function () {
        console.log('Success');
    },
    function (error) {
        console.log(error);
    }
);
//iOS
Instabug.IdentifyUserWithEmail("user_email", "user_name");

//Android 
Instabug.IdentifyUser("user_email", "user_name");
Suggest Edits

User Attributes

 

Attributes are collected by default by the Instabug SDK. These attributes contain information related to the users. You can add custom attributes using these APIs. Attributes can be added, retrieved, and removed.

Adding

Attach custom attributes to your user by passing two strings to the set attribute API. Much like a dictionary or map, the two strings are the value and key of the attribute.

Retrieving

You can retrieve all attributes related to a user using the retrieve API. This API returns an NSDictionary for iOS and a HashMap for Android.

Removing

Attributes can be removed from a user by passing the key of the attribute you'd like to remove to the removal API.

Adding Attributes

Instabug.setUserAttribute("True", withKey: "Logged in")
Instabug.setUserAttribute("False", withKey: "Completed IAP")
[Instabug setUserAttribute:@"True" withKey:@"Logged in"];
[Instabug setUserAttribute:@"18" withKey:@"Age"];
Instabug.setUserAttribute("Age", "18");
Instabug.setUserAttribute("LoggedIn", "True");
Instabug.setUserAttribute("Age", "18");
Instabug.setUserAttribute("Logged", "True");
//Android only
cordova.plugins.instabug.setUserAttribute(
    'Logged_out',
  	'true',
    function () {
        console.log('Success');
    },
    function (error) {
        console.log(error);
    }
);
//iOS
Instabug.SetUserAttribute("18", "Age");
Instabug.SetUserAttribute("True", "LoggedIn");

//Android 
Instabug.SetUserAttribute("Age", "18");
Instabug.SetUserAttribute("LoggedIn", "True");

Retrieving Attributes

//Retrieving
let loggedIn = Instabug.userAttribute(forKey: "Logged in")
//Retrieve all
let allUserAttributes = Instabug.userAttributes()
//Retrieve one
NSString *loggedIn = [Instabug userAttributeForKey:@"Logged in"];
//Retrieve all
NSDictionary *allUserAttributes = [Instabug userAttributes];
//Get map of user attributes
HashMap<String, String> userAttrs = Instabug.getAllUserAttributes();
// Getting attribute
Instabug.getUserAttribute("Logged in", function(attribute) {
  // `attribute` is the return value
});

// Loading all attributes
Instabug.getAllUserAttributes(function (allAttributes) {
  // `allAttributes` Object containing all keys and attributes
});
//Android only
//Get the value of a ceratin user attribute
cordova.plugins.instabug.getUserAttribute(
    'Logged_out',
    function (userAttribute) {
        console.log('Logged out: ' + userAttribute);
    },
    function (error) {
        console.log(error);
    }
);

//Get all user attributes
cordova.plugins.instabug.getAllUserAttributes(
    function (userAttributes) {
        console.log('Keys: ' + Object.keys(userAttributes));
      	console.log('Logged out: ' + userAttributes.Logged_out);
    },
    function (error) {
        console.log(error);
    }
);
//iOS
//Get all the created user attributes
Instabug.UserAttributes();
//Get the value of a ceratin user attribute
Instabug.UserAttributeForKey("Age");

//Android
//Get the value of a ceratin user attribute
String value = Instabug.GetUserAttribute("Age");

Removing Attributes

Instabug.removeUserAttribute(forKey: "Logged in")
[Instabug removeUserAttributeForKey:@"Logged in"];
//remove a user attribute
Instabug.removeUserAttribute("KEY");

//remove all user attributes 
Instabug.clearAllUserAttributes();
Instabug.removeUserAttribute("Completed IAP");
//Android only
//Remove a user attribute
cordova.plugins.instabug.removeUserAttribute(
    'Logged_out',
    function () {
        console.log('Success');
    },
    function (error) {
        console.log(error);
    }
);
//iOS
//Remove a user attribute
Instabug.RemoveUserAttributeForKey("Age");

//Android
//Remove a user attribute
Instabug.RemoveUserAttribute("Age");
//Remote all user attributes 
Instabug.ClearAllUserAttributes();
Suggest Edits

User Data

 

User data is used to add chunks of information to a user so that it's sent to the dashboard with the reports. Each call to this API overwrites the previous data added. This method takes a string argument.

let profileDetails = user.allProfileDetails()
let profileDetailsString = "\(profileDetails)"
Instabug.userData = profileDetailsString
NSDictionary *profileDetails = [user allProfileDetails];
NSString *profileDetailsString = [NSString stringWithFormat:@"%@", profileDetails];
Instabug.userData = profileDetailsString;
Instabug.setUserData("User data");
Instabug.setUserData("User data sample");
//Set the user data 
cordova.plugins.instabug.setUserData(
    'user_data',
    function () {
        console.log('Success');
    },
    function (error) {
        console.log(error);
    }
);
//iOS
Instabug.SetUserData("user_data");

//Android 
Instabug.UserData = "User data";
 

In the event of a user logging out or if you want new reports to no longer be associated with a specific user, you can use the log out API.

Instabug.logOut()
[Instabug logOut];
Instabug.logoutUser();
Instabug.logOut();
//Android only
cordova.plugins.instabug.logOut(
    function () {
        console.log('Success');
    },
    function (error) {
        console.log(error);
    }
);
//iOS
Instabug.LogOut();

//Android
Instabug.LogoutUser();
 

Instabug offers various types of logging methods. The logs we collect are:

  • Console Logs
  • Instabug Logs
  • Network Logs
  • User Steps
  • User Events

Console Logging on iOS 10

Due to changes made by Apple on iOS 10+, certain workarounds are required to capture console logs. These are detailed here.

 
Suggest Edits

Instabug Logging

 

Instabug logging functions very similarly to normal logging with the added benefits of having different verbosity levels. These can be filtered on the Instabug dashboard.

The available verbosity levels are:

  • Log
  • Verbose
  • Info
  • Warning
  • Debug
  • Error
IBGLog.log("Log statement")
IBGLog.logVerbose("Verbose statement")
IBGLog.logInfo("Info statement")
IBGLog.logWarn("Warning statement")
IBGLog.logDebug("Debug statement")
IBGLog.logError("Error statement")
IBGLogVerbose(@"Verbose log message");
IBGLogDebug(@"Debug log message");
IBGLogInfo(@"Info log message");
IBGLogWarn(@"Warn log message");
IBGLogError(@"Error log message");
InstabugLog.d("Message to log");
InstabugLog.v("Message to log");
InstabugLog.i("Message to log");
InstabugLog.e("Message to log");
InstabugLog.w("Message to log");
InstabugLog.wtf("Message to log");
Instabug.logVerbose("Message to log")
Instabug.logInfo("Message to log")
Instabug.logDebug("Message to log")
Instabug.logError("Message to log")
Instabug.logWarn("Message to log")
cordova.plugins.instabug.addLog(
    'content',
    {
        enableInstabugLogs: true
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);
//iOS
IBGLog.LogInfo("info");
IBGLog.LogWarn("warning");
IBGLog.LogVerbose("verbose");
IBGLog.LogDebug("debug");
IBGLog.LogError("error");

//Android
InstabugLog.W("Warning message");
InstabugLog.E("Error message");
InstabugLog.I("Information message");
InstabugLog.V("Verbose message");
InstabugLog.D("Debug message");
InstabugLog.Wtf("Failure message");
Suggest Edits

Network Logging - iOS

 

Network logs are automatically collected by Instabug when possible. There are many way to configure and manipulate these logs from the code.

Disable and Enable Request Logging

By default, request logging is enabled. It can be disabled using the API to the right.

Omitting Requests from Logs

You can omit requests from being logged based on either their request or response details. [Instabug setNetworkLoggingRequestFilterPredicate:responseFilterPredicate:] allows you to specify two predicates that are going to be evaluated against every request and response to determine if the request should be included in logs or not.

The example code to the right will exclude all requests made to URLs that have /products path. It will also exclude all responses that has a success and redirection status code, thus only including requests with 4xx and 5xx responses.

requestFilterPredicate is evaluated against an NSURLRequest, while responseFilterPredicate is evaluated against an NSHTTPURLResponse.

Obfuscating Data

Both requests and responses can be obfuscated if required. You can obfuscate user sensitive data in requests, like authentication tokens for example, without filtering out the whole request. As with requests, the response object, as well as the response data, could be modified for obfuscation purposes before they are logged.

Enable and Disable

NetworkLogger.enabled = false
IBGNetworkLogger.enabled = NO;

Omit Request

let path = "/products"
let requestPredicate = NSPredicate(format: "URL.path MATCHES %@", path)
let responsePredicate = NSPredicate(format: "statusCode >= %d AND statusCode <= %d", 200, 399)
Instabug.setNetworkLoggingRequestFilterPredicate(requestPredicate, responseFilterPredicate: responsePredicate)
NSString *path = @"/products";
NSPredicate *requestPredicate = [NSPredicate predicateWithFormat:@"URL.path MATCHES %@", path];
NSPredicate *responsePredicate = [NSPredicate predicateWithFormat:@"statusCode >= %d AND statusCode <= %d", 200, 399];
[Instabug setNetworkLoggingRequestFilterPredicate:requestPredicate responseFilterPredicate:responsePredicate];

Obfuscate Request

NetworkLogger.requestObfuscationHandler = { (request) -> URLRequest in
    var myRequest:NSMutableURLRequest = request.mutableCopy()
    let urlString = request.url?.absoluteString
    urlString = obfuscateAuthenticationTokenInString()
    let obfuscatedURL = URL(string: urlString)
    myRequest.url = obfuscatedURL
    return myRequest
}
IBGNetworkLogger.requestObfuscationHandler = ^NSURLRequest * _Nonnull(NSURLRequest * _Nonnull request) { 
    NSMutableURLRequest *myRequest = [request mutableCopy];
    NSString *urlString = request.URL.absoluteString
    urlString = [self obfuscateAuthenticationTokenInString:urlString];
    NSURL *obfuscatedURL = [NSURL URLWithString:urlString];
    myRequest.url = obfuscatedURL;
    return myRequest;
};

Obfuscate Response

NetworkLogger.setResponseObfuscationHandler { (data, response, completion) in
    if let data = data {
        let modifiedData = self.modify(data: data)
        let modifiedResponse = self.modify(response: response)
        
        completion(modifiedData, modifiedResponse)
    }
}
[IBGNetworkLogger setResponseObfuscationHandler:^(NSData * _Nullable responseData, NSURLResponse * _Nonnull response, NetworkObfuscationCompletionBlock  _Nonnull returnBlock) {
    NSData *modifiedData = [self obfuscateData:responseData];
    NSURLResponse *modifiedResponse = [self obfuscateResponse:response];
    
    returnBlock(modifiedData, modifiedResponse);
}];
Suggest Edits

Network Logging - Android

 

Network logs are automatically collected by Instabug when possible. There are many way to configure and manipulate these logs from the code.

Logging HttpUrlConnection Requests

To log network requests, use InstabugNetworkLog then use the following method at the HttpUrlConnection, requestBody and responseBody. A more detailed example can be found here.

Logging Okhttp Requests

In order to log Okhttp requests, first make sure that you compiled Instabug with a network interceptor. By adding the following to your Gradle:
implementation 'com.instabug.library:instabug-with-okhttp-interceptor:8+'

An example of the implementation can be found on the right hand side of this section.

Logging HttpUrlConnection Requests

 InstabugNetworkLog networkLog = new InstabugNetworkLog();
 networkLog.Log(urlConnection, requestBody, responseBody);

Logging Okhttp Requests

InstabugOkhttpInterceptor instabugOkhttpInterceptor = new InstabugOkhttpInterceptor();

OkHttpClient client = new OkHttpClient.Builder()
	.addInterceptor(interceptor)
	.addInterceptor(instabugOkhttpInterceptor)
	.build();
Suggest Edits

User Steps

 

By default, user steps are collected by the SDK. These are all the steps the user has done up to the latest report. This feature can be disabled using this API

Instabug.trackUserSteps = false
Instabug.trackUserSteps = NO;
//Availble on iOS only
Instabug.setUserStepsEnabled(true);
//iOS
//Can be done through the activate method
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
        enableTrackingUserSteps: true
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

//Android 
//Builder method generated in MyApplication class
new Instabug.Builder(this, "APP_TOKEN")
	.setInvocationEvent(InstabugInvocationEvent.SHAKE)
  .setTrackingUserStepsState(Feature.State.DISABLED)
	.build();
//iOS
Instabug.TrackUserSteps = true;

//Android
new Instabug.Builder(this, "ANDROID_APP_TOKEN")
            .SetInvocationEvent(InstabugInvocationEvent.Shake)
            .SetTrackingUserStepsState(Feature.State.Disabled)
						.Build();
Suggest Edits

User Events

 

You can manually log user events and send them with each report using this method. This method takes a single string.

Instabug.logUserEvent(withName: "Skipped Walkthrough")
[Instabug logUserEventWithName:@"Skipped Walkthrough"];
logUserEvent(String eventIdentifier);
Instabug.logUserEventWithName("OnFeedbackButtonClicked");
cordova.plugins.instabug.logUserEventWithName('event', successCb, errorCb)
//iOS
Instabug.LogUserEventWithName("User Event");

//Android
//Not supported yet.
Suggest Edits

Repro Steps

 

Much like user steps, repro steps are also collected by default. They show the user steps, which are the steps the user has taken until the report was sent in compiled by view.

user repro collection can be disabled using this method.

Method

Instabug.reproStepsMode = .disable
Instabug.reproStepsMode = IBGUserStepsModeDisable;
//Method 1
new Instabug.Builder(this, “APP_TOKEN”)
	.setInvocationEvents(InstabugInvocationEvent.SHAKE)
  .setReproStepsState(State.DISABLED)
	.build(); 

//Method 2
Instabug.setReproStepsState(State.DISABLED);
Instabug.setReproStepsMode(Instabug.reproStepsMode.enabled);
// Supported in iOS only
cordova.plugins.instabug.setReproStepsMode(
  'enabled',
  function () {
    console.log('Changed mode of visual user steps successfully!');
  },
  function (error) {
    console.log('Problem occurred - ' + error);
  }
);
//iOS
Instabug.ReproStepsMode = IBGUserStepsMode.Enabled;

//Android 
new Instabug.Builder(this, "ANDROID_APP_TOKEN")
            .SetInvocationEvent(InstabugInvocationEvent.Shake)
            .SetReproStepsState(State.Enabled)
						.Build();

Repro Steps Parameters:

//Enable
.enable
//Disable
.disable
//Enable
IBGUserStepsModeEnable
//Disable
IBGUserStepsModeDisable
State.ENABLED;
State.DISABLED;
Instabug.reproStepsMode.enabled
Instabug.reproStepsMode.disabled
// Supported in iOS only
'enabled'
'disabled'
//iOS
IBGUserStepsMode.Enabled
IBGUserStepsMode.Disabled
  
//Android
State.Enabled
State.Disabled
Suggest Edits

Attachments

 

Each report can have multiple different forms of attachments attached to them. These attachments range from screenshots to extra files you've attached yourself. The sections below explain how to set the types of attachment your users can use, how to attach a file yourself, and how to clear attachments.

 
Suggest Edits

Set Attachment Types

 

You can set the types of attachments your users can add to reports using this API.

The available attachment types are:

  • Initial Screenshot
  • Extra Screenshot
  • Gallery Image
  • Screen Recording

Method

BugReporting.enabledAttachmentTypes = [.screenShot, .screenRecording]
IBGBugReporting.enabledAttachmentTypes = IBGAttachmentTypeScreenShot | IBGAttachmentTypeScreenRecording;
// Arguments:initialScreenshot, extraScreenshot, galleryImage & ScreenRecording
BugReporting.setAttachmentTypesEnabled(true, true, true, true);
Instabug.setEnabledAttachmentTypes(screenshot, extraScreenshot, galleryImage, screenRecording);

//All properties are boolean values
cordova.plugins.bugReporting.setEnabledAttachmentTypes(screenshot,
  extraScreenshot,
  galleryImage,
  screenRecording,
  success,
  error);

//All properties are boolean values
//iOS

IBGBugReporting.EnabledAttachmentTypes = IBGAttachmentType.Screenshot | IBGAttachmentType.ScreenRecording;

//Android 
//Boolean parameters: initialScreenshot,  extraScreenshot,  galleryImage,  ScreenRecording
new Instabug.Builder(this, "ANDROID_APP_TOKEN")
  	.SetInvocationEvent(InstabugInvocationEvent.Shake)
  	.SetAttachmentTypesEnabled(true, true, true, false)
  	.Build();

Attachment Types Enums:

//Inital Screenshot
.screenShot
//Extra Screenshot
.extraScreenShot
//Gallery Image
.galleryImage
//Screen Recording
.screenRecording
//Inital Screenshot
IBGAttachmentTypeScreenshot;
//Extra Screenshot
IBGAttachmentTypeExtraScreenshot;
//Gallery Image
IBGAttachmentTypeGalleryImage;
//Screen Recording
IBGAttachmentTypeScreenRecording;
//iOS Only
IBGAttachmentType.ScreenRecording
IBGAttachmentType.Screenshot
IBGAttachmentType.ExtraScreenshot
IBGAttachmentType.GalleryImage
Suggest Edits

Add Extra Attachment

 

It's possible to manually add an extra attachment to the report by passing a file URL to this method.

let url = fileURL()
Instabug.addFileAttachment(with: url)
NSURL *url = self.fileURL;
[Instabug addFileAttachmentWithURL:url];
Instabug.addFileAttachment(fileUri, "file_name.txt");
Instabug.addFileAttachment(filePath)
cordova.plugins.instabug.addFile(
    'FILE_PATH',
    function () {
        console.log('File added.');
    },
    function (error) {
        console.log('File could not be added - ' + error);
    }
);
//iOS
NSUrl url = new NSUrl(“url”);
Instabug.AddFileAttachmentWithURL(url);

//Android
Instabug.AddFileAttachment(Android.Net.Uri.Parse("sample text attachment"), "extra_text_attachment");
Suggest Edits

Clear Attachments

 

This method can be used to clear the list of files to be attached to the next report.

Instabug.clearFileAttachments()
[Instabug clearFileAttachments];
Instabug.clearFileAttachment();
//iOS
Instabug.ClearFileAttachments();

//Android 
Instabug.ClearFileAttachment();

Tag reports manually using the tagging feature to ease the process of filtering through your reports. The below sections explain how to add, get, and remove tags.

 
 

To add a tag to the upcoming report, you can use this method and pass to it any number of strings, each denoting a unique tag.

Instabug.appendTags(["Design", "Flow"])
[Instabug appendTags:@[@"Design", @"Flow"]];
Instabug.addTags("Tag one", "Tag two", "Tag three");
Instabug.appendTags(["Tag 1", "Tag 2"]);
 

Retrieve the tags attached to the upcoming report using this method. This method returns an array of strings.

let tags = Instabug.getTags()
NSString *tags = [Instabug getTags];
Instabug.getTags();
Instabug.getTags(function (tags) {
  // `tags` is the returned values
});
Suggest Edits

Reset Tags

 

Use this method to remove all tags from the upcoming report.

Instabug.resetTags()
[Instabug resetTags];
Instabug.resetTags();
Instabug.resetTags();
Suggest Edits

Session Profiler

 

The Session Profiler captures the state of the device as well as the app for up to 60 seconds before the report is sent.

In case you would like to disable the Session Profiler, you can use this API.

Instabug.setSessionProfilerEnabled(false)
[Instabug setSessionProfilerEnabled:NO];
Instabug.setSessionProfilerState(Feature.State.ENABLED);
Instabug.setSessionProfilerEnabled(true);
//can only be done through the initial activate method
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
       enableSessionProfiler: true
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);
Instabug.SetSessionProfilerEnabled(true);
Suggest Edits

Manually Show Survey

 

If you created a survey on the dashboard that you use to manually target users, you'll be provided with a token. You can pass this token to the show survey API to manually show it at anytime.

Surveys.showSurvey(withToken: "TOKEN")
[IBGSurveys showSurveyWithToken:@"TOKEN"];
Surveys.showSurvey("TOKEN");
Surveys.showSurvey("TOKEN");
cordova.plugins.surveys.showSurveyWithToken(
    'SURVEY_TOKEN',
    function () {
      console.log('Survey with token shown.');
    },
    function (error) {
      console.log('Survey with token could not get shown - ' + error);
    }
  };
//iOS
IBGSurveys.ShowSurveyWithToken("TOKEN");

//Android
Surveys.ShowSurvey("TOKEN");
Suggest Edits

Check if Responded

 

You can pass a survey token to this API to check if a particular user has responded to the survey before showing it. This method takes a string token as an argument and returns a boolean.

Surveys.hasRespondedToSurvey(withToken: "TOKEN")
[IBGSurveys hasRespondedToSurveyWithToken:@"TOKEN"];
Surveys.hasRespondToSurvey("TOKEN"); 
Surveys.hasRespondedToSurvey("SURVEY_TOKEN", function(hasResponded) {
  alert("Has Responded: "+hasResponded);
});
cordova.plugins.surveys.hasRespondedToSurveyWithToken(
  'SURVEY_TOKEN',
  function (hasResponded) {
    console.log('Has Responded: '+hasResponded);
  },
  function (error) {
    console.log('Could not get the value - ' + error);
  }
);
//iOS
bool hasResponded = IBGSurveys.HasRespondedToSurveyWithToken("TOKEN");

//Android
bool hasResponded = Surveys.HasRespondToSurvey("TOKEN");
Suggest Edits

Get Available Surveys

 

This method returns all possible available surveys that can be shown to the user. A list of survey objects is returned by this API.

let surveys = Surveys.availableSurveys
NSArray<IBGSurvey *> *surveys = [IBGSurveys availableSurveys];
Surveys.getAvailableSurveys();
Suggest Edits

Show Available Survey

 

Use this method to automatically show any survey this user can see at the moment, provided the user meets the surveys criteria.

Surveys.showSurveyIfAvailable()
[IBGSurveys showSurveyIfAvailable];
Surveys.showSurveyIfAvailable()
Surveys.showSurveyIfAvailable();
cordova.plugins.surveys.showSurveyIfAvailable(
  					function () {
                console.log('Invoke method called!');
            },
            function (error) {
                console.log('Invocation event could not be set - ' + error);
            }
				);
//iOS
IBGSurveys.ShowSurveyIfAvailable();

//Android
Surveys.ShowSurveyIfAvailable();
Suggest Edits

Set Reshow Threshold

 

The reshow threshold dictates how many sessions and days must pass before a survey is shown again. Both conditions must be met in order to trigger showing the survey again.

This method takes two integers, the first determining the number of sessions, while the second determines the number of days.

Surveys.setThresholdForReshowingSurveyAfterDismiss(3, daysCount: 5)
[IBGSurveys setThresholdForReshowingSurveyAfterDismiss:3 daysCount:5];
//Set how many sessions and days are required to show the survey again
Surveys.setThresholdForReshowingSurveyAfterDismiss(int sessionsCount, int daysCount);
Surveys.setThresholdForReshowingSurveyAfterDismiss(5,10);
cordova.plugins.surveys.setThresholdForReshowingSurveyAfterDismiss(
            5,
            10,
            function () {
                console.log('Reshowing survey threshold set.');
            },
            function (error) {
                console.log('Reshowing survey threshold could not be set - ' + error);
            }
        );
//iOS
IBGSurveys.SetThresholdForReshowingSurveyAfterDismiss(3, 5);

//Android
Surveys.SetThresholdForReshowingSurveyAfterDismiss(3, 5);
Suggest Edits

Show Survey Welcome Message

 

Any survey usually starts off getting straight to the point. You can have the survey instead start with a simple welcome message. To enable the welcome message, you can use this API.

Surveys.shouldShowWelcomeScreen = true
IBGSurveys.shouldShowWelcomeScreen = YES;
Surveys.setShouldShowWelcomeScreen(true);
Surveys.setShouldShowWelcomeScreen(true);
cordova.plugins.surveys.setShouldShowSurveysWelcomeScreen(
            true,
            function () {
                console.log('Survey welcome screen will be shown.');
            },
            function (error) {
                console.log('Could not set survey welcome screen to be shown - ' + error);
            }
        );
//iOS
IBGSurveys.ShouldShowWelcomeScreen = true;

//Android 
Surveys.SetShouldShowWelcomeScreen(true);
Suggest Edits

Enable or Disable Auto-Showing

 

By default, surveys will show automatically within 10 seconds of launching the application provided the user meets the criteria required. This automatic showing of surveys can be disabled and enabled using this API.

Surveys.autoShowingEnabled = false
IBGSurveys.autoShowingEnabled = NO;
Surveys.setAutoShowingEnabled(false);
Surveys.setAutoShowingEnabled(false);
cordova.plugins.surveys.setAutoShowingEnabled(
            true,
            function () {
                console.log('Invoke method called!');
            },
            function (error) {
                console.log('Invocation event could not be set - ' + error);
            }
        );
//iOS
IBGSurveys.AutoShowingEnabled = false;

//Android
Surveys.SetAutoShowingEnabled(false);
Suggest Edits

Enable or Disable Surveys

 

If you would like to disable the surveys from showing in general, including manual targeting surveys, you can do so using this API.

Disabling Surveys

This API completely disables surveys, meaning surveys will not be shown regardless of the code called.

Surveys.enabled = false;
[IBGSurveys setEnabled:NO];
// Enable
Surveys.setState(Feature.State.ENABLED);
// Disable
Surveys.setState(Feature.State.DISABLED);
Surveys.setEnabled(false);
cordova.plugins.surveys.setEnabled(true, success, error);
Surveys.Enabled = false;
Suggest Edits

Show Feature Requests

 

This method can be used to display the feature requests page. It is recommended that this method be attached to a button, for example.

FeatureRequests.show()
[IBGFeatureRequests show];
FeatureRequests.show();
FeatureRequests.show();
cordova.plugins.featureRequests.show(
            true,
            function () {
                console.log('showFeatureRequests successfully!');
            },
            function (error) {
                console.log('Error: showFeatureRequests - ' + error);
            }
        );
//iOS
IBGFeatureRequests.Show();

//Android
FeatureRequests.Show();
Suggest Edits

Setting Email Requirement

 

When a user creates a new feature request or adds a comment, they are asked to enter their email. You can use this method to set whether this email is required or not. This method takes a boolean for its first argument (whether the requirement is true or false) and enums for the second argument (for comment or new feature). More than one enum can be passed.

Method

FeatureRequests.setEmailFieldRequired(true, for: [.newFeature, .addCommentToFeature])
[IBGFeatureRequests setEmailFieldRequired:YES forAction: IBGActionTypeRequestNewFeature | IBGActionAddCommentToFeature]
FeatureRequests.setEmailFieldRequired(boolean, ActionType.REQUEST_NEW_FEATURE); 
FeatureRequests.setEmailFieldRequired(true, [Instabug.actionTypes.requestNewFeature]);
cordova.plugins.featureRequests.setEmailFieldRequired(
  					true,
  					[cordova.plugins.featureRequests.actionTypes.requestNewFeature],
            function () {
                console.log('Email requirements set successfully!');
            },
            function (error) {
                console.log('Email requirements were not set - ' + error);
            }
        );
//iOS
IBGFeatureRequests.SetEmailFieldRequired(true, IBGAction.RequestNewFeature);

//Android
FeatureRequests.SetEmailFieldRequired(true, Com.Instabug.Featuresrequest.ActionType.RequestNewFeature);

Email Parameters:

//New Feature
.newFeature
//New Comment
.addCommentToFeature
//New Feature
IBGActionTypeRequestNewFeature
//New Comment
IBGActionAddCommentToFeature
//New Feature
ActionType.REQUEST_NEW_FEATURE 
//New Comment
ActionType.ADD_COMMENT_TO_FEATURE
//New Feature
Instabug.actionTypes.requestNewFeature
//New Comment
Instabug.actionTypes.addCommentToFeature
//New Feature
cordova.plugins.featureRequests.actionTypes.requestNewFeature
//New Comment
cordova.plugins.featureRequests.actionTypes.addCommentToFeature
//iOS
//New Feature
IBGAction.RequestNewFeature
//New Comment
IBGAction.AddCommenToFeature
  
//Android
//New Feature
Com.Instabug.Featuresrequest.ActionType.RequestNewFeature
//New Comment
Com.Instabug.Featuresrequest.ActionType.AddCommentToFeature
Suggest Edits

Set Theme

 

By default, the Instabug SDK uses a light theme. This, however, can be changed to use a dark theme. To do this, you can use this API while passing the relevant enum to it.

Method

Instabug.setColorTheme(.dark)
[Instabug setColorTheme:IBGColorThemeDark];
Instabug.setColorTheme(InstabugColorTheme.InstabugColorThemeLight);
Instabug.setColorTheme(Instabug.colorTheme.dark);
//Can be done through the activate method properties
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
        colorTheme: 'dark'
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);
//iOS
Instabug.SetColorTheme(IBGColorTheme.Light);

//Android
Instabug.SetColorTheme(InstabugColorTheme.InstabugColorThemeLight);

Theme Parameters:

//Light
.light
//Dark
.dark
//Light
IBGColorThemeLight
//Dark
IBGColorThemeDark
//Light
IBGColorThemeLight
//Dark
IBGColorThemeDark
//Light
Instabug.colorTheme.light
//Dark
Instabug.colorTheme.dark
//Light
'light'
//Dark
'dark'
//iOS
//Light
IBGColorTheme.Light
//Dark
IBGColorTheme.Dark

//Android
//Light
InstabugColorTheme.InstabugColorThemeLight
//Dark
InstabugColorTheme.InstabugColorThemeDark
Suggest Edits

Set Primary Color

 

This API is used to change the color of both the text and icons to match your app color. You can pass to it any color required.

Instabug.tintColor = .lightGray
Instabug.tintColor = UIColor.lightGrayColor;
Instabug.setPrimaryColor(Color.BLUE);
Instabug.setPrimaryColor(processColor('#ff0000'));
//iOS
cordova.plugins.instabug.setPrimaryColor(
    Color.Red,
    function () {
        console.log('Primary color changed.');
    },
    function (error) {
        console.log('Could not change primary color - ' + error);
    }
);

//Android 
//Builder method generated in MyApplication class
new Instabug.Builder(this, "APP_TOKEN")
	.setInvocationEvent(InstabugInvocationEvent.SHAKE)
  .setPrimaryColor(Color.BLUE)
	.build();
//iOS
Instabug.TintColor = UIColor.Red;

//Android
Instabug.PrimaryColor = -7583749;
Suggest Edits

Set Floating Button Position

 

If you're using the floating button as your primary invocation method, you can set a position for it to show up by default.

There are two variables here that can be manipulated:

  • floatingButtonEdge: Which edge of the screen to show the button
  • floatingButtonTopOffset: The position of the button on the y-axis

Edge

BugReporting.floatingButtonEdge = .maxXEdge
IBGBugReporting.floatingButtonEdge = CGRectMaxXEdge;
BugReporting.setFloatingButtonEdge(InstabugFloatingButtonEdge.RIGHT);
//iOS
Instabug.setFloatingButtonEdge(Instabug.floatingButtonEdge.right, 250);

//Android
new RNInstabugReactnativePackage.Builder("TOKEN",MainApplication.this)
                            .setInvocationEvent("shake")
                            .setPrimaryColor("#1D82DC")
                            .setFloatingEdge("left")
                            .build()
//iOS
//Can be changed through the activate method
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
       floatingButtonEdge:'left',  //Values: left, right. Default:    'right'
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

//Android
//Builder method generated in MyApplication class
new Instabug.Builder(this, "APP_TOKEN")
	.setInvocationEvent(InstabugInvocationEvent.SHAKE)
  .setFloatingButtonEdge(InstabugFloatingButtonEdge.LEFT)
	.build();
//iOS
IBGBugReporting.FloatingButtonEdge = CoreGraphics.CGRectEdge.MaxXEdge;

//Android
new Instabug.Builder(this, "YOUR_ANDROID_TOKEN")
  	.SetInvocationEvent(InstabugInvocationEvent.Shake)
  	.SetFloatingButtonEdge(IBGFloatingButtonEdge.Left)
  	.Build();

Top Offset

BugReporting.floatingButtonTopOffset = 48
IBGBugReporting.floatingButtonTopOffset = 48;
BugReporting.setFloatingButtonOffset(50);
//iOS
Instabug.setFloatingButtonEdge(140)

//Android
new RNInstabugReactnativePackage.Builder("TOKEN",MainApplication.this)
                            .setInvocationEvent("shake")
                            .setPrimaryColor("#1D82DC")
                            .setFloatingButtonOffsetFromTop(250)
                            .build()
//iOS
//Can be changed through the activate method
cordova.plugins.instabug.activate(
    {
        ios: 'MY_IOS_TOKEN'
    },
    cordova.plugins.bugReporting.invocationEvents.shake,
    {
       floatingButtonOffset: 2     //Default value: -1
    },
    function () {
        console.log('Instabug initialized.');
    },
    function (error) {
        console.log('Instabug could not be initialized - ' + error);
    }
);

//Android 
//Builder method generated in MyApplication class
new Instabug.Builder(this, "APP_TOKEN")
	.setInvocationEvent(InstabugInvocationEvent.SHAKE)
  .setFloatingButtonOffsetFromTop(50);
	.build();
//iOS
IBGBugReporting.FloatingButtonTopOffset = 10;

//Android
BugReporting.SetFloatingButtonOffset(50);
Suggest Edits

Set Video Recording Button Position

 

Use this API to set the position of the video recording button when using the screen recording attachment functionality. This API can take an enum of the position.

Method

BugReporting.videoRecordingFloatingButtonPosition = .topLeft;
IBGBugReporting.videoRecordingFloatingButtonPosition = IBGPositionTopLeft;
BugReporting.setVideoRecordingFloatingButtonPosition(InstabugVideoRecordingButtonPosition.BOTTOM_LEFT);
Instabug.setVideoRecordingFloatingButtonPosition(Instabug.IBGPosition.topLeft);
cordova.plugins.instabug.setVideoRecordingFloatingButtonPosition(
  'topLeft',
  function () {
    console.log('Instabug initialized.');
  },
  function (error) {
    console.log('Instabug could not be initialized - ' + error);
  }
);

Position Parameters:

//Top Left
.topLeft
//Top Right
.topRight
//Bottom Left
.bottomLeft
//Bottom Right
.bottomRight
//Top Left
IBGPositionTopLeft
//Top Right
IBGPositionTopRight
//Bottom Left
IBGPositionBottomLeft
//Bottom Right
IBGPositionBottomRight
//Top Left
TOP_LEFT
//Top Right
TOP_RIGHT
//Bottom Left
BOTTOM_LEFT
//Bottom Right
BOTTOM_RIGHT
//Top Left
IBGPosition.topLeft
//Top Right
IBGPosition.topRight
//Bottom Left
IBGPosition.bottomLeft
//Bottom Right
IBGPosition.bottomLeft
//Top Left
'topLeft'
//Top Right
'topRight'
//Bottom Left
'bottomLeft'
//Bottom Right
'bottomRight'
Suggest Edits

Manipulating the Welcome Message

 

On the first time of launching the application, users will be greeted with a brief tutorial on how to use the Instabug SDK. This tutorial changes depending on whether you want to show the beta tester tutorial or the live user tutorial.

The sections below explain how to manually show this message and how to disable it completely.

 
Suggest Edits

Manually Show Welcome Message

 

This API can be used to manually show the welcome message at anytime. Only one argument is passed to this method which is an enum detailing whether to show the beta testers welcome message or the live user welcome message.

Method

Instabug.showWelcomeMessage(with: IBGWelcomeMessageMode.beta)
[Instabug showWelcomeMessageWithMode:IBGWelcomeMessageModeBeta];
Instabug.showWelcomeMessage(WelcomeMessage.State.BETA); 
Instabug.showWelcomeMessage(Instabug.welcomeMessageMode.beta) 
cordova.plugins.instabug.showWelcomeMessage(
            'welcomeMessageModeBeta', // For beta testers
            function () {
                console.log('Welcome message shown.');
            },
            function (error) {
                console.log('Welcome message could not be shown -  ' + error);
            }
        );
Instabug.ShowWelcomeMessageWithMode(IBGWelcomeMessageMode.WelcomeMessageModeBeta); 

Welcome Message Parameters:

//Beta testers message
IBGWelcomeMessageMode.beta
//Live users message
IBGWelcomeMessageMode.live
//Beta testers message
IBGWelcomeMessageModeBeta
//Live users message
IBGWelcomeMessageModeLive
//Beta testers message
WelcomeMessage.State.BETA
//Live users message
WelcomeMessage.State.LIVE
//Beta testers message
Instabug.welcomeMessageMode.beta
//Live users message
Instabug.welcomeMessageMode.live
//Beta testers message
'welcomeMessageModeBeta'
//Live users message
'welcomeMessageModeLive'
//Beta testers message
IBGWelcomeMessageMode.WelcomeMessageModeBeta
//Live users message
IBGWelcomeMessageMode.WelcomeMessageModeLive
Suggest Edits

Set Welcome Message Mode

 

This method can be used to set whether or not the welcome message is shown by default on the first app launch and whether to show the beta testers welcome message or the live users welcome message.

Method

Instabug.welcomeMessageMode = IBGWelcomeMessageMode.beta 
[Instabug setWelcomeMessageMode:IBGWelcomeMessageModeBeta];
Instabug.setWelcomeMessageState(WelcomeMessage.State.BETA); 
Instabug.setWelcomeMessageMode(Instabug.welcomeMessageMode.beta) 
cordova.plugins.instabug.activate(
            {
                ios: 'TOKEN'
            },
            cordova.plugins.bugReporting.invocationEvents.shake,
            {
                "welcomeMessageMode": "welcomeMessageModeBeta"
            },
            function () {
                console.log('Instabug initialized.');
            },
            function (error) {
                console.log('Instabug could not be initialized - ' + error);
            }
        );
Instabug.SetWelcomeMessageMode(IBGWelcomeMessageMode.WelcomeMessageModeBeta)

Welcome Message Parameters:

//Beta testers message
IBGWelcomeMessageMode.beta
//Live users message
IBGWelcomeMessageMode.live
//Disable welcome message
IBGWelcomeMessageMode.disabled
//Beta testers message
IBGWelcomeMessageModeBeta
//Live users message
IBGWelcomeMessageModeLive
//Disable welcome message
IBGWelcomeMessageModeDisabled
//Beta testers message
WelcomeMessage.State.BETA
//Live users message
WelcomeMessage.State.LIVE
//Disable welcome message
WelcomeMessage.State.DISABLED
//Beta testers message
Instabug.welcomeMessageMode.beta
//Live users message
Instabug.welcomeMessageMode.live
//Disable welcome message
Instabug.welcomeMessageMode.disabled
//Beta testers message
'welcomeMessageModeBeta'
//Live users message
'welcomeMessageModeLive'
//Disable welcome message
'welcomeMessageModeDisabled'
//Beta testers message
IBGWelcomeMessageMode.WelcomeMessageModeBeta
//Live users message
IBGWelcomeMessageMode.WelcomeMessageModeLive
//Disable welcome message
IBGWelcomeMessageMode.WelcomeMessageModeDisabled
Suggest Edits

Set Locale

 

The locale of the SDK can be changed by passing the required locale enum to this method.

Method

Instabug.setLocale(.french)
[Instabug setLocale:IBGLocaleFrench];
Instabug.setLocale(new Locale("de"));
Instabug.setLocale(Instabug.locale.french);
cordova.plugins.instabug.setLocale(
    'french',
    function () {
        console.log('Locale changed.');
    },
    function (error) {
        console.log('Failed to fail locale - ' + error);
    }
);
//iOS
Instabug.SetLocale(IBGLocale.English);

//Android
new Instabug.Builder(this, "YOUR_ANDROID_TOKEN")
            .SetInvocationEvent(InstabugInvocationEvent.Shake)
            .SetLocale(Locale.French)
						.Build();

Locale Parameters:

.arabic    
.chinese     
.chinese 
.czech
.danish
.english
.french
.german
.italian
.japanese
.korean
.polish
.portugese
.portugueseBrazil
.russian
.slovak
.spanish
.swedish
.turkish
IBGLocaleArabic    
IBGLocaleChineseSimplified    
IBGLocaleChineseTaiwan
IBGLocaleChineseTraditional
IBGLocaleCzech
IBGLocaleDanish
IBGLocaleDutch
IBGLocaleEnglish
IBGLocaleFrench
IBGLocaleGerman
IBGLocaleItalian
IBGLocaleJapanese
IBGLocaleKorean
IBGLocaleNorwegian
IBGLocalePolish
IBGLocalePortugese
IBGLocalePortugueseBrazil
IBGLocaleRussian
IBGLocaleSlovak
IBGLocaleSpanish
IBGLocaleSwedish
IBGLocaleTurkish
new Locale("en");
new Locale("fr");
new Locale("de");
new Locale("it");
new Locale("ja");
new Locale("ko");
new Locale("zh");
new Locale("zh", "CN");
new Locale("zh", "TW");
new Locale("ar");
new Locale("cs");
new Locale("da");
new Locale("es");
new Locale("fa");
new Locale("in");
new Locale("nl");
new Locale("pl");
new Locale("pt");
new Locale("ru");
new Locale("sk");
new Locale("sv");
new Locale("tr");
Instabug.locale.arabic
Instabug.locale.chineseSimplified
Instabug.locale.chineseTraditional
Instabug.locale.czech
Instabug.locale.danish
Instabug.locale.english
Instabug.locale.french
Instabug.locale.german
Instabug.locale.italian
Instabug.locale.japanese
Instabug.locale.polish
Instabug.locale.portugueseBrazil
Instabug.locale.russian
Instabug.locale.spanish
Instabug.locale.swedish
Instabug.locale.turkish
'arabic'
'chineseSimplified'
'chineseTraditional'
'english'
'french'
'german'
'italian'
'japanese'
'korean'
'polish'
'portugueseBrazil'
'russian'
'spanish'
'swedish'
'turkish'
'czech'
//iOS
IBGLocale.Arabic,
IBGLocale.ChineseSimplified
IBGLocale.ChineseTaiwan
IBGLocale.ChineseTraditional
IBGLocale.Czech
IBGLocale.Danish
IBGLocale.English
IBGLocale.French
IBGLocale.German
IBGLocale.Italian
IBGLocale.Japanese
IBGLocale.Korean
IBGLocale.Norwegian
IBGLocale.Polish
IBGLocale.Portugese
IBGLocale.PortugueseBrazil
IBGLocale.Russian
IBGLocale.Slovak
IBGLocale.Spanish
IBGLocale.Swedish
IBGLocale.Turkish

//Android
Locale.Arabic
Locale.ChineseSimplified
Locale.ChineseTraditional
Locale.Czech
Locale.Danish
Locale.English
Locale.French
Locale.German
Locale.Italian
Locale.Japanese
Locale.Polish
Locale.PortugueseBrazil
Locale.Russian
Locale.Spanish
Locale.Swedish
Locale.Turkish
Suggest Edits

Change String Values

 

Rather than change the locale, you can change specific strings in the SDK to match your preference. This method takes two arguments, the key of the string you'd like to change, the string you'd like to replace it with.

Method

Instabug.setValue("Please enter a correct email address", forStringWithKey: kIBGInvalidEmailTitleStringName)
[Instabug setValue:@"Please enter a correct email address" forStringWithKey:kIBGInvalidEmailTitleStringName];
InstabugCustomTextPlaceHolder placeHolder = new InstabugCustomTextPlaceHolder();
placeHolder.set(REPORT_FEEDBACK, "Send Feedback");
Instabug.setCustomTextPlaceHolders(placeHolder);
Instabug.setStringToKey("Please enter a correct email address", Instabug.strings.invalidEmailMessage);
//iOS
Instabug.SetString("Report a bug", IBGString.ReportBug);

//Android
InstabugCustomTextPlaceHolder placeHolder = new InstabugCustomTextPlaceHolder();
placeHolder.Set(InstabugCustomTextPlaceHolder.Key.ReportBug, "Report a new bug");
Instabug.SetCustomTextPlaceHolders(placeHolder);

Locale Parameters:

kIBGStartAlertTextStringName
kIBGShakeStartAlertTextStringName
kIBGTwoFingerSwipeStartAlertTextStringName
kIBGEdgeSwipeStartAlertTextStringName
kIBGScreenshotStartAlertTextStringName
kIBGInvalidEmailMessageStringName
kIBGInvalidEmailTitleStringName
kIBGInvalidCommentMessageStringName
kIBGInvalidCommentTitleStringName
kIBGInvocationTitleStringName
kIBGAskAQuestionStringName
kIBGReportBugStringName
kIBGReportFeedbackStringName
kIBGEmailFieldPlaceholderStringName
kIBGCommentFieldPlaceholderForBugReportStringName
kIBGCommentFieldPlaceholderForFeedbackStringName
kIBGChatReplyFieldPlaceholderStringName
kIBGAddScreenRecordingMessageStringName
kIBGAddVoiceMessageStringName
kIBGAddImageFromGalleryStringName
kIBGAddExtraScreenshotStringName
kIBGAudioRecordingPermissionDeniedTitleStringName
kIBGAudioRecordingPermissionDeniedMessageStringName
kIBGScreenRecordingPermissionDeniedMessageStringName
kIBGMicrophonePermissionAlertSettingsButtonTitleStringName
kIBGMicrophonePermissionAlertLaterButtonTitleStringName
kIBGChatsTitleStringName
kIBGTeamStringName
kIBGRecordingMessageToHoldTextStringName
kIBGRecordingMessageToReleaseTextStringName
kIBGMessagesNotificationTitleSingleMessageStringName
kIBGMessagesNotificationTitleMultipleMessagesStringName
kIBGScreenshotTitleStringName
kIBGOkButtonTitleStringName
kIBGSendButtonTitleStringName
kIBGCancelButtonTitleStringName
kIBGThankYouAlertTitleStringName
kIBGThankYouAlertMessageStringName
kIBGAudioStringName
kIBGScreenRecordingStringName
kIBGImageStringName
kIBGReachedMaximimNumberOfAttachmentsTitleStringName
kIBGReachedMaximimNumberOfAttachmentsMessageStringName
kIBGVideoRecordingFailureMessageStringName
kIBGSurveyEnterYourAnswerTextPlaceholder
kIBGSurveyNoAnswerTitle
kIBGSurveyNoAnswerMessage
kIBGVideoPressRecordTitle
kIBGCollectingDataText
kIBGLowDiskStorageTitle
kIBGLowDiskStorageMessage
kIBGInboundByLineMessage
kIBGExtraFieldIsRequiredText
kIBGExtraFieldMissingDataText
kIBGSurveyIntroTitleText
kIBGSurveyIntroDescriptionText
kIBGSurveyIntroTakeSurveyButtonText
kIBGSurveyIntroDismissButtonText
kIBGSurveyThankYouTitleText
kIBGSurveyThankYouDescriptionText
kIBGSurveysNPSLeastLikelyStringName
kIBGSurveysNPSMostLikelyStringName
kIBGSurveyNextButtonTitle
kIBGSurveySubmitButtonTitle
kIBGSurveyAppStoreThankYouTitle
kIBGSurveyAppStoreButtonTitle
kIBGExpectedResultsStringName
kIBGActualResultsStringName
kIBGStepsToReproduceStringName
kIBGReplyButtonTitleStringName
kIBGFeatureRequestsTitle 
kIBGFeatureDetailsTitle 
kIBGStringFeatureRequestsRefreshText 
kIBGFeatureRequestSortingByRecentlyUpdatedText 
kIBGFeatureRequestSortingByTopVotesText 
kIBGFeatureRequestErrorStateTitleLabel 
kIBGFeatureRequestErrorStateDescriptionLabel 
kIBGBetaWelcomeMessageWelcomeStepTitle;
kIBGBetaWelcomeMessageWelcomeStepContent;
kIBGBetaWelcomeMessageHowToReportStepTitle;
kIBGBetaWelcomeMessageHowToReportStepContent;
kIBGBetaWelcomeMessageFinishStepTitle;
kIBGBetaWelcomeMessageFinishStepContent;
kIBGBetaWelcomeDoneButtonTitle;
kIBGLiveWelcomeMessageTitle;
kIBGLiveWelcomeMessageContent;
kIBGStartAlertTextStringName
kIBGShakeStartAlertTextStringName
kIBGTwoFingerSwipeStartAlertTextStringName
kIBGEdgeSwipeStartAlertTextStringName
kIBGScreenshotStartAlertTextStringName
kIBGInvalidEmailMessageStringName
kIBGInvalidEmailTitleStringName
kIBGInvalidCommentMessageStringName
kIBGInvalidCommentTitleStringName
kIBGInvocationTitleStringName
kIBGAskAQuestionStringName
kIBGReportBugStringName
kIBGReportFeedbackStringName
kIBGEmailFieldPlaceholderStringName
kIBGCommentFieldPlaceholderForBugReportStringName
kIBGCommentFieldPlaceholderForFeedbackStringName
kIBGChatReplyFieldPlaceholderStringName
kIBGAddScreenRecordingMessageStringName
kIBGAddVoiceMessageStringName
kIBGAddImageFromGalleryStringName
kIBGAddExtraScreenshotStringName
kIBGAudioRecordingPermissionDeniedTitleStringName
kIBGAudioRecordingPermissionDeniedMessageStringName
kIBGScreenRecordingPermissionDeniedMessageStringName
kIBGMicrophonePermissionAlertSettingsButtonTitleStringName
kIBGMicrophonePermissionAlertLaterButtonTitleStringName
kIBGChatsTitleStringName
kIBGTeamStringName
kIBGRecordingMessageToHoldTextStringName
kIBGRecordingMessageToReleaseTextStringName
kIBGMessagesNotificationTitleSingleMessageStringName
kIBGMessagesNotificationTitleMultipleMessagesStringName
kIBGScreenshotTitleStringName
kIBGOkButtonTitleStringName
kIBGSendButtonTitleStringName
kIBGCancelButtonTitleStringName
kIBGThankYouAlertTitleStringName
kIBGThankYouAlertMessageStringName
kIBGAudioStringName
kIBGScreenRecordingStringName
kIBGImageStringName
kIBGReachedMaximimNumberOfAttachmentsTitleStringName
kIBGReachedMaximimNumberOfAttachmentsMessageStringName
kIBGVideoRecordingFailureMessageStringName
kIBGSurveyEnterYourAnswerTextPlaceholder
kIBGSurveyNoAnswerTitle
kIBGSurveyNoAnswerMessage
kIBGVideoPressRecordTitle
kIBGCollectingDataText
kIBGLowDiskStorageTitle
kIBGLowDiskStorageMessage
kIBGInboundByLineMessage
kIBGExtraFieldIsRequiredText
kIBGExtraFieldMissingDataText
kIBGSurveyIntroTitleText
kIBGSurveyIntroDescriptionText
kIBGSurveyIntroTakeSurveyButtonText
kIBGSurveyIntroDismissButtonText
kIBGSurveyThankYouTitleText
kIBGSurveyThankYouDescriptionText
kIBGSurveysNPSLeastLikelyStringName
kIBGSurveysNPSMostLikelyStringName
kIBGSurveyNextButtonTitle
kIBGSurveySubmitButtonTitle
kIBGSurveyAppStoreThankYouTitle
kIBGSurveyAppStoreButtonTitle
kIBGExpectedResultsStringName
kIBGActualResultsStringName
kIBGStepsToReproduceStringName
kIBGReplyButtonTitleStringName
kIBGFeatureRequestsTitle 
kIBGFeatureDetailsTitle 
kIBGStringFeatureRequestsRefreshText 
kIBGFeatureRequestSortingByRecentlyUpdatedText 
kIBGFeatureRequestSortingByTopVotesText 
kIBGFeatureRequestErrorStateTitleLabel 
kIBGFeatureRequestErrorStateDescriptionLabel 
kIBGBetaWelcomeMessageWelcomeStepTitle;
kIBGBetaWelcomeMessageWelcomeStepContent;
kIBGBetaWelcomeMessageHowToReportStepTitle;
kIBGBetaWelcomeMessageHowToReportStepContent;
kIBGBetaWelcomeMessageFinishStepTitle;
kIBGBetaWelcomeMessageFinishStepContent;
kIBGBetaWelcomeDoneButtonTitle;
kIBGLiveWelcomeMessageTitle;
kIBGLiveWelcomeMessageContent;
SHAKE_HINT
SWIPE_HINT
INVALID_EMAIL_MESSAGE
INVALID_COMMENT_MESSAGE
INVOCATION_HEADER
START_CHATS
REPORT_BUG
REPORT_FEEDBACK
EMAIL_FIELD_HINT
COMMENT_FIELD_HINT_FOR_BUG_REPORT
COMMENT_FIELD_HINT_FOR_FEEDBACK
ADD_VOICE_MESSAGE
ADD_IMAGE_FROM_GALLERY
ADD_EXTRA_SCREENSHOT
CONVERSATIONS_LIST_TITLE
AUDIO_RECORDING_PERMISSION_DENIED
CONVERSATION_TEXT_FIELD_HINT
BUG_REPORT_HEADER
FEEDBACK_REPORT_HEADER
VOICE_MESSAGE_PRESS_AND_HOLD_TO_RECORD
VOICE_MESSAGE_RELEASE_TO_ATTACH
REPORT_SUCCESSFULLY_SENT
SUCCESS_DIALOG_HEADER
ADD_VIDEO
VIDEO_PLAYER_TITLE
FEATURES_REQUEST
FEATURES_REQUEST_ADD_FEATURE_TOAST
FEATURES_REQUEST_ADD_FEATURE_THANKS_MESSAGE
SURVEYS_WELCOME_SCREEN_TITLE
SURVEYS_WELCOME_SCREEN_SUBTITLE
SURVEYS_WELCOME_SCREEN_BUTTON
BETA_WELCOME_MESSAGE_WELCOME_STEP_TITLE
BETA_WELCOME_MESSAGE_WELCOME_STEP_CONTENT
BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_TITLE
BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_CONTENT
BETA_WELCOME_MESSAGE_FINISH_STEP_TITLE
BETA_WELCOME_MESSAGE_FINISH_STEP_CONTENT
LIVE_WELCOME_MESSAGE_TITLE
LIVE_WELCOME_MESSAGE_CONTENT
Instabug.strings.shakeHint
Instabug.strings.swipeHint
Instabug.strings.edgeSwipeStartHint
Instabug.strings.startAlertText
Instabug.strings.invalidEmailMessage
Instabug.strings.invalidEmailTitle
Instabug.strings.invalidCommentMessage
Instabug.strings.invalidCommentTitle
Instabug.strings.invocationHeader
Instabug.strings.talkToUs
Instabug.strings.reportBug
Instabug.strings.reportFeedback
Instabug.strings.emailFieldHint
Instabug.strings.commentFieldHintForBugReport
Instabug.strings.commentFieldHintForFeedback
Instabug.strings.addVideoMessage
Instabug.strings.addVoiceMessage
Instabug.strings.addImageFromGallery
Instabug.strings.addExtraScreenshot
Instabug.strings.audioRecordingPermissionDeniedTitle
Instabug.strings.audioRecordingPermissionDeniedMessage
Instabug.strings.microphonePermissionAlertSettingsButtonText Instabug.microphonePermissionAlertSettingsButtonText,
Instabug.strings.recordingMessageToHoldText
Instabug.strings.recordingMessageToReleaseText
Instabug.strings.conversationsHeaderTitle
Instabug.strings.screenshotHeaderTitle
Instabug.strings.chatsNoConversationsHeadlineText
Instabug.strings.doneButtonText
Instabug.strings.okButtonText
Instabug.strings.cancelButtonText
Instabug.strings.thankYouText
Instabug.strings.audio
Instabug.strings.video
Instabug.strings.image
Instabug.strings.chatsHeaderTitle
Instabug.strings.team
Instabug.strings.messageNotification
Instabug.strings.messagesNotificationAndOthers

// iOS only 
Instabug.strings.collectingDataText
//iOS
IBGString.ShakeHint
IBGString.SwipeHint
IBGString.EdgeSwipeStartHint
IBGString.StartAlertText
IBGString.InvalidEmailMessage
IBGString.InvalidEmailTitle
IBGString.InvalidCommentMessage
IBGString.InvalidCommentTitle
IBGString.InvocationHeader
IBGString.TalkToUs
IBGString.ReportBug
IBGString.ReportFeedback
IBGString.EmailFieldHint
IBGString.CommentFieldHintForBugReport
IBGString.CommentFieldHintForFeedback
IBGString.AddScreenRecordingMessage
IBGString.AddVoiceMessage
IBGString.AddImageFromGallery
IBGString.AddExtraScreenshot
IBGString.AudioRecordingPermissionDeniedTitle
IBGString.AudioRecordingPermissionDeniedMessage
IBGString.ScreenRecordingPermissionDeniedMessage
IBGString.MicrophonePermissionAlertSettingsButtonTitle
IBGString.MicrophonePermissionAlertLaterButtonTitle
IBGString.ChatsHeaderTitle
IBGString.Team
IBGString.RecordingMessageToHoldText
IBGString.RecordingMessageToReleaseText
IBGString.MessagesNotification
IBGString.MessagesNotificationAndOthers
IBGString.ScreenshotHeaderTitle
IBGString.OkButtonTitle
IBGString.CancelButtonTitle
IBGString.ThankYouText
IBGString.ThankYouAlertText
IBGString.Audio
IBGString.ScreenRecording
IBGString.Image
IBGString.SurveyEnterYourAnswerPlaceholder
IBGString.SurveyNoAnswerTitle
IBGString.SurveyNoAnswerMessage
IBGString.SurveySubmitTitle
IBGString.VideoPressRecordTitle
IBGString.LowDiskStorageTitle
IBGString.LowDiskStorageMessage
  
//Android
InstabugCustomTextPlaceHolder.Key.AddExtraScreenshot
InstabugCustomTextPlaceHolder.Key.AddImageFromGallery
InstabugCustomTextPlaceHolder.Key.AddVideo
InstabugCustomTextPlaceHolder.Key.AddVoiceMessage
InstabugCustomTextPlaceHolder.Key.AudioRecordingPermissionDenied
InstabugCustomTextPlaceHolder.Key.CommentFieldHintForBugReport
InstabugCustomTextPlaceHolder.Key.CommentFieldHintForFeedback
InstabugCustomTextPlaceHolder.Key.ConversationsListTitle
InstabugCustomTextPlaceHolder.Key.ConversationTextFieldHint
InstabugCustomTextPlaceHolder.Key.EmailFieldHint
InstabugCustomTextPlaceHolder.Key.FeedbackReportHeader
InstabugCustomTextPlaceHolder.Key.InvalidCommentMessage
InstabugCustomTextPlaceHolder.Key.InvalidEmailMessage
InstabugCustomTextPlaceHolder.Key.InvocationHeader
InstabugCustomTextPlaceHolder.Key.ReportBug
InstabugCustomTextPlaceHolder.Key.ReportFeedback
InstabugCustomTextPlaceHolder.Key.ReportSuccessfullySent
InstabugCustomTextPlaceHolder.Key.ShakeHint
InstabugCustomTextPlaceHolder.Key.StartChats
InstabugCustomTextPlaceHolder.Key.SuccessDialogHeader
InstabugCustomTextPlaceHolder.Key.SwipeHint
Suggest Edits

Set Pre-Invocation Handler

 

Use this handler to run any code prior to Instabug being invoked.

This block is executed on the UI thread and could be used for performing any UI changes before the SDK's UI is shown.

BugReporting.willInvokeHandler = {
    someObject.setSomeState()
}
IBGBugReporting.willInvokeHandler = ^{
    [someObject setSomeState];
};
BugReporting.setOnInvokeCallback(new OnInvokeCallback() {
            @Override
            public void onInvoke() {
               //do something
            }
};
BugReporting.OnInvokeHandler(function () {
    // Perform any UI changes before the SDK's UI is shown.
});
cordova.plugins.bugReporting.setOnInvokeHandler(
            function () {
                //Add any logic you want to do here
                console.log('On invocation logic');
            },
            function (error) {
                console.log('On Invoke handler could not be set ' + error);
            }
        );
//iOS
IBGBugReporting.WillInvokeHandler = () => 
{
  Console.WriteLine("SDK will be invoked!");
};

//Android
Instabug.SetOnSdkInvokedCallback(new IOnSdkInvokedCallbackClass());

private class IOnSdkInvokedCallbackClass : Java.Lang.Object, IOnSdkInvokedCallback
{
  public void OnSdkInvoked()
  {
    Android.Util.Log.Warn("OnSdkInvoked", "Instabug SDK invoked");
  }
}
Suggest Edits

Set Pre-Sending Handler

 

Use this handler to run any code right before sending a bug or crash report

This block is executed in the background before sending each report and could be used for attaching logs and extra data to reports, for example.

Instabug.willSendReportHandler = { report in
    report.appendTag("tag1")
    report.logVerbose("Verbose log.")
    report.append(toConsoleLogs: "Console log statement.")
    report.setUserAttribute("value", withKey: "key")
    report.addFileAttachment(with: data)
    
    return report
}
Instabug.willSendReportHandler = ^IBGReport * _Nonnull(IBGReport * _Nonnull report) {
    [report appendTag:@"tag1"];
    [report logVerbose:@"Verbose log."];
    [report appendToConsoleLogs:@"Console log statement"];
    [report setUserAttribute:@"value" withKey:@"key"];

    return report;
};
Instabug.onReportSubmitHandler(new Report.OnReportCreatedListener() {
            @Override
            public void onReportCreated(Report report) {
                
            }
        };
BugReporting.onReportSubmitHandler(function () {
    // Attach logs and extra data to reports.
});
//iOS
Instabug.WillSendReportHandler = (IBGReport report) =>
{
  report.LogVerbose("Verbos log");
  report.SetUserAttribute("User Attirbute Value", "Key");
  return report;
};

//Android
Instabug.OnReportSubmitHandler(new BeforeSendingReportCallback());

public class BeforeSendingReportCallback : Java.Lang.Object, Report.IOnReportCreatedListener
{
  public void OnReportCreated(Report report)
  {
    report.AddTag("Tag");
    report.LogVerbose("Verbose Log");
    report.AppendToConsoleLogs("Console Log");
    report.SetUserAttribute("User Attribute Value", "Key");
  }
}
Suggest Edits

Set Did-Dismiss Handler

 

Use this handler to run any code right after the Instabug view is dismissed.

This block is executed on the UI thread. Could be used for performing any UI changes after the SDK's UI has been dismissed.

For iOS:
The didDismissHandler block has the following

  • IBGDismissType: How the SDK was dismissed.
  • IBGReportType: Type of report that has been sent. Will be set to IBGReportTypeBug in case the SDK has been dismissed without selecting a report type, so you might need to check issueState before IBGReportType.

For Android:
The setOnDismissCallback block has the following

  • DismissType: How the SDK was dismissed.
  • ReportType: The type of report that was sent. If the SDK was dismissed without selecting a report type, it will be set to bug, so you might need to check issueState before reportType.

For React Native:
The onSDKDismissedHandler block has the following

  • dismissType: How the SDK was dismissed.
  • reportType: The type of report that was sent. If the SDK was dismissed without selecting a report type, it will be set to bug, so you might need to check issueState before reportType.
BugReporting.didDismissHandler = { (dismissType, reportType) in
    someObject.setSomeState()
}
IBGBugReporting.didDismissHandler = ^(IBGDismissType dismissType, IBGReportType reportType) {
    [someObject setSomeState];
};
BugReporting.setOnDismissCallback(new OnSdkDismissCallback() {
            @Override
            public void call(DismissType issueState, ReportType reportType) {
                
            }
        });
BugReporting.onSDKDismissedHandler(function (dismissType, reportType) {
    // Perform any UI changes after the SDK's UI has been dismissed.
});
cordova.plugins.bugReporting.setOnDismissHandler(
            function () {
                //Add any logic you want to do here
                console.log('Invocation dismiss logic');
            },
            function (error) {
                console.log('Invoke dismiss handler could not be set ' + error);
            }
        );
//iOS
IBGBugReporting.DidDismissHandler = (IBGDismissType dismissType, IBGReportType reportType) =>
{
	Console.WriteLine("Dismiss Type: " + dismissType + ". Report Type: " + 		reportType);
};

//Android
//Not supported yet
Suggest Edits

Set Received-Reply Handler

 

Use this handler to run specific code each time a new message is received by the SDK.

This block is executed each time a new message is received. This can be used to show your own UI when a new message is received when default chat notifications are disabled, for example.

Replies.didReceiveReplyHandler = {
    // Notify users about new message.
}
IBGReplies.didReceiveReplyHandler = ^{
    // Notify users about new message.
};
Replies.setOnNewReplyReceivedCallback(new Runnable() {
	//Your code goes here.
});
Replies.setOnNewReplyReceivedCallback(function () {
    //Create custom alert
});
//iOS
Replies.DidReceiveReplyHandler = () => 
{
  Console.WriteLine("Received New Reply!");
};

  
//Android
Replies.setOnNewReplyReceivedCallback(new Runnable() {
	//Your code goes here.
});
Suggest Edits

Set Will-Show-Survey Handler

 

This handler can be used to run a block of code right before a survey is shown to the user.

IBGSurveys.willShowSurveyHandler = {
    // Change some state
}
IBGSurveys.willShowSurveyHandler = ^{
    // Change some state
};
Surveys.setOnShowCallback(new Runnable() {
	@Override
	public void run() {
		//Pause game
	}
});
Surveys.onShowCallback(() => {
  //Perform any changes before the survey appears.
});
cordova.plugins.surveys.setOnShowHandler(() => {console.log('On show survey')}, (error) => {})
//iOS
IBGSurveys.WillShowSurveyHandler = () =>
{
  System.Console.WriteLine("New Survey");
};

//Android
Surveys.SetOnShowCallback(new IPreShowingSurveyRunnable());
public class IPreShowingSurveyRunnable : Java.Lang.Object, IOnShowCallback
{
  public void OnShow()
  {
    Android.Util.Log.Warn("PreShowingSurvey", "Pre Showing survey");
  }
}
Suggest Edits

Set Dismissed-Survey Handler

 

This handler can be used to run a block code right after a survey is dismissed.

Surveys.didDismissSurveyHandler = {
    // Change some state
}
IBGSurveys.didDismissSurveyHandler = ^{
    // Change some state
};
Surveys.setOnDismissCallback(new OnDismissCallback() {
            @Override
            public void onDismiss() {
                
            }
        });
Surveys.onDismissCallback(() => {
  //Perform any changes before the survey disappears.
});
cordova.plugins.surveys.setOnDismissHandler(() => {console.log('on dismiss survey')}, (error) => {})
//iOS
IBGSurveys.DidDismissSurveyHandler = () =>
{
	System.Console.WriteLine("Did Dismiss Survey");
};

//Android
Surveys.SetOnDismissCallback(new IOnDismissSurveyCallback());

public class IOnDismissSurveyCallback : Java.Lang.Object, IOnDismissCallback
{
  public void OnDismiss()
  {
    Android.Util.Log.Warn("PreShowingSurvey", "Pre Showing survey");
  }
}