ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Mobile specific functions / Phone functions
  • Properties specific to notificationAction variables
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
notificationAction (Variable type)
In french: notificationAction
The notifications (described by a Notification variable) have a default action that is run when the notification is clicked by the user. This action is defined by the ActionClick property of type Notification.
It is possible to associate additional actions with a notification (property AdditionalAction).. These actions appear in the form of texts below the notification message.
Remarks:
  • When the notification is displayed on a connected object like a watch (Android Wear), the additional actions can be accessed via a swipe movement to the left on the screen.
    In this case, each additional action is displayed on the entire screen.
  • On a phone or tablet, the buttons corresponding to the additional actions are visible only when the notification is expanded. The displayed notifications are automatically collapsed or expanded by the system according to the available space in the list. However, the user has the ability to collapse or expand a notification by performing a swipe gesture to the top (collapse) or to the bottom (expand) with two fingers.
  • The additional actions will be ignored if the notification is displayed on a device running a version earlier than Android 4.1.
  • Depending on the system and device used, the notification display may vary.
The notificationAction type is used to define the advanced characteristics of an additional action associated with a notification. The characteristics of this additional action can be defined and modified using various WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
n is Notification
n.Title = "Nouveau message"
n.Message = "Commande n°54781-4551"
n.SecondaryMessage = "client@societe.com"
n.LargeIcon = "enveloppe.png"
n.AdditionalAction[1].LibelléAction = "Répondre"
n.AdditionalAction[1].Icone = "repondre.png"
n.AdditionalAction[1].ActionClic = "procRepondre"
n.AdditionalAction[2].LibelléAction = "Supprimer"
n.AdditionalAction[2].Icone = "supprimer.png"
n.AdditionalAction[2].ActionClic = "procSupprimer"
NotifAdd(n)
// Notification avec demande de réponse pour les objets connectés
n is Notification
n.Title = "Nouveau message"
n.Message = "Commande n°54781-4551"
n.SecondaryMessage = "client@societe.com"
n.LargeIcon = "enveloppe.png"
n.AdditionalAction[1].LibelléAction = "Répondre"
n.AdditionalAction[1].Icone = "repondre.png"
n.AdditionalAction[1].ActionClic = "procRepondre"
n.AdditionalAction[1].ChoixRéponse = notifFreeResponse + CR + "Merci pour votre commande"
n.AdditionalAction[1].LibelléQuestion = "Quelle est votre réponse ?"
n.AdditionalAction[2].LibelléAction = "Supprimer"
n.AdditionalAction[2].Icone = "supprimer.png"
n.AdditionalAction[2].ActionClic = "procSupprimer"
NotifAdd(n)
PROCEDURE procRépondre(n is Notification, sReponse is string)
Email.Subject = "RE : " + n.Message
Email.Recipient[1] = n.SecondaryMessage
Email.NbRecipient = 1
IF sReponse <> "" THEN
	Email.Message = sReponse
END
EmailRunApp()
Properties

Properties specific to notificationAction variables

The following properties can be used to handle an additional action:
Property nameType usedEffect
ActionClickValue or Name of procedureName of WLanguage procedure called when the user clicks the button corresponding to the action.
This procedure has the following format:
PROCEDURE <Nom de la procédure> (<Notification>, <Réponse>)
where:
  • <Notification> is a Notification variable corresponding to the notification associated with the selected action.
    If the WLanguage procedure returns True or if it returns no value, the notification will be automatically deleted from the system bar.
    If the procedure returns False, the notification will still be displayed.
    If the value of the ActionClick property is set to an empty string (""), there will be no on-click action and the notification will be automatically deleted afterwards.
  • <Response> is a character string filled with the response given by the user if the following conditions are fulfilled:
    • the action was run from a connnected object,
    • the ResponseChoice property was specified.
      Otherwise, <Response> is equal to an empty string ("").
Note: It is advisable to use global procedures. If the procedure is a local procedure, the name of this procedure must be prefixed by the full name of object to which the procedure belongs. For example, for a local window procedure: "FEN_Fenêtre1.MaProcedure".
ActionLabelCharacter stringCaption describing the action to perform. This property is mandatory: the action will be ignored if no label is associated with it.
IconCharacter stringPath of the icon representing the action.
As of Android 7.0, this property is no longer used: notification action icons are no longer displayed..
QuestionLabelCharacter stringText of the message displayed to ask for the user response. This text is used when the ResponseChoice property has been specified.
A system message will be displayed if this property is not filled.
ResponseChoiceCharacter stringCorresponds to the different preset responses that will be proposed to the user during the click on the action. The responses must be separated by a Carriage Return (CR).
To allow the user to enter a free response, use the notifFreeResponse constant. This constant can be combined with one or more preset responses.
Note: The choice of answers is only available to the user when the action is executed from a connected object running Android Wear.. If the action is executed from a phone or tablet, the procedure specified in the ActionClick property will be called directly.
Remarks

Miscellaneous

You can use VariableReset to reset the content of the notificationAction variable
Minimum version required
  • Version 20
Comments
Notificationdisplay
Se for para o Windev veja esse exemplo:

https://repository.windev.com/resource.awp?file_id=281474976710849;notificationdisplay
BOLLER
30 Aug. 2019

Last update: 09/20/2024

Send a report | Local help