NTP-38623 | Dialer Clickstream added (#1107)

This commit is contained in:
Aman Singh
2025-02-24 19:21:47 +05:30
committed by GitHub
3 changed files with 41 additions and 9 deletions

View File

@@ -1468,6 +1468,22 @@ export const CLICKSTREAM_EVENT_NAMES = {
name: 'FA_CALL_SYNC_SELF_CALL_ERROR',
description: 'Call sync self call error',
},
FA_DIALER_APP_BLOCKER_SCREEN_LOADED: {
name: 'FA_DIALER_APP_BLOCKER_SCREEN_LOADED',
description: 'Dialer app blocker screen loaded',
},
FA_DIALER_APP_UPDATE_SCREEN_LOADED: {
name: 'FA_DIALER_APP_UPDATE_SCREEN_LOADED',
description: 'Dialer app update screen loaded',
},
FA_CALL_VIA_INHOUSE_DIALER: {
name: 'FA_CALL_VIA_INHOUSE_DIALER',
description: 'Call via inhouse dialer app',
},
FA_CALL_VIA_EXOTEL: {
name: 'FA_CALL_VIA_INHOUSE_DIALER_APP_FAILED',
description: 'Call via inhouse dialer app failed',
},
FA_COSMOS_DEFAULT_DIALER: {
name: 'FA_COSMOS_DEFAULT_DIALER',
description: 'Cosmos default dialer',

View File

@@ -1,5 +1,5 @@
import { Linking, Pressable, StyleSheet, View } from 'react-native';
import React from 'react';
import React, { useEffect } from 'react';
import Text from '@rn-ui-lib/components/Text';
import Layout from '@screens/layout/Layout';
import { GenericStyles } from '@rn-ui-lib/styles';
@@ -8,6 +8,8 @@ import Button from '@rn-ui-lib/components/Button';
import { useAppSelector } from '@hooks';
import DialerAppIcon from '@assets/icons/DialerAppIcon';
import { COLORS } from '@rn-ui-lib/colors';
import { addClickstreamEvent } from '@services/clickstreamEventService';
import { CLICKSTREAM_EVENT_NAMES } from './Constants';
interface IDialerAppUpdate {
onAppUpdate: () => void;
@@ -24,6 +26,14 @@ const DialerAppUpdate: React.FC<IDialerAppUpdate> = ({ onAppUpdate }) => {
);
};
useEffect(() => {
addClickstreamEvent(
isAppInstalled
? CLICKSTREAM_EVENT_NAMES.FA_DIALER_APP_UPDATE_SCREEN_LOADED
: CLICKSTREAM_EVENT_NAMES.FA_DIALER_APP_BLOCKER_SCREEN_LOADED
);
}, []);
return (
<Layout>
<View style={[GenericStyles.fill]}>

View File

@@ -22,7 +22,7 @@ import { setCallAttemptedOn } from '@reducers/telephoneNumbersSlice';
import { makeACallToCustomer } from '@actions/callRecordingActions';
import { logError } from '@components/utlis/errorUtils';
import { launchCallIntent } from '@components/utlis/callModuleUtils';
import { getExotelNumber } from "@common/AgentActivityConfigurableConstants";
import { getExotelNumber } from '@common/AgentActivityConfigurableConstants';
import { DIALER_APP_FILE_PATH } from '@common/utils';
interface ICallViaBottomSheet {
@@ -88,23 +88,29 @@ const CallViaBottomSheet = (props: ICallViaBottomSheet) => {
];
const callCustomer = (callVia: CallVia) => {
if (callVia === CallVia.ANDROID) {
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_CALL_VIA_INHOUSE_DIALER, {
mobileNumber,
});
launchCallIntent(`+91${mobileNumber}`, getExotelNumber(), DIALER_APP_FILE_PATH, (error) => {
if (error) {
// In case any failure happens we will show download dialer app bottom sheet
dispatch(setCallViaBottomSheet(false));
dispatch(setShowDialerBottomSheet(true));
}
})
});
} else if (callVia === CallVia.EXOTEL) {
PhoneStateModule.getCurrentCallState()
.then((callState: string) => {
if (isCallInactiveOrUnknown(callState as PhoneStateType)) {
dispatch(setCallDetails({
caseId,
customerName,
telephoneNo: mobileNumber,
telephoneReferenceId: referenceId
}));
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_CALL_VIA_EXOTEL);
dispatch(
setCallDetails({
caseId,
customerName,
telephoneNo: mobileNumber,
telephoneReferenceId: referenceId,
})
);
} else {
dispatch(setCallCannotInitiateBottomSheet(true));
}