Skip to content

Commit d2877df

Browse files
authored
Merge pull request #19 from typelets/fix/mobile-master-password-loading
fix(mobile): resolve master password setup hang and add New Relic mon…
2 parents ebd2ea4 + 343ef33 commit d2877df

File tree

8 files changed

+930
-69
lines changed

8 files changed

+930
-69
lines changed

apps/mobile/v1/app/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export default function HomeScreen() {
77
// Create navigation object that pushes to new screens
88
const navigation = {
99
navigate: (screen: string, params?: any) => {
10-
console.log(`Navigate to ${screen} with params:`, params);
1110
if (screen === 'Notes') {
1211
// Navigate to a new notes screen as a modal or pushed screen
1312
const queryParams = new URLSearchParams();
@@ -25,4 +24,4 @@ export default function HomeScreen() {
2524
};
2625

2726
return <FoldersScreen navigation={navigation} />;
28-
}
27+
}

apps/mobile/v1/index.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import 'expo-router/entry';
2+
import { Platform } from 'react-native';
3+
4+
// Initialize New Relic agent
5+
try {
6+
const NewRelic = require('newrelic-react-native-agent');
7+
const { version } = require('./package.json');
8+
9+
// New Relic tokens for iOS and Android
10+
let appToken;
11+
12+
if (Platform.OS === 'ios') {
13+
appToken = 'AA4947ff8556e29649729eb4a51ec43c236e936603-NRMA';
14+
} else {
15+
appToken = 'AAd9a8f7117b043a06ea91e7f4afb65cf34344223f-NRMA';
16+
}
17+
18+
const agentConfiguration = {
19+
// Android Specific
20+
// Optional: Enable or disable collection of event data.
21+
analyticsEventEnabled: true,
22+
23+
// Optional: Enable or disable crash reporting.
24+
crashReportingEnabled: true,
25+
26+
// Optional: Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested.
27+
// This will disable default and custom interactions.
28+
interactionTracingEnabled: true,
29+
30+
// Optional: Enable or disable reporting successful HTTP requests to the MobileRequest event type.
31+
networkRequestEnabled: true,
32+
33+
// Optional: Enable or disable reporting network and HTTP request errors to the MobileRequestError event type.
34+
networkErrorRequestEnabled: true,
35+
36+
// Optional: Enable or disable capture of HTTP response bodies for HTTP error traces, and MobileRequestError events.
37+
httpResponseBodyCaptureEnabled: true,
38+
39+
// Optional: Enable or disable agent logging.
40+
loggingEnabled: true,
41+
42+
// Optional: Specifies the log level. Omit this field for the default log level.
43+
// Options include: ERROR (least verbose), WARNING, INFO, VERBOSE, AUDIT (most verbose).
44+
logLevel: NewRelic.LogLevel.INFO,
45+
46+
// iOS Specific
47+
// Optional: Enable/Disable automatic instrumentation of WebViews
48+
webViewInstrumentation: true,
49+
50+
// Optional: Set a specific collector address for sending data. Omit this field for default address.
51+
// collectorAddress: "",
52+
53+
// Optional: Set a specific crash collector address for sending crashes. Omit this field for default address.
54+
// crashCollectorAddress: ""
55+
};
56+
57+
// Initialize New Relic agent
58+
if (NewRelic && NewRelic.startAgent) {
59+
NewRelic.startAgent(appToken, agentConfiguration);
60+
NewRelic.setJSAppVersion(version);
61+
}
62+
} catch (error) {
63+
// Silently fail if New Relic initialization fails
64+
}

0 commit comments

Comments
 (0)