New notifications api

What is the new Notification for?

https://forums.garmin.com/developer/connect-iq/b/news-announcements/posts/connect-iq-sdk-8-1-0-now-available 

In the announcement background is mentioned, but in the doct it's not.

It's not clear who's sending the notifications to who.

I guess it's only between the background and foreground app of the same app?

Also in the docs there's nothing to explain what this means in terms of how often it can be used, how long after sending a notification in the background it will be delivered?

What can the foreground app do in the callback?

Top Replies

All Replies

  • I've not checked it yet, but without alerts (sound or/same vibrations) it isn't too useful.

  • I've not checked it yet, but without alerts (sound or/same vibrations) it isn't too useful.

    I just tried the Notifications sample on a real device (fr955).

    - there's no sound or vibes

    - the native notifications system is not used (CIQ notifications don't appear in the notifications glance)

    - user can't go back and see old CIQ notifications

    - sendNotification() has the following option:

    :dismissPrevious — (Lang.Boolean) —

    If true, dismiss all prior notifications that the app has posted. Note that this defaults to true if not provided.

    This implies that there is some sort of notification queue for each app (for notifications which have not yet been viewed). However, I don't think there is a way for the user to manage this queue (although I haven't tested sending multiple notifications yet.)

    - notifications can indeed be sent from either the foreground process or the background process (haven't tried sending a notification from a device app that's "running in the background", as I would have to create or modify a different app to do that)

    - background notifications are delivered immediately

    - a CIQ notification takes up the entire screen and looks similar to a native notification, although CIQ notifications only support an icon + text (no images)

    - when a notification is displayed, there's a little animation where the icon and the title pop up from the bottom of the screen, displayed in a large size so they initially take up the entire screen. A split second later, the icon and title shrink and move up, as the body text pops up from the bottom of the screen

    - I don't know if this is a bug, but the subtitle is not displayed at all

    - if the body text is too large to fit in the screen, the notification can be scrolled

    - if you press the START button, an action menu pops up with all the actions specified in sendNotification(), as well as a generic Dismiss action

    - pressing BACK or swiping left dismisses the notification

    - enabling do not disturb mode does not prevent foreground notifications from being shown (idk about background notifications)

    - there doesn't seem to be a limit on how often foreground notifications can be triggered. (then again, I only tested by triggering them via user action - a button press. It's possible that CIQ is smart about this and rate limits notifications that are triggered without user intervention, idk.)

    Maybe some of these things will change in the future, idk

  • - there's no sound or vibes

    I have sound and vibe on a real device (Epix2pro51)

  • Interesting - I don't have sound or vibes on my real fr955. Maybe one of those weird differences between devices

  • Check DND-mode and sleep mode.
    But I suspect that sleep mode disallows background notifications

  • I'm 100% sure DND wasn't enabled because I subsequently turned it on to see if it would block notifications (it def doesn't block notifications from the foreground).

    And I'm sure sleep mode wasn't on because I tested outside of sleep hours, and because if sleep mode was on, DND would also be on, unless manually disabled.

    I'm also sure sounds and vibes were enabled in system settings as I explicitly checked the settings before I tested notifications.

    Anyway, maybe I'll try again some other time.