System Notifications

System notifications allow you to generate local system notifications from within a Digitise app providing alerts and reminders to users of the app. These notifications are registered locally on the user's device and only display the notification message on the device on which they are registered; they don't affect other users or devices.

System notifications are configured using the AddSystemNotification Scripting Method, which registers the notification with the device's operating system notification facility. The parameters to this Method include a message to be displayed, the date and time to display it, a repeat interval and a unique 'tag' identifying the notification.

System notifications are supported on all Platforms. On the Android, iOS and Windows Universal Platforms, notifications operate independently of the Digitise Apps Client and hence operate even when a Client or Standalone App is not loaded. On the Windows Desktop Platform notifications require the Digitise Apps Client or Standalone App to be running.

  • On the Apple Platform, if you want to use system notifications within a Standalone App or pre-configured Digitise Apps Client, you will need to enable system notification support in the build request for the app or Client. To do this you need to set the Enable Notifications option to Yes under the Settings tab in the Build request dialog box in App Studio.
  • If you include system notification support, users will be asked to grant permission to the app or Client to receive notifications, the first time they run the app or Client on a device. Users can subsequently configure and enable/disable notifications on a per-app basis within the device's Settings.

 

Once registered, when the start date and time occurs, the notification will display the specified message on the device in the device's standard notification area and in the standard manner for the device. The user can acknowledge or ignore the notification just as they do for any other notifications displayed.

If the user acknowledges the notification, for example by tapping or clicking on the notification, the Digitise Apps Client will be brought to the foreground. On Android, Apple and Windows Universal Platforms if the Client isn't already running, it will be loaded. The Client will then bring the Digitise app which registered the notification to the foreground or load it. The Client will prompt the user to log in if the app requires it. Remember that on Windows desktops and tablets running the Windows Desktop version of the Client, notifications only work whilst the Client is running.

  • On iOS devices, if the Digitise app which registers the notification is in the foreground when the notification occurs, the notification will be displayed by the Digitise Apps Client rather than appearing in the notification centre.

Once the Client and app have been brought into the foreground, the OnSystemNotification Event will be triggered and if a Script has been assigned to that Event, that Script will run. The Event will be passed the 'tag' you assigned to the notification when it was registered. This is automatically stored in a predefined variable, Tag, which can be accessed throughout the Script assigned to this Event. There is only one OnSystemNotification Event which is shared between all notifications - both push and system. This means that you can only assign one Script to the Event, which therefore has to cover any required actions for all notifications the app might receive. The tag value, therefore, can be used to identify a notification throughout your Script, and thus can be used to isolate those parts of the Script which relate to individual notifications.

The OnSystemNotification Event is an application-level Event, which can be accessed in App Studio from the Project Properties.

  • If the app which registered the notification is a secondary app, i.e. it is launched from within another app, when the notification is triggered the secondary app will only be brought to the foreground if it is already running. If it is no longer running, the main primary app will be loaded or brought to the foreground instead and the OnSystemNotification Event in this app will be triggered.

If a repeat interval is specified, the notification will continue to be redisplayed at the specified interval.

 

You can change the default behaviour described here to some extent when you configure the notification in the call to AddSystemNotification, including specifying a sound to be played when the notification displays - see the description of the AddSystemNotification Method for full details.

 

You can cancel a pending notification using the RemoveSystemNotification Scripting Method. This Method requires the tag value specified in the original AddSystemNotification call used to create the notification.

If you don't cancel a notification and the Digitise app which registered the notification is uninstalled, when the notification occurs or the next time it repeats, a message will be displayed within the Digitise Apps Client explaining that the app can't be found and the notification will be cancelled. Re-installing the app may restart this notification, except on the Windows Desktop Platform when closing the Client cancels any outstanding notifications registered from apps running within that Client session.

If you forget the tag used for a particular notification, you can display it in a message from within the OnSystemNotification Event using the Tag variable to obtain the tag value.