- Overview
- Principle for sending a PUSH notification to an Android device from an external language
- Push notification by using the GCM platform
- Push notification by using the Firebase platform
- Header description
- Body description
- Description of the notification format: Correspondence of WLanguage Notification properties
- Description of the notification format: Correspondence of WLanguage notificationFormat properties
- Example of JSON document
- Principle for sending a PUSH notification to an iOS device from an external language
Push notifications: format of notifications (Android and iOS)
An application written in WINDEV Mobile Android or iOS can receive Push notifications. These Push notifications can be sent from: - A WINDEV application or a WEBDEV site by NotifPushSend.
- An application or a site written in an external language (Java, PHP, C#, etc.).
When sending a Push notification from an external language, you must identify and respect: Principle for sending a PUSH notification to an Android device from an external language Push notification by using the GCM platform This request must include: - a header.
- a body describing the notification to send.
CAUTION: From WINDEV Mobile 22 update 1, sending push notifications for Android is using the Firebase platform (instead of Google Cloud Messaging, GCM). The former projects can still continue to use the GCM solution but the new projects are necessarily using Firebase. WINDEV Mobile supports the push notifications via Firebase from version 22 Update 1. Push notification by using the Firebase platform This request must include: - a header.
- a body describing the notification to send.
CAUTION: From WINDEV Mobile 22 update 1, the new projects are necessarily using Firebase to send push notifications. Header description The header must contain at least the two following elements: - Content-Type:application/json
- Authorization:key=<GCM Identifier/Firebase>
<GCM Identifier/Firebase> corresponds to: Body description The request body must correspond to a document in JSON format containing: - The list of tokens representing the devices onto which the notification will be sent.
"registration_ids": [<id device 1>,...<id device N>]
- The version of data exchange format (mandatory).
"WX_PUSH_EXT_VERSION":"1.0"
- The notification data as key-value couples for each one of the Notification properties to assign. There is no need to provide the value of all Notification properties. The non-assigned properties will take their default value.
Remark: The current version of exchange format is "1.0". Description of the notification format: Correspondence of WLanguage Notification properties | | | Name of WLanguage property | Name of JSON key | Type of value |
---|
AdditionalAction | Not supported by the push notifications | | ActivateApplication | WX_PROP_ACTIVATEAPPLICATION | Boolean | DisplayLED | WX_PROP_DISPLAYLED | Boolean | Stopwatch | WX_PROP_CHRONOMETER | Boolean | Content | WX_PROP_CONTENT | Character string | ColorLED | WX_PROP_COLORLED | Integer | Format | WX_PROP_FORMAT | Character string in JSON format (see the table below) | LargeIcon | WX_PROP_LARGEICON | Character string | Icon | WX_PROP_ICON | Character string | Local | WX_PROP_LOCAL | Boolean | Message | WX_PROP_MESSAGE | Character string | SecondaryMessage | WX_PROP_SECONDARYMESSAGE | Character string | Priority | WX_PROP_PRIORITY | Integer | Sound | WX_PROP_SOUND | Character string | Deletable | WX_PROP_DELETABLE | Boolean | DropDownText | WX_PROP_DROPDOWNTEXT | Character string | Title | WX_PROP_TITLE | Character string | Vibration | WX_PROP_VIBRATION | Boolean |
Description of the notification format: Correspondence of WLanguage notificationFormat properties | | | Name of WLanguage property | Name of JSON key | Type of value |
---|
Content | WX_PROP_CONTENT | Character string | LargeIcon | WX_PROP_LARGEICON | Character string | Title | WX_PROP_TITLE | Character string | Type | WX_PROP_TYPE | Integer |
Example of JSON document Example of JSON document describing a push notification to send:
{ "registration_ids": ["Aki9 ... yXgt","BTh44 ... iQW)"], "data": { "WX_PUSH_EXT_VERSION":"1.0", "WX_PROP_TITLE":"Title of the notification", "WX_PROP_MESSAGE":"Message of the notification", "WX_PROP_ACTIVATEAPPLICATION":true, "WX_PROP_FORMAT": { "WX_PROP_TYPE":1, "WX_PROP_CONTENT":"Message of the notification\r\non two lines", } } }
Principle for sending a PUSH notification to an iOS device from an external language CAUTION : this format may change WITHOUT notice.To send a Push notification to an iOS device, you must: - Follow the procedure for payload creation on the Apple site: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/BinaryProviderAPI.html
- Provide a JSON in the following format.
{ "aps": { "alert": { "body": "Bob wants to play poker", "action-loc-key": "PLAY" "launch-image": "play.png" }, "badge": 5 "sound": "bingbong.aiff" }, "wd": "bar" }
Correspondence of WLanguage properties | | Name of JSON key | Name of WLanguage property |
---|
"body" | Message | "action-loc-key" | ActionLabel | "launch-image" | Icon | "sound" | Sound | "badge" | Badge | "wd" | Content |
|
|
|
|