diff --git a/.gitignore b/.gitignore index 4033aaa3b6..16572b4817 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ yarn-debug.log yarn-error.log coverage/ .jest/cache/ +.yarn # OSX .DS_Store @@ -62,7 +63,8 @@ android/keystores/debug.keystore # Bundle artifact *.jsbundle -/examples/default/ios/main.jsbundle.map +*.bundle +main.jsbundle.map # Vscode local history .history/ diff --git a/examples/hybrid/.eslintrc.js b/examples/hybrid/.eslintrc.js new file mode 100644 index 0000000000..40c6dcd05f --- /dev/null +++ b/examples/hybrid/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native-community', +}; diff --git a/examples/hybrid/.watchmanconfig b/examples/hybrid/.watchmanconfig new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/examples/hybrid/.watchmanconfig @@ -0,0 +1 @@ +{} diff --git a/examples/hybrid/App.tsx b/examples/hybrid/App.tsx new file mode 100644 index 0000000000..a23af1626f --- /dev/null +++ b/examples/hybrid/App.tsx @@ -0,0 +1,62 @@ +/* eslint-disable react-native/no-inline-styles */ +import { ReactNode, useEffect } from 'react'; +import React from 'react'; +import { Button, Image, SafeAreaView, Text } from 'react-native'; +import Instabug, { + CrashReporting, + InvocationEvent, + LogLevel, + ReproStepsMode, +} from 'instabug-reactnative'; + +const throwHandled = () => { + try { + throw Error('This is a handled JS Crash'); + } catch (err) { + if (err instanceof Error) { + CrashReporting.reportError(err); + } + } +}; + +const throwUnhandled = () => { + throw Error('This is an unhandled JS Crash'); +}; + +const App: () => ReactNode = () => { + useEffect(() => { + Instabug.init({ + token: 'deb1910a7342814af4e4c9210c786f35', + invocationEvents: [InvocationEvent.floatingButton], + debugLogsLevel: LogLevel.verbose, + }); + CrashReporting.setNDKCrashesEnabled(true); + Instabug.setReproStepsConfig({ + all: ReproStepsMode.enabled, + }); + }, []); + + return ( + + + React Native App +