Seeing errors with a basic attempt at using the plugin
@theproducer is already working on this.
Since Aug 1, 2023.
Assessment
This issue has not been assessed yet.
Description
In my background.js file i have 1 event listener defined:
addEventListener("myEvent", (details) => {
console.log("do something to update the system here:", details);
details.completed();
});
In my capacitor.config.ts i have Background Runner configured as follows:
BackgroundRunner: {
label: "com.myappname.background.task",
src: "background.js",
event: "myEvent",
repeat: false,
interval: 2,
autoStart: false,
}
In my React App i am using the @capacitor/app plugin to monitor appStateChange and am triggering myEvent based on the isActive status as follows:
App.addListener('appStateChange', async ({ isActive }) => {
if(!isActive) {
await BackgroundRunner.dispatchEvent({
label: "com.myappname.background.task",
event: "myEvent",
details: {foo: 'bar'},
});
}
});
Results in the following errors when running the app on an actual iOS device running iOS v16.5.1(c) after putting the app into the background:
starting runner and loading contexts...
2023-07-29 18:39:07.567069-0400 App[39138:2062252] *** Assertion failure in -[CLLocationManager setAllowsBackgroundLocationUpdates:], CLLocationManager.m:1033
2023-07-29 18:39:07.567933-0400 App[39138:2062252] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: !stayUp || CLClientIsBackgroundable(internal->fClient) || _CFMZEnabled()'
*** First throw call stack:
(0x1c0b98cb4 0x1b9c343d0 0x1bb32a56c 0x1cc5b1f28 0x10135d0d8 0x10135ce1c 0x101359274 0x10134e8a0 0x10134b400 0x10134c814 0x101352820 0x10134a600 0x101b7c520 0x101b7e038 0x101b92670 0x101b92e34 0x220918da0 0x220918b7c)
libc++abi: terminating due to uncaught exception of type NSException
What am i missing?
- Dominant language
- C
- Stars
- 57
- Forks
- 37
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ionic-team/capacitor-background-runner
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
ionic-team/capacitor-background-runner#158 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ionic-team/capacitor-background-runner#155 · 1 reaction ·
-
Capacitor keeps running old background runnersMay be free again @theproducer claimed this 245 days ago, and no pull request is open. Openbug
ionic-team/capacitor-background-runner#152 · 1 comment · 2 reactions · 1 assignee ·
All issues in ionic-team/capacitor-background-runner
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
python-pillow/Pillow#10087 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenPrinting/cups#1729 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
awslabs/amazon-kinesis-video-streams-webrtc-sdk-c#2406 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
DaveGamble/cJSON#1094 ·
-
status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
PX4/PX4-Autopilot#28923 ·
Maintainers usually reply within 1 day