react-native-background-geolocation
react-native-background-geolocation copied to clipboard
how to disable the beep sound in real application when app was terminated i used "Config.debug:false". But it is not working .
BackgroundGeolocation.ready({ desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, distanceFilter: 5, disableElasticity: true, stopTimeout: null, heartbeatInterval: 60, preventSuspend: true, locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER, locationAuthorizationRequest: 'Always', debug: false, // <-- enable this hear sounds for background-geolocation life-cycle. logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, stopOnTerminate: true, // <-- Allow the background-service to continue tracking when user closes the app. startOnBoot: true, // <-- Auto start tracking when device is powered-up. batchSync: false, // <-- [Default: false] Set true to sync locations to server in a single HTTP request. autoSync: true, // <-- [Default: true] Set true to sync each location to server as it arrives. })
You must call .ready(config) EACH time your app launches, regardless of anything.
Are you sure that's the exact Config you're using in your app?
This is my component i am calling this component. Yes i am using exact below config?
ISSUES: 1. App giving beep sound every time when location is tracking in android. How to disable beep sounds? 2. BackgroundGeolocation is not working when terminate and reopen the app . But it is working when we are terminate and re-open multiple times. It is happening only in ANDROID, IOS is working fine
export default function App() {
const [enabled, setEnabled] = React.useState(false);
React.useEffect(() => {
const onHeartBeat = BackgroundGeolocation.onHeartbeat((event) => {
console.log("[onHeartbeat] ", new Date().getMinutes(), event);
// You could request a new location if you wish.
BackgroundGeolocation.getCurrentPosition({
samples: 1,
persist: true
}).then(async (location) => {
const get_data = await AsyncStorage.getItem('location_data');
const existingDataArray = get_data ? JSON.parse(get_data) : [];
const newDataArray = typeof location === 'object'
? [...existingDataArray, location]
: [...existingDataArray];
await AsyncStorage.setItem('location_data', JSON.stringify(newDataArray));
});
});
BackgroundGeolocation.ready({
// Geolocation Config
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
distanceFilter: 5,
disableElasticity: true,
// Activity Recognition
stopTimeout: null,
heartbeatInterval: 60,
preventSuspend: true,
locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER,
locationAuthorizationRequest: 'Always',
debug: false, // <-- enable this hear sounds for background-geolocation life-cycle.
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
stopOnTerminate: true, // <-- Allow the background-service to continue tracking when user closes the app.
startOnBoot: true, // <-- Auto start tracking when device is powered-up.
batchSync: false, // <-- [Default: false] Set true to sync locations to server in a single HTTP request.
autoSync: true, // <-- [Default: true] Set true to sync each location to server as it arrives.
}).then((state) => {
BackgroundGeolocation.start()
});
return () => {
onHeartBeat.remove()
}
}, []);
return (
<ApolloProvider client={client}>
<PaperProvider theme={primary}>
<MyStack />
</PaperProvider>
</ApolloProvider>
);
}
How to disable beep sounds?
debug: false
I have no idea what you're doing wrong, but you're doing something wrong.
See wiki "Debugging" and learn to observe the plug-in native logs.
i check my code i din't understand where is wrong. BackgroundGeolocation is not working when terminate and reopen the app . please help me.
See wiki "Debugging" and learn how to fetch logs from the plug-in database using .emailLog.
Also search api docs "Logger" for more information.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.