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 y constantes de las API de Windows
Sends a push notification to a mobile device (iOS or Android). This function can be used in a WINDEV application or in a WEBDEV website.
Ejemplo
// Envoi d'une notification push sur iOS
TokensEnvoi is array of Buffers
MonMotDePasse is string ANSI = "Password"
FOR i = 1 TO nbTokens
	TokensEnvoi.Ajoute(tokens[i])
END 
MaNotification is Notification
MaNotification.Message = "Nouvelle notification"
MonRésultat is boolean 
MonRésultat = MaNotification.EnvoiePush(TokensEnvoi, "certifapple.cer", MonMotDePasse, NomBundleID, typeServiceIOSRelease)
IF MonRésultat = False THEN Trace(ErrorInfo())
Sintaxis

iPhone/iPad: Envío de una Notification Ocultar los detalles

<Result> = <Notification>.SendPush(<Tokens> , <Identification> , <Password> , <TopicID> , <Server type>)
<Result>: booleano
  • True if the sending was successful,
  • False otherwise. ErrorInfo is used to identify the error returned by the notification service.
<Notification>: Variable de tipo Notification
Name of the Notification variable corresponding to the notification to send.
<Tokens>: Array de los amortiguadores
Name of Array variable containing the list of tokens representing the devices onto which the notification will be sent.
<Identification>: Cadena de caracteres
Full path of the file containing the certificate for the application push notifications (obtained from Apple). For more details, see Conditions required for the Push notifications in iOS.
<Password>: Cadena de caracteres ANSI
Password of the file containing the certificate for Push notifications. If the file does not have a password, use an empty string (""). This parameter must correspond to an ANSI character string.
<TopicID>: Cadena de caracteres
Bundle identifier specified in the "General" section of the Xcode project generation wizard.
<Server type>: Constante de tipo Integer
Type of server onto which the notification will be sent:
typeServiceIOSReleaseServer of IOS release (APN).
typeServiceIOSTestServer of IOS test (APN).

Android: Enviando un Notification Ocultar los detalles

<Result> = <Notification>.SendPush(<Tokens> , <Identification> , <Invalid tokens> [, <Platform>])
<Result>: booleano
  • True if the sending was successful,
  • False otherwise. ErrorInfo is used to identify the error returned by the notification service. These errors can contain a list of invalid tokens that must be deleted from the token database.
<Notification>: Variable de tipo Notification
Name of the Notification variable corresponding to the notification to send.
<Tokens>: Array de los amortiguadores
Name of the Array variable containing the list of tokens representing the devices to which the notification will be sent.
<Identification>: Cadena de caracteres
Application ID parameter:
<Invalid tokens>: Array de los amortiguadores
Name of the Array of Buffers variable. This parameter is filled with the list of invalid tokens returned by the server.
<Platform>: Constante opcional de tipo Integer
Platform that will be used to send the notification. The Android application that will receive he notifications must have been configured for this type of platform.
npeFirebaseFirebase platform using the Cloud Messaging API.
Push notification platform available in WINDEV 22 Update 1. This platform is available:
  • for existing Firebase projects that already use this solution.
  • for new Firebase projects, if this API is enabled.
npeFirebaseCM_v1Firebase platform using the Firebase Cloud Messaging API (V1).
New push notification platform enabled by default for new Firebase projects.
Starting with WINDEV 28 Update 2, this platform must be used for projects using the Firebase Cloud Messaging API (V1).
npeGCM
(Default value)
Google Cloud Messaging platform.
Former Google solution for sending push notifications.
This platform should only be used for existing projects already using push notifications (projects created with versions earlier than WINDEV 22 Update 1)
Observaciones
  • The push notification is sent to a notification service (Apple or Google) that redistributes this notification to a set of mobile devices.
  • The supported services are:
    • Google Firebase (Google GCM is supported for backward compatibility. Firebase is recommended by Google).
      • Firebase Cloud Messaging API (V1)
      • Cloud Messaging API
    • Apple APN.
  • The notifications sent to the Android devices take into account the proxy defined by Proxy.
  • Starting with Android 8, notifications sent to Android devices take into account the notification category (also called "Channel").
  • Specific features for iOS:
    • The notifications sent to the devices running iOS are direct (they do not transit via the proxy).
    • The Apple service allows 256 bytes of data per notification only. Therefore, pay attention to the amount of data sent in the Notification variable (the message for example) to avoid exceeding this limit. An error will occur if the limit is exceeded.
    • The connection to the APN server may fail if two notifications are sent in a very short time interval (if the server is still processing the first message).
    • To send push notifications on the iOS devices, the application must be able to access the ports 2195 and 2196 in TCP.
Componente: wd290device.dll
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2024

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