Hi,
Is it only simulator? Or also real device?
I have a widget with glance view. Widget is periodically calling a background job to grab data. Once for couple of hours.
As we know - glance view has very limited memory (~28kB)
When having glance view active - and simulating background event - I have realised that -
- Background event is fired correctly in a separate memory - at least according to simulator
- onBackgroundData event is fired in context of glance view - therefore with above memory limitation (~28kB) - causing immediately in my case out of memory error (or to be precise - error without any message, yet by limiting amount of returned data just to one byte - finally I got error message, not only crash)
My question is - is onBackgroundData on real device also called (while in Glance View) in same memory context as GlanceView?
If so - definitely I have suspend background job - as it doesn't make sense... not sure how. Otherwise I can ignore that - as (at least in my case) it may happen very rarely, yet don't like such approach.
Different solution - to check available memory in 'onBacgrdoundData' and eventually skip processing data - if not enough memory.