Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

469
Vistas
How do I get background location running in an Expo EAS application on iOS?

I have an EAS stand alone app that was built using Expo SDK 43. I am trying to request permissions to access a user's background location (location when the app is not open but running in the background)

When the app builds the console throws this warning:

TaskManager: Task "background-location-task" has been executed but looks like it is not
 defined. Please make sure that "TaskManager.defineTask" is called during initialization phase.

It also throws this warning as well:

[Unhandled promise rejection: Error: Task 'background-location-task' not found for app ID 'mainApplication'.]

I believe I am setting up background locations properly, but it appears I may not be executing something correctly. Below is my code for how I request background locations.

Note: I have of the background request in a useEffect, and the Task-Manager outside the useEffect inside the file following foreground location requests.

// app.json & Info.Plist:

"ios":{
   ...
     "UIBackgroundModes":[
       "location",
       "fetch"
      ]
 }

//Inside the main file

import * as Location from 'expo-location';
import * as TaskManager from 'expo-task-manager'
import * as BackgroundFetch from 'expo-background-fetch

const LOCATION_TASK_NAME = 'background-location-task';


useEffect(()=>{


async function getBackgroundLocationAsync(){
   let {status} = await Location.requestBackgroundPermissionsAsync()
     if(status!=='granted'){
        setErrorMsg('Permission to access background location was denied')
        return;
       }
       if(status ==='granted'){
         await Location.startLocationUpdatesAsync(LOCATION_TASK_NAME,{
           accuracy: Location.Accuracy.Balanced,
       })
     }

     getBackgroundLocationAsync()

     },
   [],
  )


TaskManager.defineTask(LOCATION_TASK_NAME,({data, error})=>{
  if(error){
 return;
}
if(data){
  const{locations}=data
 }
})
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda