TP-37153 | fixes

This commit is contained in:
Aman Chaturvedi
2023-08-31 12:42:59 +05:30
parent 4edbca352d
commit 89d73bd8f6
4 changed files with 3 additions and 25 deletions

View File

@@ -90,7 +90,6 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
if (!location) {
return;
}
toast({ type: 'info', text1: `Location: ${location.latitude}, ${location.longitude}` });
const isActiveOnApp: string | boolean = (await getItem(StorageKeys.IS_USER_ACTIVE)) || false;
const geolocation: IGeolocationPayload = {
latitude: location.latitude,
@@ -192,7 +191,7 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
{
taskId: FOREGROUND_TASKS.GEOLOCATION,
task: handleSendGeolocation,
delay: 3000, // 3 minutes
delay: 3 * MILLISECONDS_IN_A_MINUTE, // 3 minutes
onLoop: true,
},
{

View File

@@ -5,27 +5,6 @@ import { logError } from '../../utlis/errorUtils';
import { addClickstreamEvent } from '../../../services/clickstreamEventService';
import { CLICKSTREAM_EVENT_NAMES } from '../../../common/Constants';
const FIVE_MIN = 5 * 60 * 1000;
export const requestLocationPermission = async () => {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
{
title: 'Geolocation Permission',
message: 'Can we access your location?',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
}
);
return granted === 'granted';
} catch (err) {
toast({
type: 'error',
text1: 'requestLocationPermission failed',
});
return false;
}
};
export class CaptureGeolocation {
private static capturedLocation: {

View File

@@ -10,7 +10,7 @@ import PhoneIcon from '../assets/icons/PhoneIcon';
import NotificationIconSmall from '../../RN-UI-LIB/src/Icons/NotificationIconSmall';
export const permissionsScreenMessage =
'NAVI Cosmos needs your permission to give you access to certain featuress';
'NAVI Cosmos needs your permission to give you access to certain features';
export const androidPermissions = [
{