My app freezes after I activate the background job and try to reopen

Aperta
#136 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
android, ios, javascript, react-native
Ambito
mobile

Direzione di ricerca

Start by reproducing the freeze with the React Native AppState and BackgroundJob lifecycle shown in the issue, then inspect the library’s platform-specific background service entry points. The report does not identify a failing platform, reproduction project, or expected fix, so first establish whether the service remains active after returning to the app and compare behavior on Android and iOS.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Hey people,
I have an app that triggers a background job immediately when my app state turns to 'background' using the AppState method from react native and stopping this background job once my AppState returns 'active'. The background job I'm activating has a function inside that listens sounds and then activates itself when receives an specific word, when I am activating my app after recognizes the sound and i try to re enter to the app, the app freezes and doesn't load my resources, so the only way to restart the app is uninstalling it because the background job is still running, how can I solve this issue? there is a better way I can use the dependency?

async componentDidMount() {
    this.props.isBackground.current = false;
    BackgroundJob.stop();
    this._stopProcessing()
  }

  async componentDidUpdate() {
    if (AppState.currentState === 'background' && !this.props.isBackground.current) {
      this.props.isBackground.current = true;
      await BackgroundJob.start(this.backgroundListening, options);
    } else if (AppState.currentState === 'active' && this.props.isBackground.current) {
      this.props.isBackground.current = false;
      BackgroundJob.stop();
      this._stopProcessing()
    }
  }
Lingua principale
Java
Stelle
941
Fork
145
Merge medio
1g 23h
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Rapsssito/react-native-background-actions

Tutte le issue di Rapsssito/react-native-background-actions

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.