Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature required: custom report types with callback #513

Open
eugenio-tesio-ueno opened this issue Sep 27, 2024 · 1 comment
Open

Feature required: custom report types with callback #513

eugenio-tesio-ueno opened this issue Sep 27, 2024 · 1 comment

Comments

@eugenio-tesio-ueno
Copy link

eugenio-tesio-ueno commented Sep 27, 2024

Description

We need to add a custom report type that allow us to take control back using a callback function after the user shakes the phone. This shall live alongside the standard report types. This will allow us to to do things like redirect the user to another route of our current app, push a metric, etc.

The following picture clarifies the requirement.

image

The following code will help you understand what we expect:

CustomReportType customOption1 = CustomReportType(
  title: 'Custom option 1', 
  description: 'description 2',
  icon: SvgPicture.asset(
    AssetsHelper.fromPath('/path/to/image1'),
  ),
  callback: () {
    // ...
  }
);

CustomReportType customOption1 = CustomReportType(
  title: 'Custom option 2', 
  description: 'description 2',
  icon: SvgPicture.asset(
    AssetsHelper.fromPath('/path/to/image2'),
  ),
  callback: () {
    // ...
  }
);

BugReporting.setReportTypes([ReportType.bug, customOption1, customOption2]);
@a7medev
Copy link
Contributor

a7medev commented Sep 29, 2024

Hello @eugenio-tesio-ueno!
We don't have an API for directly adding items to the list of report types, but you can still create such a dialog with custom items manually using familiar Flutter widgets and show Instabug's bug reporting screens from there using the BugReporting.show(ReportType reportType, List<InvocationOption>? invocationOptions) API (e.g. BugReporting.show(ReportType.bug) to report a bug with the default invocation options).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants