{"id":25880902,"url":"https://github.com/buglife/react-native-buglife","last_synced_at":"2025-03-02T14:26:21.746Z","repository":{"id":57335863,"uuid":"64283640","full_name":"Buglife/react-native-buglife","owner":"Buglife","description":"A React Native wrapper for Buglife","archived":false,"fork":false,"pushed_at":"2019-04-18T00:00:10.000Z","size":793,"stargazers_count":12,"open_issues_count":7,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-10T07:53:24.006Z","etag":null,"topics":["bug-reporter","bug-reporting","buglife","react-native"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Buglife.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-27T06:35:25.000Z","updated_at":"2021-07-25T17:57:53.000Z","dependencies_parsed_at":"2022-09-14T19:52:27.848Z","dependency_job_id":null,"html_url":"https://github.com/Buglife/react-native-buglife","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Buglife%2Freact-native-buglife","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Buglife%2Freact-native-buglife/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Buglife%2Freact-native-buglife/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Buglife%2Freact-native-buglife/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Buglife","download_url":"https://codeload.github.com/Buglife/react-native-buglife/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241519016,"owners_count":19975582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bug-reporter","bug-reporting","buglife","react-native"],"created_at":"2025-03-02T14:26:21.256Z","updated_at":"2025-03-02T14:26:21.740Z","avatar_url":"https://github.com/Buglife.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"react-native-buglife\n====================\n\nReact Native wrapper for [Buglife iOS](https://github.com/Buglife/Buglife-iOS) and [Buglife Android](https://github.com/Buglife/buglife-android).\n\n[![npm version](https://img.shields.io/npm/v/react-native-buglife.svg)](https://www.npmjs.com/package/react-native-buglife)\n\n# Installation\n\n1. `npm install react-native-buglife --save`\n2. `react-native link` to link the native libraries to the react wrappers.\n\n\u003e 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](https://www.buglife.com/docs/ios/app-store-builds.html).\n\n# Configuration\n\n### Android native configuration\n\n1. Open your app's `build.gradle`, and make sure the `compileSdkVersion` is at least 26, and `minSdkVersion` is at least 16.\n\n2. If you are not prompted to do so by Android Studio, add the following maven repository to your _project's_ build.gradle `buildscript` section:\n\t\n    ```\n    maven {\n        url 'https://maven.google.com/'\n        name 'Google'\n    }\n    ```\n    \n    eg. \n    ```groovy\n    buildscript {\n        repositories {\n            jcenter()\n            maven {\n                url 'https://maven.google.com/'\n                name 'Google'\n            }\n        }\n        ...\n    }\n    ```\n\n3. 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`.)\n\t\n    ```java\n    Buglife.initWithEmail(this, \"you@yourdomain.com\");\n    Buglife.setInvocationMethod(InvocationMethod.SCREENSHOT);\n    ```\n    \n\tBe sure to replace `you@yourdomain.com` with your own email address, as bug reports will be sent to this address.\n\n### iOS native configuration\n\n1. Open `AppDelegate.m` and add the following import statement below the others:\n\t\n\t```objective-c\n\t#import \"Buglife.h\"\n\t```\n\n2. Add the following to the end of the `application:didFinishLaunchingWithOptions:` method in `AppDelegate.m`:\n    \n    ```objective-c\n    [[Buglife sharedBuglife] startWithEmail:@\"you@yourdomain.com\"];\n    [[Buglife sharedBuglife] setInvocationOptions:LIFEInvocationOptionsScreenshot];\n    ```\n\n3. 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](https://www.buglife.com/docs/ios/app-store-builds.html).\n\n### Javascript configuration\n\nImport \u0026 initialize Buglife within `App.js`:\n\n```javascript\nvar Buglife = require('react-native-buglife');\n```\n\n### Build \u0026 run\n\nBuild \u0026 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.\n\n# Customization\n\n### User identification\n\nYou may want to add the reporter's email address or other account identifier to your bug reports. You can do this with \n\n```javascript\n// Set an email address\nBuglife.setUserEmail(\"name@example.com\");\n\n// Set a user identifier\nBuglife.setUserIdentifier(\"account name\");\n```\n\t\n\n### Attachments\n\nYour 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:\n\n```javascript\nvar myData = { }; // This should be a JSON object with your data\nBuglife.addAttachmentWithJSON(myData, \"MyData.json\");\n```\n\nIt’s also possible to add a String attachment:\n\n```javascript\nvar myText = \"great detailed log\"; // This should be a String object with your data\nBuglife.addAttachmentWithString(myText, \"MyText.text\");\n```\n\nIn 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:\n\n```javascript\nimport { NativeModules, NativeEventEmitter } from 'react-native';\n\nconst eventEmitter = new NativeEventEmitter(NativeModules.RNBuglife);\n\neventEmitter.addListener(Buglife.BuglifeAttachmentRequest, () =\u003e {\n  var appState = {\"awesomeness\": \"Insanely awesome\", \"volume\": 11};\n  Buglife.addAttachmentWithJSON(appState, \"AppState.json\");\n});\n```\n\nFor advanced usage \u0026 features (customization, user identification, etc), check out the official Buglife [documentation](https://www.buglife.com/docs/react-native).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuglife%2Freact-native-buglife","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuglife%2Freact-native-buglife","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuglife%2Freact-native-buglife/lists"}