Coder Social home page Coder Social logo

react-native-buglife's Introduction

react-native-buglife

React Native wrapper for Buglife iOS and Buglife Android.

npm version

Installation

  1. npm install react-native-buglife --save
  2. react-native link to link the native libraries to the react wrappers.

If you intend to ship with Buglife to TestFlight or the iOS App Store, you'll need to add NSPhotoLibraryUsageDescription to your Info.plist. See this article.

Configuration

Android native configuration

  1. Open your app's build.gradle, and make sure the compileSdkVersion is at least 26, and minSdkVersion is at least 16.

  2. 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'
            }
        }
        ...
    }
  3. 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);

    Be sure to replace [email protected] with your own email address, as bug reports will be sent to this address.

iOS native configuration

  1. Open AppDelegate.m and add the following import statement below the others:

    #import "Buglife.h"
  2. Add the following to the end of the application:didFinishLaunchingWithOptions: method in AppDelegate.m:

    [[Buglife sharedBuglife] startWithEmail:@"[email protected]"];
    [[Buglife sharedBuglife] setInvocationOptions:LIFEInvocationOptionsScreenshot];
  3. Add the NSPhotoLibraryUsageDescription key to your iOS app's Info.plist if it doesn't have it already. See the Buglife iOS App Store documentation.

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.

Customization

User identification

You may want to add the reporter's email address or other account identifier to your bug reports. You can do this with

// Set an email address
Buglife.setUserEmail("[email protected]");

// Set a user identifier
Buglife.setUserIdentifier("account name");

Attachments

Your application can include custom JSON attachments with each bug report. For example, to add an attachment solely to the next invocation of the bug reporter:

var myData = { }; // This should be a JSON object with your data
Buglife.addAttachmentWithJSON(myData, "MyData.json");

It’s also possible to add a String attachment:

var myText = "great detailed log"; // This should be a String object with your data
Buglife.addAttachmentWithString(myText, "MyText.text");

In some cases, you may wish to add an attachment on every invocation of the bug reporter; You can do so by subscribing to the BuglifeAttachmentRequest event:

import { NativeModules, NativeEventEmitter } from 'react-native';

const eventEmitter = new NativeEventEmitter(NativeModules.RNBuglife);

eventEmitter.addListener(Buglife.BuglifeAttachmentRequest, () => {
  var appState = {"awesomeness": "Insanely awesome", "volume": 11};
  Buglife.addAttachmentWithJSON(appState, "AppState.json");
});

For advanced usage & features (customization, user identification, etc), check out the official Buglife documentation.

react-native-buglife's People

Contributors

danhd123 avatar di avatar gazedash avatar lucascarvalho avatar oferrounds avatar schukin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-buglife's Issues

appcompat dependency

Encountered the following errors while compiling. I wasn't able to add appcompat V27 to the package dependency because RN Android default compile SDK version is 23. Is V27 really necessary for the package to work?

Error:Failed to resolve: com.android.support:appcompat-v7:27.0.0
Error:Failed to resolve: com.android.support:design:27.0.0
Error:Failed to resolve: com.android.support:support-dynamic-animation:27.0.0

iOS - Bundling an app for App Store does not work

My build dev and local deployment build using fastlane work just great now but building for the Appstore fails.

screen shot 2018-01-25 at 14 05 19

error: exportArchive: exportOptionsPlist error for key 'method': expected one of {}, but found app-store

Error Domain=IDEFoundationErrorDomain Code=1 "exportOptionsPlist error for key 'method': expected one of {}, but found app-store" UserInfo={NSLocalizedDescription=exportOptionsPlist error for key 'method': expected one of {}, but found app-store}

** EXPORT FAILED **

This issue seems to explain that it comes from external libraries overriding build options. I guess there is something wrong with React-Native-Buglife.

App not launching after integration

Hi Buglife,

Getting this error after integrating the RN library. Any idea?
Thanks!

dyld: Library not loaded: @rpath/Buglife.framework/Buglife
  Referenced from: /var/containers/Bundle/Application/DA75F366-6311-4B13-9522-1CA7DB66AE6E/Bob.app/Bob
  Reason: image not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.