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

96
Vistas
I want to track the distance i walk and i couldn't make that i'm trying to do that with react native so anyone could help me

i'm trying to make an app that count steps and distance and time and i couldn't find way to get distance in the counter (realtime) so i want any one to help me how to that .

import {useEffect, useState` } from "react"; import * as Location from "expo-location";enter code here

export default `useLocation` = () => {
  const [location, `setLocation`] = `useState`();

  const `getLocation` = async () => {
    try {
      const { granted } = await `Location`.`requestForegroundPermissionsAsync`();
      if (!granted) return;
      const {
        `coords`: { latitude, longitude },
      } = await `Location.getCurrentPositionAsync`();

      console.log(latitude, latitude);
      setLocation({ latitude, longitude });
    } catch (error) {
      console.log(error);
    }
  };

  const `updateLocation` = async () => {
    try {
  await `Locationx.startLocationUpdatesAsync();`

    } catch (error) {
      console.log(error);
    }
  };

  `useEffect`   (  ()   => {

    `getLocation`();

  }, []);
  return location;
};

    enter code here

`

about 4 years ago · Juan Pablo Isaza
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