Triggers in-app notifications. More...
Import Statement: | import ArcGIS.AppFramework.Notifications.Local 1.0 |
Properties
- supported : bool
Signals
- triggered(object id)
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
Signal Documentation
Signal emitted when the local notification is triggered.
Note: The corresponding handler is onTriggered
.
Method Documentation
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.
Clears all pending and active notifications from the app. For iOS apps, also clears badge numbers.
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.