Skip to content

Latest commit

 

History

History
92 lines (58 loc) · 1.5 KB

README.md

File metadata and controls

92 lines (58 loc) · 1.5 KB

BugBattle logo

React Native BugBattle

React Native wrapper around the native BugBattle SDKs

Installation

via yarn

$ yarn add react-native-bugbattle

via npm

$ npm install react-native-bugbattle

Linking

  • React Native 0.60+

Since version 0.60, React Native supports auto linking. This means no additional step is needed on your end.

  • React Native <= 0.59
$ react-native link react-native-bugbattle

Special note for iOS using cocoapods, run:

$ cd ios && pod install && cd ..

Usage

This library exposes all the native BugBattle SDK methods to JS with included TypeScript declaration files.

Import

import BugBattle, { BugBattleActivationMethod } from 'react-native-bugbattle';

Common scenarios

Initialising the SDK

BugBattle.initialise("YOUR_API_KEY", BugBattleActivationMethod.SHAKE);

Manually starting the bug reporting flow

BugBattle.startBugReporting();

Changing the bug reporting UI color

BugBattle.setAppBarColor("#AAAAAA");

Prefilling the user email in the bug reporting UI

BugBattle.setUserEmail("example@domain.com");

Attaching custom data to a report

BugBattle.attachCustomData({
    userId : "YOUR_USER_ID",
    age : 21
    // ... 
});

Tracking custom steps

BugBattle.trackStep("SCREEN_VIEW", "HOME SCREEN");