/** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow strict-local */ import React from 'react'; import { Button, SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, } from 'react-native'; import { NativeModules } from 'react-native'; // Setup Bugsnag client to capture errors automatically import Bugsnag from '@bugsnag/react-native' Bugsnag.start(); function triggerException() { bogusFunction(); // eslint-disable-line no-undef } function triggerHandledException() { bogusHandledFunction(); // eslint-disable-line no-undef } async function triggerPromiseRejection() { try { await NativeModules.CrashyCrashy.generatePromiseRejection(); } catch (e) { Bugsnag.notify(e) } } function triggerNativeException() { NativeModules.CrashyCrashy.generateCrash() } function triggerNativeHandledError() { NativeModules.CrashyCrashy.handledError() } const App: () => React$Node = () => { return ( <> {global.HermesInternal == null ? null : ( Engine: Hermes )} Press the buttons below to test examples of Bugsnag functionality. Make sure you have changed the API key in Info.plist or AndroidManifest.xml.