ionic-team / capacitor-background-runner

Other
33 stars 17 forks source link

Where to place the .js file #59

Closed eleonorarocchi closed 1 month ago

eleonorarocchi commented 7 months ago

Following the documentation it is not clear where to place the .js file. Even with several tests you always get the following error (in an Ionic+Angular project).

`⚡️ To Native -> BackgroundRunner dispatchEvent 83467667

starting runner and loading contexts...

error executing task: runnerError(reason: "source file not found")

ERROR MESSAGE: {"errorMessage":"runnerError(reason: \"source file not found\")","message":"runnerError(reason: \"source file not found\")"}

⚡️ [error] - {"errorMessage":"runnerError(reason: \"source file not found\")","message":"runnerError(reason: \"source file not found\")"}

⚡️ [log] - Errore in sync, processo terminato. {"errorMessage":"runnerError(reason: \"source file not found\")"}

To Native Cordova -> BackgroundMode disable BackgroundMode1323252294 ["options": []]`

davisCrabbBrandt commented 7 months ago

@eleonorarocchi I ended up putting mine in my assets folder. Simon Grimm has an alternative in the video that he made about how to implement this plugin

mahen23 commented 7 months ago

Follow these instructions https://ionic.io/blog/create-background-tasks-in-ionic-with-capacitor