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:

Notification settings

Object "uwp" can contain 2 properties:

  1. 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

  2. The property that describes additional parameters of a message is represented by the object “options”. Optional.

Toast-notification content ("toast" object properties):

Example

{
    "user_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "campaign_tag": "campaign name",
    "pack_id": "uniqueid1234",
    "audience": [{
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "advertisingId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "serialId": "xxxxxxxxx",
        "customUid": "xxxxxxxxxxxx"
    }],
    "uwp": {
        "toast": {
            "scenario": "default",
            "title": "Notification title",
            "text": "First notification string",
            "text2": "Second notification string",
            "data": {
                "key1": "value",
                "key2": "value"
            },
            "icon": "https://domain.com/pic.png",
            "image": ["https://domain.com/pic.png", ""],
            "sound": "Default",
            "action": {
                "url": "http://www.domain.com"
            },
            "interactive": {
                "buttons": [{
                    "id": "accept",
                    "text": "Accept",
                    "handling": "foreground",
                    "action": {
                        "url": "http://www.domain.com/accept"
                    }
                }, {
                    "id": "decline",
                    "text": "Decline",
                    "handling": "background"
                }]
            }
        },
        "options": {
            "expire": 3600
        }
    }
}

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:

Example

{
    "user_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "campaign_tag": "campaign name",
    "pack_id": "uniqueid1234",
    "audience": [{
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "advertisingId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "serialId": "xxxxxxxxx",
        "customUid": "xxxxxxxxxxxx"
    }],
    "uwp": {
        "tile": {
            "medium": {
                "content": [{
                    "text": "First sting",
                    "wrap": "true",
                    "style": "base",
                    "align": "center"
                }, {
                    "image": "https://domain.com/pic.png",
                    "remove_margin": "true",
                    "align": "center",
                    "crop": "circle",
                    "placement": "background"
                }],
                "v_align": "center",
                "overlay": "60",
                "branding": {
                    "type": "none"
                }
            },
            "wide": {
                "content": [{
                    "text": "First string",
                    "wrap": "true",
                    "style": "base",
                    "h_align": "center"
                }, {
                    "image": "Assets\\Apps\\Weather\\MostlyCloudy.png",
                    "remove_margin": "true",
                    "align": "center",
                    "crop": "circle",
                    "placement": "background"
                }],
                "v_align": "center",
                "branding": {
                    "type": "nameAndLogo",
                    "display_name": "brandname"
                }
            }
        },
        "options": {
            "expire": 3600
        }
    }
}

Hidden notification ("raw" object properties):

Example

{
    "user_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "campaign_tag": "campaign name",
    "pack_id": "uniqueid1234",
    "audience": [{
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "advertisingId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "serialId": "xxxxxxxxx",
        "customUid": "xxxxxxxxxxxx"
    }],
    "uwp": {
        "raw": {
            "data": {
                "key1": "value",
                "key2": "value"
            },
            "badge": "+1"
        }
    }
}

Badge ("badge" object properties):

Example

{
    "user_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "campaign_tag": "campaign name",
    "pack_id": "uniqueid1234",
    "audience": [{
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "advertisingId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "serialId": "xxxxxxxxx",
        "customUid": "xxxxxxxxxxxx"
    }],
    "uwp": {
        "badge": {
            "badge": "99"
        }
    }
}

Last updated