dispatchEvent details are not passed to background args
@theproducer ci sta già lavorando.
Dal 15/7/2024.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
As the title describes dispatchEvent details are not passed to background args so i cannot use any component data in my background proces for fetching stuff for example
Let's say i have a function triggered by a button:
async activateBackgroundTask() {
try {
await BackgroundRunner.dispatchEvent({
label: 'com.app.app.check',
event: 'backgroundEventExecute',
details: { hello: "Hello world"},
})
} catch (error) {
console.error('Background task error:', error);
}
}
And a runner.js like this:
addEventListener('backgroundEventExecute', async (resolve, reject, args) => {
try {
// Notify that the background event was triggered
console.log('backgroundEventExecute: ', args, args.hello);
resolve();
} catch (error) {
console.error('Error in backgroundEvent:', error);
reject(error);
}
});
My args is always empty so the data i want to pass will never reach the background process. My console.log is reached and printed in the console. I've also tried to use CapacitorKV.get but i cannot use CapacitorKV.set in my angular/ionic component as it is not available there..
Specs:
"@capacitor/background-runner": "^1.1.0",
Angular: 17.x.x
Capacitor: 6.x.x
Can someone please tell me how to solve this issue OR fix this so we can use this background-runner?
Thanks in advance!
- Lingua principale
- C
- Stelle
- 57
- Fork
- 36
- Merge medio
- 3g 18h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ionic-team/capacitor-background-runner
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
ionic-team/capacitor-background-runner#158 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ionic-team/capacitor-background-runner#155 · 1 reazione ·
-
Capacitor keeps running old background runnersForse di nuovo libera @theproducer l’ha presa 280 giorni fa e non c’è nessuna pull request aperta. Apertabug
ionic-team/capacitor-background-runner#152 · 1 commento · 2 reazioni · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di ionic-team/capacitor-background-runner
Issue simili
-
[compiler-rt] Rtsan-aarch64-NoInstTest: error: no such file or directory: 'NOTFOUND' (libatomic)Apertabuild-problem compiler-rt:rtsan platform:linux
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
llvm/llvm-project#239039 ·
I maintainer di solito rispondono entro 1 giorno
-
component:obi contribfest go test
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4143 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
checkpoint-restore/criu#3304 ·
I maintainer di solito rispondono entro 1 giorno
-
Separate Installation Commands into Individual Code BlocksForse già presa @andrySD l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
colbymchenry/codegraph#3241 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno