Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

340
Views
No puedo obtener servicios de ubicación cuando la aplicación se ejecuta en segundo plano, pero funciona en emuladores (React-native)

No puedo obtener servicios de ubicación cuando mi aplicación se ejecuta en segundo plano, pero funciona en un emulador. ¿Alguien puede ayudar con este problema?

 import Geolocation from 'react-native-geolocation-service'; import BackgroundService from 'react-native-background-actions'; const options = { taskName: 'Example', taskTitle: 'ExampleTask title', taskDesc: 'ExampleTask description', taskIcon: { name: 'ic_launcher', type: 'mipmap', }, color: '#ff00ff', linkingURI: 'yourSchemeHere://chat/jane', parameters: { delay:6000, }, }; const connectSocket = () => { const sleep = (time) => new Promise((resolve) => setTimeout(() => resolve(), time)); const client = new WebSocket(`ws://${ip}:${port}`,'echo-protocol') const sendData = (data) => { if(client.readyState === client.OPEN){ client.send(JSON.stringify(data)) } } const coordianates = async(taskDataArguments) =>{ const { delay } = taskDataArguments; await new Promise( async (resolve) => { for (let i = 0; BackgroundService.isRunning(); i++) { await BackgroundService.updateNotification({ taskDesc: 'Runned -> ' + i }); Geolocation.getCurrentPosition( (position) => { sendData(position) }, (error) => { console.log(error.code, error.message); }, { enableHighAccuracy: true, timeout: 15000, maximumAge: 10000 } ); await sleep(delay); } }); } client.onopen = async(err)=> { await BackgroundService.start(coordianates, options); } }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!