Problems with background

I've been trying for a while to get background to work but looks like I'm not smart enough :D

I've looked at all the code samples and no matter what I do I get this weird error "Permission requiredFailed invoking <symbol>" with no further info. I don't even know where to look next. I've tried copy/pasting and doing all sort of things.

The source is here: https://github.com/mrfoto/ForecastLine/tree/background

And you can see I have the `Background` permission in manifest. This is the output in the console when I manually trigger Temporal event via simulator:

```
HERE
Permission requiredFailed invoking <symbol>
```

So it fails on getting property https://github.com/mrfoto/ForecastLine/blob/background/source/ForecastLineBackground.mc#L19
I don't know why this would fail since object store is supposedly available in background services.

Can someone help me? Pretty please? :D
  • Former Member
    Former Member over 7 years ago
    Your ForcastLine module that contains your constants, does not have the background annotation, so I suspect that is the cause of your error.

    If adding the annotation to that module clears things up, please fill out a bug report in the bug reports forum with this information using the template there. I think the error message should be different in this case.
  • Like Brian said, not having the background annotation means that those things there aren't available in the background. But one thing you may want to watch, is when you use it on a class/module it that you may pull more into the background than you need, and the background is limited to 32k. You may want to rework your code a bit to make sure that you don't pull in code you don't need in the background. I've not looked at the code, so this may be OK already.

    An example is with app-settings. The background only needs a few things, such an APIKEY, but doesn't need things like screen settings for colors and display options. No sense including code for reading those in the background. For things like lat/lon in the ObjectStore, all you need is read access, and you don't need any code to set those things as you can't do setProperty in a background process.
  • Yup, that was it &#65039;

    Thanks so much!

    jim_m_58 Yes, splitting it up is the next step, but I first wanted to have it at least remotely working :D