Installation

  1. Install the react-native-buglife package:

    $ npm install react-native-buglife --save

  2. Link the native libraries to the React Native wrappers:

    $ react-native link

Configuration

Android native configuration

Add the following lines to the end of the onCreate() method in your main Application subclass. (If your app doesn't have one already, create an Application subclass and declare it in AndroidManifest.xml.)

Buglife.initWithEmail(this, "you@yourdomain.com");
Buglife.setInvocationMethod(InvocationMethod.SCREENSHOT);

If you are not prompted to do so by Android Studio, add the following maven repository to your project's build.gradle buildscript section:

maven {
	url 'https://maven.google.com/'
	name 'Google'
}

eg.

buildscript {
	repositories {
		jcenter()
		maven {
			url 'https://maven.google.com/'
			name 'Google'
		}
	}
	...
}
You may also need to set your app's compileSdkVersion to 26, and minSdkVersion to at least 16.

iOS native configuration

Add the following to your app delegate's application:didFinishLaunchingWithOptions: method:

[[Buglife sharedBuglife] startWithEmail:@"you@yourdomain.com"];
[[Buglife sharedBuglife] setInvocationOptions:LIFEInvocationOptionsScreenshot];

If you plan on shipping either to TestFlight or the iOS App Store, you'll need to add the NSPhotoLibraryUsageDescription key to your iOS app's Info.plist. See iOS App Store Builds.

Javascript configuration

Import & initialize Buglife within App.js:

var Buglife = require('react-native-buglife');

Build & run

Build & run on a device, then take a screenshot to invoke the bug reporter! Submit your first bug report, and it'll show up in your email.

Not a developer?