simple repeating alerts

I know about the hourly notifications in the time settings but that doesn't seem to be configurable.  I want to be able to set up a simple alert every so often, like every half hour between 10am and 10pm for example.  Can I just use a background process to make these alerts?  Does it have to be tied to a watchface?  Can a watchface do this without using a background service?

Thanks!

Top Replies

All Replies

  • Have a look at the documentation of Toybox.Notifications. If you have a new device then this might work for you.

  • ok but does the notify run out of a background service or a watchface or both?

  • If I make this a widget or app does it have to be running in the forefront the whole time?  Or do I just add this to the watchface I wrote and use?  Like how do I run this "application" and keep the background service running and showing the notifications but show my regular watchface all the time?

  • I tried making the simplest app with "import Toybox.Notifications" but I get    "Cannot find module '$.Toybox.Notifications' in import statement."

  • ok but does the notify run out of a background service or a watchface or both?

    There's a sample app in SDK 8.1.0 called Notifications which demonstrates notifications being sent from either the foreground or background.

    In VS Code: CTRL-SHIFT-P / CMD-SHIFT-P  > "Monkey C: Open Samples Folder"

    I tried making the simplest app with "import Toybox.Notifications" but I get    "Cannot find module '$.Toybox.Notifications' in import statement."

    You need to build with the latest SDK (8.1.0) and add the Notifications permission to the manifest.

    The Notifications sample app should build and run fine. I tried it in both the sim and a real device (fr955).

    Note that this feature is only available on CIQ 5.1.0 - so devices older than the currently supported set that gets firmware feature updates are out of luck (e.g. nothing older than FR255/FR955, Fenix 7, Venu 3 and Vivoactive 5). Even some CIQ 5 devices are still stuck on CIQ 5.0.x, at least according to the device files downloaded by the SDK manager (connectiq/devices/[device id]/compiler.json). (Open compiler.json and look for connectIqVersion)

    If I make this a widget or app does it have to be running in the forefront the whole time?  Or do I just add this to the watchface I wrote and use?  Like how do I run this "application" and keep the background service running and showing the notifications but show my regular watchface all the time?

    If you opt to make the background process part of a separate device app (or device app with glance [*]) that's not the same as your watchface, then its background process should automatically run when you install the app. (I don't think you have to run the app once or anything like that.)

    You could also just add it to your watchface, if that makes sense for your use case / users.

    [*] starting with CIQ 4 there is no such thing as a CIQ widget. Any app with "widget" as its app type is built as a device app for CIQ 4+ devices, and the way to get these apps to show up in the glance list is to explicitly implement a glance view by overriding AppBase.getGlanceView(). This is relevant here bc Notifications are only available starting with CIQ version 5.1.0.

  • Awesome, very detailed answer.  Thank you!