/**
   * Convenience method for parsing and setting the desired default invocation mode.
   *
   * @param mode String shortcode for IBGInvocationMode
   */
  private void setDefaultInvocationMode(String mode) {
    IBGInvocationMode iMode = IBPlugin.parseInvocationMode(mode);

    if (iMode != null) {
      builder.setDefaultInvocationMode(iMode);
    }
  }
  /**
   * Called when activity starts. Initializes Instabug.
   *
   * @param savedInstanceState Saved instance state
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Retrieve initialization options
    Bundle options = getIntent().getExtras();

    IBGInvocationEvent event = IBPlugin.parseInvocationEvent(options.getString("invocationEvent"));

    if (event != null) {
      // Initialize builder with invocation event if possible
      builder = new Instabug.Builder(this.getApplication(), options.getString("token"), event);
    } else {
      builder = new Instabug.Builder(this.getApplication(), options.getString("token"));
    }

    // Apply initialization options through builder
    setBuilderOptions(options);

    // builder.setShouldShowIntroDialog(false);
    // Initialize Instabug through builder
    builder.build();

    // Finish activity (required for no-display theme)
    IBPluginActivity.this.finish();
  }