Sends a notification to the notification bar when the mobile application is running in the foreground. If the application is closed or running in the background, no notification can be sent.
Usage example
-
Airlines:
Because of the weather effects and other force majeures, the airlines can send such warm notifications to inform passengers of the latest flight dynamics, so as to reassure them and reduce some troublesome cases.
-
Banking and finance:
The e-notification service is a very practical solution that allows quick and safe transmission of any personalized message via electronic mail or SMS. It is especially helpful as a form of automatic notification of, for example, change in account balance, issuance of an invoice, deadline for installment payment, etc. The client is provided with the latest information and always stays updated.
-
Healthcare:
Reminding patients of their dentist appointments is an important part of any dentistry which helps build and strengthen the relationship between patient and dentist. When patients receive those reminders, they are not only reminded of their appointment they are also made aware of the quality and care of the business.
Description
Sends a notification to the notification bar when the mobile application is running in the foreground. If the application is closed or running in the background, no notification can be sent.
Supported on mobile client only.
Syntax 1
notification
.of_addmessage
( value string as_message
)
Syntax 2
notification
.of_addmessage
( value string as_title
, value
string as_message
)
Argument Type |
Argument |
Description |
---|---|---|
eon_mobile_notificationex |
|
The name of the eon_mobile_notificationex object. |
string |
|
The title to be displayed on the notification bar. This parameter takes effect on the Android device only. On the iOS device, this parameter will be ignored, and the title is always the application name, which means if your app runs in Appeon Workspace, the title will be "AppeonMobile"; if your app is a native app packaged via the Appeon Developer Package tool, the title will be whatever specified in the App Name field when packaged. |
string |
|
The message to be displayed on the notification bar. |
Return value
Long.
>0 - Return the current notification handle if sending notification successfully. of_removemessage function can use this handle to delete the notification.
-1 - It is called in PowerBuilder or Appeon Web, or there is an error.
Code example
eon_mobile_notificationex ieon_notification integer ii_notification ieon_notification = CREATE eon_mobile_notificationex string ls_now ls_now = string (now(), 'HH:MM:SS') ii_notification = ieon_notification.of_addmessage ("Time", ls_now)
Note that the of_addmessage function will send a notification to the notification bar; and the notification will show on top of the screen when the end user swipe down from the top of the screen to trigger the Notification Center.
Description
Removes a notification from the notification bar.
Supported on mobile client only.
Syntax
notification
.of_removemessage
( value long al_handle
)
Argument Type |
Argument |
Description |
---|---|---|
eon_mobile_notificationex |
|
The name of the eon_mobile_notificationex object. |
long |
|
Specifies the handle of the notification, which is returned by the of_addmessage() function. |
Return value
Integer.
1 - Success.
-1 - It is called in PowerBuilder or Appeon Web, or there is an error.
Code example
eon_mobile_notificationex ieon_notification integer ii_notification ieon_notification = CREATE eon_mobile_notificationex string ls_now ls_now = string (now(), 'HH:MM:SS') ii_notification = ieon_notification.of_addmessage ("Time", ls_now) // add ieon_notification.of_removemessage (ii_notification) // remove
Do not use the of_removemessage function to remove the notification from the notification bar as soon as it is added, otherwise it will not show in the Notification Center. Instead, you should remove the notification from the Notification Center as needed.