HomeDocumentationAPI Reference
Getting StartedAPI ReferenceBug ReportingCrash ReportingAPMHelp Center

Showing Instabug for Xamarin

This section covers how to change the event done by the user to show the SDK, as well as the default feature to be used once the SDK is shown for Xamarin apps.

By default, Instabug is shown when the device is shaken. This can be changed to several other events that can show the SDK. You can also show the SDK manually from a custom gesture or a button you add to your app.

Invocation Events

You can set the SDK to be shown when your users do one or more of the following actions:

  • Shake device
  • Take a screenshot (using home + lock buttons)
  • Tap on a floating button shown above your app's UI
  • Swipe with two fingers from right to left
  • None (manual showing)

How to show Instabug

To customize the invocation event, pass one of the values of the Instabug.invocationEvent enum when starting the SDK.

IBGBugReporting.InvocationEvents = IBGInvocationEvent.FloatingButton | IBGInvocationEvent.Screenshot;

new Instabug.Builder(this, "ANDROID_APP_TOKEN")
            .SetInvocationEvent(InstabugInvocationEvent.FloatingButton, InstabugInvocationEvent.Shake)

You can find the possible invocation events below. The None event can be used in case you want to prevent the SDK from being shown by the normal way and show it later on manually whenever you need or under certain conditions.



In case you are using the floating button, you can set its default position as explained here.

Shaking Threshold

If you are using the shaking gesture as your invocation event you can set how sensitive your device is to the shaking. The values in the following iOS example are the default ones. In the case of Android, the default value depends on the device used. The higher the value the less sensitive the device will be to shaking.

IBGBugReporting.ShakingThresholdForiPhone = 3.0;
IBGBugReporting.ShakingThresholdForiPad = 1.0;


Changing the Invocation Event

If you want to change the invocation event to any of the other supported events, you can do so at runtime​ as shown below.

IBGBugReporting.InvocationEvents = IBGInvocationEvent.FloatingButton;

BugReporting.SetInvocationEvents(InstabugInvocationEvent.Shake, InstabugInvocationEvent.FloatingButton);

Manual Showing

You can also show the event manually as follows.




When you limit invoking Instabug to a specific screen (help or settings for example), the current screen that the SDK captures won't necessarily be relevant to the issue. To help you gain more context, it is recommended that you set up a list of custom categories that match the main features or views in your app and let the user choose one of them. You can find more details here.

Showing Specific Modes

By default, when the Instabug SDK is shown, a popup appears to your app users with options for them to report a bug ("Report a bug"), share feedback ("Suggest an improvement"), or ask you a question ("Ask a question").


The Prompt Options menu appears when Instabug is shown in your app.

Instead of showing the Prompt Options menu that lets your users choose what they want to do, you can skip this step and take users directly to the bug, feedback, or question reporting flow.

For bug, feedback, and questions, you can also specify invocation options as described here.

The following are the possible invocation options to be used with any of the following methods (except for showing the replies page).

//Hide email
//Show email as optional
//Make comment required
//Hide email
//Show email as optional
//Make comment required

Show Bug Form

This API will show users a form they can use to submit new bug reports.

IBGBugReporting.ShowWithReportType(IBGBugReportingReportType.Bug, IBGBugReportingOption.EmailFieldHidden);
BugReporting.Show(BugReporting.ReportType.Bug, Option.EmailFieldHidden);

Show Feedback Form

This API will show users a form they can use to submit new feedback and suggestions.

IBGBugReporting.ShowWithReportType(IBGBugReportingReportType.Feedback, IBGBugReportingOption.EmailFieldHidden);
BugReporting.Show(BugReporting.ReportType.Feedback, Option.EmailFieldHidden);

Show Question Form

This API will show users a form they can use to submit a new question.

IBGBugReporting.ShowWithReportType(IBGBugReportingReportType.Question, IBGBugReportingOption.EmailFieldHidden);
BugReporting.Show(BugReporting.ReportType.Question, Option.EmailFieldHidden);

Show Replies Page

This API will show users a page where they can see all their ongoing chats. If the user has no ongoing chats, this API won't have an effect.


What’s Next

Learn how to customize the welcome message or maybe even report your first bug.