Windows UWP
devtodev Push API supports two different formats of notification sending to Windows operational systems:
UWP format described in this section can be used only for Windows 10 and Windows Phone 10. It is described by the "uwp" object.
The universal format works on a basis of Legacy tiles and toast schema. It can be used for Windows Phone 8.1, Windows Phone 10, Windows 8.1, Windows 10. It is described by the "windows" object.
Use this object (“uwp”) if your clients are users of OS Windows 10 and Windows Phone 10 only. With the help of this method it is possible to realize more opportunities offered by Windows 10.
User identifiers
In order to find an addressee to whom you need to send a notification, it is possible to specify one or several available identifiers:
Property | Type | Description |
token | string | Push token. If you use push token, all fields with other identifiers will be ignored! |
advertisingId | string | Advertising ID |
serialId | string | Hardware serial number |
userId | string | User id is applicable if an internal identifier (cross-platform user identifier) is used in your app. |
devtodevId | number | Numeric user identifier in devtodev database. |
Notification settings
Object "uwp" can contain 2 properties:
The property that describes a message can be represented by one of 4 possible objects: - toast (object) - the result of sending is the delivery of toast-notification - raw (object) - sends a hidden toast-notification - tile (object) - changes the tile content of an app - badge (object) - changes the value of a badge field displayed on a tile
The property that describes additional parameters of a message is represented by the object “options”. Optional.
Toast-notification content ("toast" object properties):
Property | Type | Description |
scenario | string | Optional. Available values: "default", "alarm", "reminder", "incomingCall". Default value is "default". You do not need this unless your scenario is to pop an alarm, reminder, or incoming call. Do not use this just for keeping your notification persistent on screen. |
title | string | Required. A short string describing the purpose of a notification. |
text | string | Required. Main text of a notification. |
text2 | string | Optional. Additional text of a notification. |
data | object | Optional if notification is not hidden. You can pass custom parameters with messages and use them within an app. For instance, you can activate advertising campaign or any other functionality for user who has received this message. Example:
|
icon | string | Optional. To replace the application icon (that shows up on the top left corner of the toast) use the URL or the resource name. In Windows 10 the image is expressed using the URI of the image source, using one of these protocol handlers:
|
image | string | Optional. Image inside the toast body, below the text. Use the URL or the resource name. |
sound | string | Optional. The media file to play in place of the default sound. If the option is not used, the notification comes silently. This property can have one of the following string values:
On mobile platform this property can also contain the path to a local audio file with one of the following prefixes:
|
action | object | Optional. Action after a click on the body of a notification. By default, a click simply opens an app. It is also possible to perform the following actions:
Examples:
|
interactive | object | Optional. It is possible to specify an array of notification buttons in the “interactive” object. Each button must contain the following properties:
Example:
|
Example
Tile ("tile" object properties)
In UWP format every of tile’s size must be described separately, therefore, the object “tile” can contain up to 4 properties:
small
medium
wide
large (only for desktop)
Each of these sizes is described by an object with the following properties:
Property | Type | Description |
content | array | As long as tile’s content is dynamic, it is described by an array, the elements of which can be objects describing either text strings or illustrations. Text element object properties:
Image element object properties
Group element object properties
Subgroup element object (used inside groups only)
|
branding | object | You can control the branding on the bottom of a live tile (the display name and corner logo) by using this property. Branding object properties:
|
v_align | string | You can control the vertical alignment of content on your tile by using this property. By default, everything is vertically aligned to the "top", but you can also align content to the "bottom" or "center". |
overlay | number | Optional. You can set a black overlay on your background image using this property, which accepts integers from 0-100 with 0 being no overlay and 100 being full black overlay. If you don't specify an overlay, the background image opacity defaults to 20% and the peek image opacity defaults to 0%. |
Example
Hidden notification ("raw" object properties):
Property | Type | Description |
data | object | Required. You can pass custom parameters with messages and use them within an app. For instance, you can activate advertising campaign or any other functionality for user who has received this message. Example:
|
badge | string | Optional. A number from 1 to 99. A value of 0 is equivalent to the glyph value "none" and will clear a badge. Instead of a number, a badge can display one of a non-extensible set of status glyphs:
It is also possible to send values incrementing or decrementing the current value in a “+2”, “-1” format. In case the previous value was the glyph or 0, the value will be increment. Decrement does not influence the zero value and the glyph. |
Example
Badge ("badge" object properties):
Property | Type | Description |
badge | string | A number from 1 to 99. A value of 0 is equivalent to the glyph value "none" and will clear a badge. Instead of a number a badge can display one of a non-extensible set of status glyphs:
|
Example
Last updated