Tutorial: notification.constructor


A notification represents a window in the OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. A notification is typically used to alert the user of some important event which requires his or her attention.

Multiple notifications can be generated at once but will queue if more than 5 are already displayed. Notifications can be dismissed by dragging them to the right with the mouse and can communicate securely with their invoking applications.

The first argument is a Notification Options object (see).


In the invoking Application:

var notification = new fin.desktop.Notification({
    url: "notification.html",
    message: "some initial message",
    onClick: function () {
    onClose: function () {
    onDismiss: function () {
    onError: function (reason) {
        console.log("error: " + reason);
    onMessage: function (message) {
        console.log("message: ", message);
    onShow: function () {
}, function () {
    console.log("Notification successfully created");  
}, function (error) {
    console.log("Error creating notification:", error);

In notification.html:

<!DOCTYPE html>
    <script type="text/javascript">
        fin.desktop.main(function () {
            var self = fin.desktop.Notification.getCurrent();

            self.sendMessageToApplication("some message");

        // messages received from the application creating the application
        function onNotificationMessage(message) {