From dbe8c04fdc903793888ea9554cae115740e167ab Mon Sep 17 00:00:00 2001 From: Ren Juan Date: Thu, 26 Aug 2021 23:06:33 +0000 Subject: [PATCH] * --- Ejectable/ExpoTaskMgr.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 Ejectable/ExpoTaskMgr.js diff --git a/Ejectable/ExpoTaskMgr.js b/Ejectable/ExpoTaskMgr.js deleted file mode 100644 index 8464e528..00000000 --- a/Ejectable/ExpoTaskMgr.js +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react'; -import { Text, TouchableOpacity } from 'react-native'; -import * as TaskManager from 'expo-task-manager'; -import * as Location from 'expo-location'; - -const LOCATION_TASK_NAME = 'background-location-task'; - -const requestPermissions = async () => { - const { status } = await Location.requestBackgroundPermissionsAsync(); - if (status === 'granted') { - await Location.startLocationUpdatesAsync(LOCATION_TASK_NAME, { - accuracy: Location.Accuracy.Balanced, - }); - } -}; - -const PermissionsButton = () => ( - - Enable background location - -); - -TaskManager.defineTask(LOCATION_TASK_NAME, ({ data, error }) => { - if (error) { - // Error occurred - check `error.message` for more details. - return; - } - if (data) { - const { locations } = data; - // do something with the locations captured in the background - } -}); - -export default PermissionsButton; \ No newline at end of file