TP-72939 | Ms clarity added
This commit is contained in:
11
App.tsx
11
App.tsx
@@ -35,7 +35,7 @@ import { getPermissionsToRequest } from './src/components/utlis/PermissionUtils'
|
||||
import ScreenshotBlocker from './src/components/utlis/ScreenshotBlocker';
|
||||
import { initSentry } from './src/components/utlis/sentry';
|
||||
import { setItem } from './src/components/utlis/storageHelper';
|
||||
import { APM_APP_NAME, APM_BASE_URL, ENV } from './src/constants/config';
|
||||
import { APM_APP_NAME, APM_BASE_URL, ENV, MS_CLARITY_PROJECT_ID } from './src/constants/config';
|
||||
import usePolling from './src/hooks/usePolling';
|
||||
import AuthRouter from './src/screens/auth/AuthRouter';
|
||||
import { type TDocumentObj } from './src/screens/caseDetails/interface';
|
||||
@@ -44,14 +44,14 @@ import { addClickstreamEvent } from './src/services/clickstreamEventService';
|
||||
import { setJsErrorHandler } from './src/services/exception-handler.service';
|
||||
import fetchUpdatedRemoteConfig from './src/services/firebaseFetchAndUpdate.service';
|
||||
import { StorageKeys } from './src/types/storageKeys';
|
||||
import { initialize, LogLevel } from 'react-native-clarity';
|
||||
import { initialize, setCurrentScreenName } from 'react-native-clarity';
|
||||
|
||||
initSentry();
|
||||
|
||||
if (ENV === 'prod') {
|
||||
initialize('n2nsbu7o78', {
|
||||
logLevel: LogLevel.Verbose,
|
||||
});
|
||||
if (MS_CLARITY_PROJECT_ID) {
|
||||
initialize(MS_CLARITY_PROJECT_ID);
|
||||
}
|
||||
}
|
||||
|
||||
setJsErrorHandler();
|
||||
@@ -166,6 +166,7 @@ function App() {
|
||||
ref={navigationRef}
|
||||
onStateChange={async (state) => {
|
||||
const currentRouteName = getActiveRouteName(state);
|
||||
setCurrentScreenName(currentRouteName);
|
||||
await analytics().logScreenView({
|
||||
screen_name: currentRouteName,
|
||||
screen_class: currentRouteName,
|
||||
|
||||
@@ -8,3 +8,4 @@ export const APM_APP_NAME = 'cosmos-app';
|
||||
export const APM_BASE_URL = 'https://dev-longhorn-portal.np.navi-tech.in/apm-events';
|
||||
export const GOOGLE_SSO_CLIENT_ID =
|
||||
'60755663443-40k0fbrbbqv4ci4hrjlbrphab5fj387b.apps.googleusercontent.com';
|
||||
export const MS_CLARITY_PROJECT_ID = '';
|
||||
@@ -12,3 +12,4 @@ export const IS_DATA_SYNC_REQUIRED = true;
|
||||
export const DATA_SYNC_TIME_INTERVAL = 2 * MINUTES_IN_AN_HOUR * MILLISECONDS_IN_A_MINUTE; // 2hr
|
||||
export const GOOGLE_SSO_CLIENT_ID =
|
||||
'136591056725-ev8db4hrlud2m23n0o03or3cmmp3a3cq.apps.googleusercontent.com';
|
||||
export const MS_CLARITY_PROJECT_ID = 'n2nsbu7o78';
|
||||
@@ -12,3 +12,4 @@ export const IS_DATA_SYNC_REQUIRED = true;
|
||||
export const DATA_SYNC_TIME_INTERVAL = 2 * MINUTES_IN_AN_HOUR * MILLISECONDS_IN_A_MINUTE; // 2hr
|
||||
export const GOOGLE_SSO_CLIENT_ID =
|
||||
'60755663443-40k0fbrbbqv4ci4hrjlbrphab5fj387b.apps.googleusercontent.com';
|
||||
export const MS_CLARITY_PROJECT_ID = '';
|
||||
@@ -11,6 +11,7 @@ import { getAppVersion } from '../components/utlis/commonFunctions';
|
||||
import { COLORS } from '../../RN-UI-LIB/src/styles/colors';
|
||||
import { alfredHandleSWWEvent } from '../components/utlis/DeviceUtils';
|
||||
import crashlytics from '@react-native-firebase/crashlytics';
|
||||
import { setCustomTag } from 'react-native-clarity';
|
||||
|
||||
interface IErrorBoundary {
|
||||
children?: ReactNode;
|
||||
@@ -37,7 +38,8 @@ class ErrorBoundary extends Component<IErrorBoundary, IErrorBoundaryState> {
|
||||
});
|
||||
logError(error);
|
||||
crashlytics().recordError(error);
|
||||
alfredHandleSWWEvent(new Error("Error in Alfred recording"));
|
||||
setCustomTag('jsError', error?.message?.slice(0, 255));
|
||||
alfredHandleSWWEvent(new Error('Error in Alfred recording'));
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
} from '../../common/Constants';
|
||||
import { ToastMessages } from '../../screens/allCases/constants';
|
||||
import { alfredHandleSWWEvent } from './DeviceUtils';
|
||||
import { setCustomTag } from 'react-native-clarity';
|
||||
|
||||
export enum ApiKeys {
|
||||
GENERATE_OTP = 'GENERATE_OTP',
|
||||
@@ -273,6 +274,7 @@ axiosInstance.interceptors.response.use(
|
||||
});
|
||||
}
|
||||
const { config, response } = error;
|
||||
setCustomTag('apiError', `API Error occured - ${response?.status}`);
|
||||
alfredHandleSWWEvent(new Error("Error in Alfred recording in API response"));
|
||||
logError(error as Error, config?.baseURL + config?.url);
|
||||
const start = response?.config?.headers['request-start-time'];
|
||||
|
||||
@@ -12,3 +12,4 @@ export const IS_DATA_SYNC_REQUIRED = true;
|
||||
export const DATA_SYNC_TIME_INTERVAL = 2 * MINUTES_IN_AN_HOUR * MILLISECONDS_IN_A_MINUTE; // 2hr
|
||||
export const GOOGLE_SSO_CLIENT_ID =
|
||||
'60755663443-40k0fbrbbqv4ci4hrjlbrphab5fj387b.apps.googleusercontent.com';
|
||||
export const MS_CLARITY_PROJECT_ID = 'n2nsbu7o78';
|
||||
|
||||
Reference in New Issue
Block a user