Hello,
I'm working on a watch face and I want to do something when a goal event is reached. The goal events can be step goal, floors climbed goal and active minute goal.
First of all, I'm using getGoalView() to create a custom view. As far as I understand this will only fire when the watch face is running but not while another app is running, correct?
I'm doing it like in the Analog sample:
function getGoalView(goal as GoalType) as [View]? { return [new $.WatchFaceGoalView(goal)]; }
Then I have my WatchFaceGoalView where I have my custom goal view. This works.
However, I have tested this in the simulator and I've noticed, that the memory keeps increasing each time a goal event is triggered. My guess is that's because getGoalView() keeps returning a new WatchFaceGoalView and the old one is not destroyed? I have also noticed the memory increase in the Analog sample. For watches that have not a lot memory this can lead to an out of memory crash quite fast. Is there something I could do differently here?
The second question is related to the Background services, also regarding goal events. I understand that you can register for the goal events. Which I would do for the 3 different goal types I want. Then I can overwrite onGoalReached() to do what I want. However I have to pass one goal type here. How would I go about it if I want to check for 3 different goal types?
Thanks for any kind of help or hints, I appreciate it!