AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones específicas para móviles / Funciones de teléfono
  • Behavior when a notification is received
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Specifies the WLanguage procedure called when a push notification is received by a WINDEV Mobile application (Android or iOS).
Note This function must be called in the "Initialization" event of the project, as notifications can be received at any time during the life of the application, or when the application is launched following receipt of the notification.
Ejemplo
// Project initialization
NotifPushProcédure(callNotif)
PROCEDURE callNotif(MyNotif is Notification)
Info("Notification received: " + MyNotification.Message)
Sintaxis
NotifPushProcedure(<WLanguage procedure>)
<WLanguage procedure>: Procedure name
Name of the procedure that will be called when a push notification is received. This procedure must be a global procedure of application in the following format:
PROCEDURE <Procedure name>(<Notification> is Notification)
where <Notification> is a Notification variable corresponding to the notification sent by NotifPushSend.
Observaciones

Behavior when a notification is received

The behavior when a notification is received is as follows:
  1. If the application is closed, the system displays the notification in the notification bar. The user can choose to validate the notification. If he does, the application is started.
    Android If no message is specified in the notification, the application is started and the notification is not displayed.
    Two cases may occur once the application is started:
    • If NotifPushProcedure was called in the project initialization code, the global procedure passed to this function as parameter is called, and the first window of the application is not opened.
      Note: The OpenMobileWindow function must be called in the.
    • If NotifPushProcedure has not been called, the first window of the application is opened.
  2. If the application is already started:
    • Android If a message or a title is specified in the notification, the system displays the notification in the notification bar. If the user clicks the notification, the procedure specified in NotifPushProcedure is called (nothing happens if it is not specified).
      If no message and no title is specified in the notification, the notification is not displayed and the procedure is called directly.
    • iPhone/iPad There are two possible cases:
      • If the application is in the foreground, the procedure of NotifPushProcedure is called directly. If no procedure is specified, only an "ok" button is displayed.
      • If the application is in the background, the system displays the notification. If the user validates the notification, the application returns to the foreground and the procedure of NotifPushProcedure is called.
Remarks:
  • The exeLaunch constant of ExeInfo allows you to know if the application was automatically started by the system further to the reception of a push notification:
    ExeInfo(exeLaunch) = exePushNotification
  • WinStatus allows you to check (if necessary) the existence of a window in order to open it:
    // Summary: Procedure called during the click on a PUSH notification
    PROCEDURE onPush(MyNotif is Notification)
    
    IF WinStatus("WIN_Main") = NotFound THEN
    	// WIN_Main is already open or displayed
    	ReceivePushNotif(MyNotif, True)
    ELSE
    	// Open home window
    	OpenMobileWindow(WIN_Main, MyNotif)
    END
Componente: wd300android.aar
Versión mínima requerida
  • Versión 19
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local