npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-buglife

v0.1.13

Published

Buglife for React Native

Downloads

43

Readme

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");

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.