Notify me!
One of the most common ways of attracting a mobile device user to a particular app is to display a notification. When a new email arrives or a friend posts something on social media, we are typically alerted with a notification. Clicking on it displays the app that sent the notification.
Delphi provides a TNotificationCenter
component that can be used to display and react to notifications. A very common use case is displaying a number next to the app icon for the count of new notifications. This can also be used for unread emails and missed calls:
- Create a new, blank, multi-device app. Save the main form as
uFormNotify
and the project asNotifyMe
. - Add a toolbar with a label aligned to
Client
with text readingDelphi Notifications
. - Now drop a
TNotificationCenter
component on the form. As a side effect, theSystem.Notification
unit will be added to the form’s uses clause. - The first class defined in this unit is
TNotification
, which is used as...