Install the react-native-buglife
package:
$ npm install react-native-buglife --save
Link the native libraries to the React Native wrappers:
$ react-native link
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, "[email protected]");
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'
}
}
...
}
compileSdkVersion
to 26, and minSdkVersion
to at least 16.
Add the following to your app delegate's application:didFinishLaunchingWithOptions:
method:
[[Buglife sharedBuglife] startWithEmail:@"[email protected]"];
[[Buglife sharedBuglife] setInvocationOptions:LIFEInvocationOptionsScreenshot];
NSPhotoLibraryUsageDescription
key to your iOS app's Info.plist.
See
iOS App Store Builds.
Import & initialize Buglife within App.js
:
var Buglife = require('react-native-buglife');
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.