|
@@ -41,7 +41,7 @@ TaskManager.defineTask(LOCATION_TASK_NAME, async ({ data, error }) => {
|
|
storage.set('last_location_sent_time', now);
|
|
storage.set('last_location_sent_time', now);
|
|
storage.set('last_latitude', coords.latitude);
|
|
storage.set('last_latitude', coords.latitude);
|
|
storage.set('last_longitude', coords.longitude);
|
|
storage.set('last_longitude', coords.longitude);
|
|
-
|
|
|
|
|
|
+
|
|
const netInfoState = await NetInfo.fetch();
|
|
const netInfoState = await NetInfo.fetch();
|
|
if (netInfoState.isConnected) {
|
|
if (netInfoState.isConnected) {
|
|
checkAndSendSavedMessages();
|
|
checkAndSendSavedMessages();
|
|
@@ -70,7 +70,7 @@ TaskManager.defineTask(LOCATION_TASK_NAME, async ({ data, error }) => {
|
|
|
|
|
|
export const startBackgroundLocationUpdates = async () => {
|
|
export const startBackgroundLocationUpdates = async () => {
|
|
const hasStarted = await Location.hasStartedLocationUpdatesAsync(LOCATION_TASK_NAME);
|
|
const hasStarted = await Location.hasStartedLocationUpdatesAsync(LOCATION_TASK_NAME);
|
|
- if (hasStarted) {
|
|
|
|
|
|
+ if (hasStarted || Platform.OS === 'android') {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|