ionic-team / ionic-team/capacitor-background-runner

Accessing CapacitorKV from App

Open
#103 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
56
Forks
36
Avg merge
4d 12h
Merged PRs (30d)
7

Description

Hey,
I'm working on implementing a background task and need it to stop running when the app is in the foreground.
Using an event dispatch when the app goes into the background doesn't work because there's no active runner when the `appStateChange` event triggers.

It seems to me that the simplest solution would be to use `CapacitorKV` to set the state during the `appStateChange` event to handle this. Is this possible? I couldn't find any information on this in the documentation.
I've seen that #99 would allow to access the App-API, but it would be great to have a solution until it gets merged.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.