Import the BugBattle SDK by adding the following import inside your
import BugBattle from 'react-native-bugbattle-sdk';
Add the initialization function within your
AppRegistry.registerComponent(appName, () => App);.
Your API key can be found in the project settings within BugBattle. Possible values for the activation method are
BugBattle.NONE: No automatic activation.
BugBattle.SHAKE: Activation on device shake.
It's also possible to initialize the SDK with multiple activation methods.
BugBattle.initializeMany('YOUR_API_KEY', [BugbattleSdk.SCREENSHOT, BugbattleSdk.SHAKE]);
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
Sets the customer's email address.
Sometimes you need to attach custom data to bug reports in order to solve them more quickly. Any simple dictionary can be attached.
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 allows you to monitor all network requests for a better understanding of what's happening within your web-apps & websites. The feature is currently in BETA. Please enable network logging by calling the following method right after initializing the SDK.
// Enables the network logger.BugBattle.startNetworkLogging();
Bugbattle automatically uses the system language (if a translation is available) as default SDK language. It's possible to force a language by adding the following method call.
Available translations: en, de, fr, it, es We are happy to add more languages based on your requests!
Sets the API url to your internal Bugbattle server. Please make sure that the server is reachable within the network.