|
|
|
|
|
- WLanguage procedure called
- Special cases
NotifPushEnable (Function) Enables the management of push notifications in a WINDEV Mobile application (Android or iOS).
NotifPushEnable(EnregistreNotifPush)
PROCEDURE EnregistreNotifPush(Token is Buffer, ErreurNotif is string)
IF Length(Token) > 0 THEN
EnvoieIDSurServeur(Token)
ELSE
END
Sintaxis
NotifPushEnable(<WLanguage procedure> [, <Options>])
<WLanguage procedure>: Procedure name Name of the WLanguage procedure called when the application receives the registration identifier from the notification service. <Options>: Combination of optional Integer constants Registration options. Can correspond to one or more of the following constants: | | notifPushAlertType | The mobile application will accept the push notifications in alert format. | notifPushAllNotif (Default value) | The mobile application will accept all types of push notifications. | notifPushBadgeType | The mobile application will accept the push notifications in badge format. | notifPushSoundType | The mobile application will accept the sound push notifications. |
Please note: These options are taken into account the first time the application is installed.. Then, the user can modify the notifications accepted in the Notification Center of device. Observaciones WLanguage procedure called The WLanguage procedure called by NotifPushEnable must have the following syntax: PROCEDURE EnregistreNotifPush(<Identifiant> est un Buffer, <Erreur> est une chaîne) This procedure is called when the registration toward the notification service is ended. The parameters of this procedure are as follows: - <Identifiant>: Buffer "token" corresponding to the registration identifier returned by the notification service. This buffer must be transmitted to the application server so that push notifications can be sent to the application.
Attention: This buffer must be transmitted to the application server:- when its value changed in relation to the previous execution of the application. To do so, its value must be stored in a data file of the application or in a buffer on disk created by fSaveBuffer or SaveParameter.
- if the application is started by the user (and not by the arrival of a push notification). ExeInfo determines whether the application is started when a notification is received.
This buffer can be empty if a registration error occurred during the registration request. In this case, the <Error> parameter will be filled with the error message.
The buffer that corresponds to the identifier can contain non-printable characters (e.g., binary zeros). To send this buffer to a third-party application (to send notifications, for example), it may be necessary to convert this buffer into hexadecimal (BufferToHexa) or Base64 (Encode) depending on the format expected by the application. If the application that retrieves the data is a WINDEV/WEBDEV/WINDEV Mobile application, you will need to perform the reverse conversion (HexaToBuffer or Decode) to be able to send the notifications. - <Erreur>: Character string describing a registration error. This parameter is filled only if an error occurred during the registration request.
Clasificación Lógica de negocio / UI: Lógica de negocio Componente: wd300android.jar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|