LocalNotification QML Type

Triggers in-app notifications. More...

Import Statement: import ArcGIS.AppFramework.Notifications.Local 1.0

Properties

Signals

Methods

  • bool clear(object identifier)
  • clearAll()
  • object schedule(string title, string message)
  • object schedule(string title, string message, int timeInMilliSeconds)

Detailed Description

The LocalNotification plugin provides the ability to implement in-app notification to end users, including alerts, messages or geotification. When the notification is triggered on the client device, the notification icon appears in the notification bar. This notification icon is the same as the application's icon.

This code sample demonstrates usage of LocalNotification, scheduling a message to appear ten seconds after a button has been pressed.

Item {
        LocalNotification {
                id: notification
                onTriggered: {
                        console.log("Triggered ID: ", id)
                }
        }

        Button {
                anchors.horizontalCenter: parent.horizontalCenter
                text: "Schedule Notification"

                onClicked: {
                        console.log(notification.schedule("Message Title", "Message Contents", 10000))
                }
        }
}

Property Documentation

[read-only] supported : bool

Returns true if the device supports local notifications.


Signal Documentation

triggered(object id)

Signal emitted when the local notification is triggered.

Note: The corresponding handler is onTriggered.


Method Documentation

bool clear(object identifier)

Clears the pending notification defined by the object identifier from the list of scheduled notifications.

The identifier parameter

The ID of the notificatio to clear.


clearAll()

Clears all pending and active notifications from the app. For iOS apps, also clears badge numbers.


object schedule(string title, string message)

The title parameter

The message parameter


object schedule(string title, string message, int timeInMilliSeconds)

Schedules the notification with the defined title, message and time until appearing, and returns the object ID of the notification.

The title parameter

The title of the message as a string value.

The message parameter

The content of the message as a string value.

The timeInMilliSeconds parameter

Time after which the notification will appear on the device, in milliseconds.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.