notification-1.png

3rd-party developer-documentation and guidelines for UbuntuTouch-notifications

Work in progress

Rationale

The notification-system used on a unity7-based Ubuntu desktop is not ideal for devices such as smartphones and tablets running UbuntuTouch, which does not use the usual windowing-concept and are rather operated via touch than a mouse. Still there is the requirement for applications and services, running on these devices, to be able provide small pieces of information to the user or ask the user a simple yes/no-question outside the context of said applications or services. The new notification-system in unity8 does provide the needed functionality for UbuntuTouch.

Differences to desktop-notifications

The intentional differences of UbuntuTouch notifications when compared to the NotifyOSD-based desktop-notifications are - apart from their visual apperance - the lack of the click-through property and the missing fade-on-hover behaviour of notifications.

Use-cases

To give a better understanding of situations, when the use of a notification under UbuntuTouch is recommended, we provide a list of some typical use-cases.

Elements of a Notification

A notification consists of up to five different elements. Depending on which type of notification is meant to be displayed, each individual element has to be set explicitly.

notification-legend.png

Notification Types

There are three distinct types of notifications on UbuntuTouch. Ephemeral notifications, which are also found on the unity7-based desktop, interactive notifications and snap-decision notifications. The latter two notification-types are new and introduced first with UbuntuTouch.

Hints

The hint-system used by UbuntuTouch notifications covers two roles. Firstly it allows the notification-daemon to expose supported functionality to an application and secondly it is a means for the application to provide additional information about the notification to trigger to the daemon.

It is recommended practise to query the notification-daemon regarding a specific hint before using it. Do not just assume the support of a hint your going to use and do not write code that crashes, if a hint is not supported!

You might see source-code using hints starting with "x-canonical-private-...". These hints are reserved for system-only services, can change without prior notice and are not guaranteed to be supported for life-cycle of a LTS release. Do not write code based on those hints!

See the examples below for how to use these individual hints.

Code-Examples/Videos

Like the desktop-notifications UbuntuTouch-notifications uses libnotify to trigger a notification. Thus notifications can be triggered from any language a libnotify-binding exists for. The most popular are the C/C++- and Python-bindings. QML-bindings do not exist yet. The notification-daemon, which receives and handles all notifications, will allow only one notification per application in queue at a time. Should an application try to trigger another notification, if it still has one in the queue, it will be rejected and not added to the queue.

Touch/Notifications (last edited 2014-02-28 16:55:58 by dslb-088-076-058-144)