Skip to content

Commit 8dd5f41

Browse files
committed
hotfix set locatino permission message for android
1 parent 24ed388 commit 8dd5f41

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/contexts/LocationContext.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { createContext, useState, useEffect, useCallback, useContext, use
22
import BackgroundGeolocation from 'react-native-background-geolocation';
33
import BackgroundFetch from 'react-native-background-fetch';
44
import { Place, Point } from '@fleetbase/sdk';
5-
import { isEmpty } from '../utils';
5+
import { isEmpty, config } from '../utils';
66
import { useAuth } from './AuthContext';
77
import useStorage from '../hooks/use-storage';
88
import useFleetbase from '../hooks/use-fleetbase';
@@ -117,6 +117,12 @@ export const LocationProvider = ({ children }) => {
117117

118118
BackgroundGeolocation.ready(
119119
{
120+
backgroundPermissionRationale: {
121+
title: `Allow ${config('APP_NAME')} to access your location`,
122+
message: `${config('APP_NAME')} collects location data to update your position in real-time, even when the app is closed or running in the background. This allows dispatchers and ops teams to track your progress and provide better support while you drive.`,
123+
positiveAction: 'Allow',
124+
negativeAction: 'Deny',
125+
},
120126
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
121127
distanceFilter: 10,
122128
stopOnTerminate: false,

0 commit comments

Comments
 (0)