Customizations

Flutter SDK

πŸ”§ Initialize the SDK

In addition, you need to call the initialization function to initialize the Bugbattle SDK. Make sure that the initialization method gets called only once (i.e. by using initState()).

BugBattle.initWithToken('YOUR_API_KEY', ActivationMethod.SHAKE);

Your API key can be found in the project settings within BugBattle. Possible values for the activation method are NONE, SHAKE and THREE_FINGER_DOUBLE_TAB.

BugBattle.NONE: No automatic activation.

BugBattle.SHAKE: Activation on device shake.

BugBattle.SCREENSHOT: Activation on user making a screenshot.

Manually initiate the bug reporting flow

Some situations require more control about the activation of the bug reporting flow. By calling the startBugReporting method, you can simply start the flow manually. In order to also prevent the shake gesture, just initialize the Bugbattle SDK with the activation method NONE.

BugBattle.startBugReporting();

Customer email address

Sets the customer's email address.

BugBattle.setCustomerEmail('[email protected]');

Attach custom data

Sometimes you need to attach custom data to bug reports in order to solve them more quickly. Any simple dictionary can be attached.

const Map<String, dynamic> customData = {
'role': 'USER',
'data': 'More custom data'
};
BugBattle.attachCustomData(customData);

πŸŽ₯ Replays

Bugbattle Replays offer session replays of the last 60 seconds prior to a bug report. This allows you to gain a better understanding of how a bug occurred. The great thing is that we don't require any further user permissions for the replays.

BugBattle.enableReplays(true);

πŸ•΅οΈ Privacy policy

Enable privacy policy check

Enables the privacy policy check within the bug reporting flow. With this option set to true, users must accept the privacy policy in order to send a bug report.

BugBattle.enablePrivacyPolicy(true);

Privacy policy url

Sets the privacy policy url. This is especially handy if you have any special requirements regarding the privacy policy. The default url is set to the Bugbattle privacy policy.

BugBattle.setPrivacyPolicyUrl("https://awesomeproject.com/privacypolicy");

🎨 Styling (iOS only)

Sets the NavigationBar tint color. Accepts an Color.

BugBattle.setNavigationBarTint(Colors.blue);

Sets the Navigation tint color. Accepts an Color.

BugBattle.setNavigationTint(Colors.black);

Sets the NavigationBarTitle color. Accepts an Color.

BugBattle.setNavigationBarTitleColor(Colors.black);

πŸ–₯ Self-Hosted

API url

Sets the API url to your internal Bugbattle server. Please make sure that the server is reachable within the network.

BugBattle.setApiUrl("https://internalbugbattle.server");