Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ android/keystores/debug.keystore
# Bundle artifact
*.jsbundle
/examples/default/ios/main.jsbundle.map
/examples/hybridsampleapp/ios/main.jsbundle.map

# Vscode local history
.history/
Expand Down
2 changes: 2 additions & 0 deletions examples/hybridexampleapp/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
4 changes: 4 additions & 0 deletions examples/hybridexampleapp/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};
1 change: 1 addition & 0 deletions examples/hybridexampleapp/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
934 changes: 934 additions & 0 deletions examples/hybridexampleapp/.yarn/releases/yarn-stable-temp.cjs

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions examples/hybridexampleapp/App.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<SafeAreaView
style={{
minHeight: '100%',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
}}>
<Image
source={{
uri: 'https://reactnative.dev/img/tiny_logo.png',
height: 100,
width: 100,
}}
/>
<Text style={{ fontSize: 21, fontWeight: '700' }}>React Native App</Text>
<Button title="Handled Crash" onPress={throwHandled} />
<Button title="Unhandled Crash" onPress={throwUnhandled} />
</SafeAreaView>
);
};

export default App;
17 changes: 17 additions & 0 deletions examples/hybridexampleapp/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @format
*/

import 'react-native';
import React from 'react';
import App from '../App';

// Note: import explicitly to use the types shipped with jest.
import { it } from '@jest/globals';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
});
76 changes: 76 additions & 0 deletions examples/hybridexampleapp/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.facebook.react'

}

android {
signingConfigs {
release {
storeFile file('/Users/yrn/Desktop/release')
storePassword 'qwertttt'
keyAlias 'key0'
keyPassword 'qwertttt'
}
}
namespace 'com.instabug.hybridsampleapp'
compileSdk 34

defaultConfig {
applicationId "com.instabug.hybridsampleapp"
minSdk 29
targetSdk 34
versionCode 1
versionName "1.0"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.8"
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
compose = true
buildConfig = true
}
}

dependencies {
// Use consistent versions
def composeBom = platform('androidx.compose:compose-bom:2023.10.00')
implementation composeBom
androidTestImplementation composeBom

// Compose dependencies
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.material3:material3"
implementation "androidx.compose.ui:ui-tooling-preview"
debugImplementation "androidx.compose.ui:ui-tooling"
implementation libs.androidx.appcompat
implementation libs.androidx.appcompat.resources
implementation libs.androidx.core.ktx.v1130
implementation libs.androidx.core
implementation libs.androidx.activity
implementation libs.androidx.transition
implementation libs.androidx.annotation.experimental
implementation "com.facebook.react:react-android"
implementation "com.facebook.react:hermes-android"
// Other dependencies...
}
configurations.all {
resolutionStrategy {
force "androidx.appcompat:appcompat:${rootProject.ext.androidXAppCompatVersion}"
force "androidx.appcompat:appcompat-resources:${rootProject.ext.androidXAppCompatVersion}"
force "androidx.core:core:${rootProject.ext.androidXCoreVersion}"
force "androidx.core:core-ktx:${rootProject.ext.androidXCoreVersion}"
}
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading