Open JEricaM opened 9 months ago
What does your js file look like? It looks like you may have a syntax error.
Hi, same problem here. This is my runner file. That import at the top is a troublemaker. Without it the runner is working but the reference is missing. Is it a bug or am I doing something wrong?
import { LocalNotifications } from "@capacitor/local-notifications";
addEventListener("myCustomEvent", (resolve, reject, args) => {
try {
LocalNotifications.checkPermissions().then((result) => {
if (result.display === "granted") {
LocalNotifications.schedule({
notifications: [
{
title: "Push working",
body: "100%",
},
],
});
}
});
} catch (error) {
console.error("Background task error:", error);
}
resolve();
});
OK if I understand correctly just few common use cases are supported for background runner and the root of the runner file can contain only runner function itself. Maybe some explanaitory error message would be fine ;)
the same shit. So stupid that it is only a short message without any details.
Bug Report
Plugin(s)
Capacitor Version
@capacitor/cli: 5.0.5 @capacitor/core: 5.0.5 @capacitor/android: 5.0.5 @capacitor/ios: 5.0.5
Platform(s)
Android, ios
Current Behavior
I'm using capacitor in a ionic+ stencil application
I'm not able to start correctly BackgroundRunner plugin
This is my runner.js location
this is my capacitor.config.ts
And I have this error
Is a problem cause by a wrong path for the runner.js file or something else? I'm not able to make it work!
Expected Behavior
Plugin runs correctly