Huawei Push Notifications

General Structure

When sending messages to huawei we’re following the structure defined by the Huawei Push Kit API.

Title & body

Even though the huawei notification data structure has a specific notification-object for the title and the body they are put directly into the custom data json-string since the notification itself is anyway rendered by the Emarsys SDK.

Note: The data property inside the message must be a string and will therefor be encoded as a json-string.

Custom Data

Campaign root params

A push-campaign may specify so called root params which are platform specific, but do note that android-huawei devices will share the android root-params. These parameters will be available directly in the root of the custom data object. The structure of the params are not validated and can be anything.

Root Params

{
  "foo": "bar"
}

Result

{
  "message": {
    "data": '{"ems_msg": true, "title":"hello","body":"this is the body","foo":"bar"}'
  }
}

The "ems" object

Usually Mobile Engage specific data is put in the "ems" object. The exact possibilities of this structure is not well document but some examples can be found at the Rich Push Documentation in confluence.

For huawei notifications this object is located in the custom data section. See example below.

{
  "message": {
    "data": '{"ems_msg": true, "title":"hello","body":"this is the body","ems":{"inapp":{"campaign_id":"222","url":"https://www.wikipedia.org/"}}}'
  }
}

Properties

  • multichannelId - the external campaign id of the campaign.

  • silent - when true no notification will be shown to the user.

  • notificationMethod - object containing collapseId and optional operation that can be UPDATE, DELETE or INIT and is defaulting to INIT.

The "u" object

Directly in the custom data object an object called "u" might be available. It will contain the sid of the campaign.

  • sid