Skip to content

Commit a9eaa9f

Browse files
committed
changer
1 parent 804f925 commit a9eaa9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6814
-3812
lines changed

Diff for: .vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "interactive"
3+
}

Diff for: App.tsx

+45-11
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// } from '@aws-amplify/ui-react-native';
3333

3434
// import axios from 'axios';
35-
// import zipy from 'zipy-react-native';
35+
// import zipy from './src';
3636
// import {get} from '@aws-amplify/api';
3737

3838
// const App = () => {
@@ -194,14 +194,22 @@
194194
// },
195195
// });
196196

197-
// export default withAuthenticator(App);
197+
// export default App;
198198

199199
import * as React from 'react';
200200
import { NavigationContainer } from '@react-navigation/native';
201201
import { createNativeStackNavigator } from '@react-navigation/native-stack';
202-
import { Button, Text, View } from 'react-native';
202+
import { Button, Text, View , StyleSheet} from 'react-native';
203203
import HomeScreen from './Homescreen';
204-
import { ScreenNavigation } from './zipy-mobilesdk-reactnative/src/index';
204+
import zipy, { ScreenNavigation } from './src';
205+
import * as Sentry from '@sentry/react-native';
206+
207+
Sentry.init({
208+
dsn: 'https://4e9a8813df40f1594edd8111ac96e536@o4507406330888192.ingest.us.sentry.io/4507406535229440',
209+
210+
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
211+
// enableSpotlight: __DEV__,
212+
});
205213

206214

207215
type RootStackParamList = {
@@ -211,10 +219,15 @@ type RootStackParamList = {
211219

212220
const Stack = createNativeStackNavigator<RootStackParamList>();
213221

214-
const MyStack = () => {
222+
const MyApp = () => {
223+
setTimeout(async ()=>{
224+
// const a= await zipy.getCurrentSessionUrl();
225+
console.log(a)
226+
},2000)
227+
228+
215229
return (
216-
<>
217-
<NavigationContainer>
230+
<NavigationContainer onStateChange={ScreenNavigation}>
218231
<Stack.Navigator>
219232
<Stack.Screen
220233
name="Home"
@@ -224,15 +237,36 @@ const MyStack = () => {
224237
<Stack.Screen name="Profile" component={ProfileScreen} />
225238
</Stack.Navigator>
226239
</NavigationContainer>
227-
</>
240+
228241
);
242+
243+
229244
};
230245

231-
const ProfileScreen: React.FC<{ navigation: any; route: any }> = ({
246+
const styles = StyleSheet.create({
247+
container: {
248+
flex: 1,
249+
},
250+
});
251+
252+
const ProfileScreen: React.FC<{navigation: any; route: any}> = ({
232253
navigation,
233254
route,
234255
}) => {
235-
return <Text style={{color: 'black'}}>This is {route.params.name}'s profile</Text>;
256+
const handleTap = () => {
257+
console.log('Home screen tapped!');
258+
};
259+
return (
260+
<>
261+
<View>
262+
<Text>Welcome to the Home Screen!</Text>
263+
<Button zipy-label="CardContainer" title="Tap me on Home" />
264+
</View>
265+
<Text sentry-label="CardContain22er" style={{color: 'black'}}>This is {route.params.name}'s profile</Text>
266+
</>
267+
);
236268
};
237269

238-
export default MyStack;
270+
271+
272+
export default Sentry.wrap(MyApp);

Diff for: Homescreen.tsx

+31-10
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,36 @@ import {
1515

1616

1717
import axios from 'axios';
18-
import zipy from './zipy-mobilesdk-reactnative/src/index';
18+
import zipy from './src';
1919
import { get } from '@aws-amplify/api';
20+
// import Bugsnag from '@bugsnag/react-native';
21+
import * as Sentry from "@sentry/react-native";
22+
import Bugsnag from '@bugsnag/react-native';
2023

2124
const HomeScreen: React.FC<{ navigation: any }> = ({ navigation }) => {
2225
const handleButton1Click = () => {
23-
zipy.logMessage({message : 'Your custom message', exceptionObj: {'s': 'Your custom message'}});
26+
// zipy.logMessage({message : 'Your custom message', exceptionObj: {'s': 'Your custom message'}});
2427

2528
};
2629

2730
const handleButton2Click = () => {
28-
zipy.logException({message : 'Your custom message', exceptionObj: {'asasas': 'Your custom message'}});
31+
// zipy.logException({message : 'Your custom message', exceptionObj: {'asasas': 'Your custom message'}});
32+
Sentry.nativeCrash();
33+
34+
};
35+
36+
37+
const handleButton6Click = () => {
38+
// zipy.logException({message : 'Your custom message', exceptionObj: {'asasas': 'Your custom message'}});
39+
Bugsnag.notify(new Error('Test error'))
2940

3041
};
3142

3243
const handleButton4Click = async () => {
3344
try {
3445
let d = e;
35-
console.log(d)
3646
} catch (error) {
37-
console.error('Error fetching data:', error);
47+
console.error(error);
3848
}
3949
};
4050

@@ -82,7 +92,8 @@ zipy.logMessage({message : 'Your custom message', exceptionObj: {'s': 'Your cust
8292
const handleButton5Click = () => {
8393
// Try to access an undefined variable (reference error)
8494

85-
95+
// Bugsnag.notify(new Error('Test error'))
96+
8697
const url = 'https://jsonplaceholder.typicode.com/todos';
8798

8899
// Define the custom headers
@@ -110,6 +121,8 @@ zipy.logMessage({message : 'Your custom message', exceptionObj: {'s': 'Your cust
110121
.then(response => response.json())
111122
.then(json => console.log('Response:', json))
112123
.catch(error => console.error('An error occurred:', error));
124+
125+
throw new Error('My first Sentry error!');
113126
};
114127

115128
// const handleButton4Click = () => {
@@ -120,18 +133,18 @@ zipy.logMessage({message : 'Your custom message', exceptionObj: {'s': 'Your cust
120133
<View style={styles.container}>
121134
<View style={styles.buttonContainer}>
122135
<Button
123-
title="Zipy logs"
136+
title="p logs"
124137
onPress={handleButton1Click}
125138
color="#841584" // Change the color if needed
126-
accessibilityLabel="Zipy logs"
139+
accessibilityLabel="p logs"
127140
/>
128141
</View>
129142
<View style={styles.buttonContainer}>
130143
<Button
131-
title="Zipy Exception"
144+
title="p Exception"
132145
onPress={handleButton2Click}
133146
color="#F39C12" // Change the color if needed
134-
accessibilityLabel="Zipy Exception"
147+
accessibilityLabel="p Exception"
135148
/>
136149
</View>
137150
<View style={styles.buttonContainer}>
@@ -158,6 +171,14 @@ zipy.logMessage({message : 'Your custom message', exceptionObj: {'s': 'Your cust
158171
accessibilityLabel="Fetch get network call"
159172
/>
160173
</View>
174+
<View style={styles.buttonContainer}>
175+
<Button
176+
title="Fetch ge"
177+
onPress={handleButton6Click}
178+
color="#DF9DFD" // Change the color if needed
179+
accessibilityLabel="Fetch ge"
180+
/>
181+
</View>
161182
<View style={styles.buttonContainer}>
162183
<Button
163184
title="Go to Jane's profile"

Diff for: android/app/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: 'embrace-swazzler'
23
apply plugin: "org.jetbrains.kotlin.android"
34
apply plugin: "com.facebook.react"
45

@@ -69,6 +70,7 @@ def enableProguardInReleaseBuilds = false
6970
*/
7071
def jscFlavor = 'org.webkit:android-jsc:+'
7172

73+
apply from: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../sentry.gradle")
7274
android {
7375
ndkVersion rootProject.ext.ndkVersion
7476
buildToolsVersion rootProject.ext.buildToolsVersion
@@ -117,3 +119,4 @@ dependencies {
117119
}
118120

119121
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
122+
apply plugin: "com.bugsnag.android.gradle"

Diff for: android/app/src/main/AndroidManifest.xml

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22

33
<uses-permission android:name="android.permission.INTERNET" />
4+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
5+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
46

57
<application
68
android:name=".MainApplication"
@@ -21,5 +23,8 @@
2123
<category android:name="android.intent.category.LAUNCHER" />
2224
</intent-filter>
2325
</activity>
26+
<meta-data android:name="com.bugsnag.android.API_KEY" android:value="b9f500c4aaf6b41e06f94b511e4bfab0" />
27+
<meta-data android:name="com.bugsnag.android.ENDPOINT_NOTIFY" android:value="sandesh" />
28+
<meta-data android:name="com.bugsnag.android.ENDPOINT_SESSIONS" android:value="sandeshh" />
2429
</application>
2530
</manifest>

Diff for: android/app/src/main/embrace-config.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"app_id": "5yjRP",
3+
"api_token": "23ec430088674c33a90983dcc702e221"
4+
}

Diff for: android/app/src/main/java/com/reactnativetestapp/MainApplication.kt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.reactnativetestapp
22

3+
import com.bugsnag.android.Bugsnag
34
import android.app.Application
45
import com.facebook.react.PackageList
56
import com.facebook.react.ReactApplication
@@ -35,6 +36,7 @@ class MainApplication : Application(), ReactApplication {
3536

3637
override fun onCreate() {
3738
super.onCreate()
39+
Bugsnag.start(this)
3840
SoLoader.init(this, false)
3941
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
4042
// If you opted-in for the New Architecture, we load the native entry point for this app.

Diff for: android/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ buildscript {
1313
}
1414
dependencies {
1515
classpath("com.android.tools.build:gradle")
16+
classpath("com.bugsnag:bugsnag-android-gradle-plugin:8.+")
17+
classpath "io.embrace:embrace-swazzler:${findProject(':embrace-io_react-native').properties['emb_android_sdk']}"
1618
classpath("com.facebook.react:react-native-gradle-plugin")
1719
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
1820
}

Diff for: android/sentry.properties

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
auth.token=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
3+
4+
defaults.org=anderson-yw
5+
defaults.project=react-native
6+
7+
defaults.url=https://sentry.io/

Diff for: index.js

+59-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,68 @@
1+
import Bugsnag from "@bugsnag/react-native";
2+
Bugsnag.start();
3+
14
/**
25
* @format
36
*/
47

58
import {AppRegistry} from 'react-native';
6-
import App from './App';
79
import {name as appName} from './app.json';
810

9-
import { Amplify } from 'aws-amplify';
10-
import amplifyconfig from './src/amplifyconfiguration.json';
11-
import zipy from 'zipy-react-native';
11+
import zipy from './src';
12+
import MyApp from './App';
13+
import {GestureCapture} from './src';
14+
import Instabug, { InvocationEvent } from 'instabug-reactnative';
15+
16+
// zipy.init('6d2b9556');
17+
import {endAppStartup, initialize} from '@embrace-io/react-native';
18+
import React from 'react';
19+
import BugsnagPerformance from '@bugsnag/react-native-performance'
20+
21+
Instabug.init({
22+
token: '8df952f58904eb2136a775921239df15',
23+
invocationEvents: [InvocationEvent.shake, InvocationEvent.screenshot, InvocationEvent.floatingButton],
24+
});
25+
import { initialize as clarityInitialize } from 'react-native-clarity';
26+
import * as Sentry from "@sentry/react-native";
27+
28+
Sentry.init({
29+
dsn: "https://4e9a8813df40f1594edd8111ac96e536@o4507406330888192.ingest.us.sentry.io/4507406535229440",
30+
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
31+
// We recommend adjusting this value in production.
32+
tracesSampleRate: 1.0,
33+
_experiments: {
34+
// profilesSampleRate is relative to tracesSampleRate.
35+
// Here, we'll capture profiles for 100% of transactions.
36+
profilesSampleRate: 1.0,
37+
},
38+
});
39+
40+
import Smartlook from 'react-native-smartlook-analytics'
41+
42+
Smartlook.instance.preferences.setProjectKey(
43+
'c35d3361ac069354d84d161f78ca703c45895190'
44+
);
45+
Smartlook.instance.start();
46+
47+
clarityInitialize("mn296b8b06");
48+
const Appp = () => {
49+
React.useEffect(() => {
50+
// Note: Initialize is a promise, so if you want to perform an action
51+
// and it must be tracked, it is recommended to use await/then
52+
// to wait for the method to finish
53+
initialize().then(hasStarted => {
54+
if (hasStarted) {
55+
endAppStartup();
56+
}
57+
});
58+
}, []);
1259

13-
zipy.init('38489a9e');
14-
Amplify.configure(amplifyconfig);
60+
BugsnagPerformance.start({ apiKey: 'b9f500c4aaf6b41e06f94b511e4bfab0' })
61+
return (
62+
<GestureCapture>
63+
<MyApp />
64+
</GestureCapture>
65+
);
66+
};
1567

16-
AppRegistry.registerComponent(appName, () => App);
68+
AppRegistry.registerComponent(appName, () => Appp);

0 commit comments

Comments
 (0)