Hello All,
Task to accomplish : I am trying to write a widget with a glance view for a Fenix 6 watch(as a hobby). To enable or disable the widget, the menu can be accessed by the glance in the simulator. Once enabled in the menu I would like the app to send a pop message or just sound at a predefined interval even if the widget is closed.
My Research : I have looked at the Attention, background and ServiceDelegate module but I'm unable to set something that can run in background and alert at an interval.
Question: On enabling the widget in menu (AppMenuDelegate,mc), If I register for a temporal event with registerForTemporalEvent method for an interval, how do I tell it to send a pop up message or make a sound with Attention module, even if we have closed the widget menu after enabling the widget.
var toggleItem = item as WatchUi.ToggleMenuItem; if (toggleItem.isEnabled() == true){ Storage.setValue("appState", "Enabled"); var everyTenMins = new Time.Duration(5 * 60); Background.registerForTemporalEvent(everyTenMins); // how do i get a pop up message/alert/sound? }
Any guidance is appreciated.
Thanks