Xulo Docs

Concepts

Notifications

What a push carries, how languages are picked, how images and links work, and the payload your app receives.

A push has a message, and can have a title, translations, an image, a link, a data dictionary and one button.

Content

Part Notes
Message Required. Up to 2,000 characters.
Title Optional. Up to 120 characters. An empty title is left out of the alert.
Languages A message and title per language code, such as en or tr.
Image An https address. The Notification Service extension downloads it.
Link An https address or an address your app handles, such as exampleapp://offer/1.
Data A dictionary of text values your app reads when the push is opened.
Button One button with an id and a text.

The whole Apple payload must fit in 4KB. A larger push is refused, not cut short.

Languages

Each install reports its device language. When a send has several languages, an install gets the language that matches its own, either exactly or by prefix, so tr goes to a tr-TR device. An install with no match gets the default language.

From the REST API the default is en when contents has it, otherwise the first language in contents.

Images

An image needs the Notification Service extension. The extension downloads the image and attaches it to the notification. If the download fails, or time runs out, the text still arrives. See Rich push.

When the person taps the push, the SDK hands the link and the data to your app through Xulo.onOpen. If your app opens the link itself, the SDK does nothing more. If not, an https link opens in the system browser. The SDK does not open a web view. See Deep links.

When the app is open

From SDK 0.1.3, a push that arrives while the app is in the foreground shows as a system banner. If your app sets its own notification center delegate and implements willPresent, your choice is used instead.

The payload

This is the shape your app receives. custom.a holds your data plus draft_id, the id of the send. custom.u is the link.

JSON
{
  "aps": {
    "alert": { "title": "Your order shipped", "body": "It arrives tomorrow." },
    "sound": "default",
    "category": "xulo",
    "mutable-content": 1
  },
  "custom": {
    "a": { "screen": "order", "draft_id": 42 },
    "u": "exampleapp://orders/1"
  },
  "att": { "id": "https://example.com/parcel.jpg" },
  "xulo": { "draft_id": 42 }
}

mutable-content and att are present only when the push has an image. A push with a button also carries a buttons list with that one button.

Delivery

A push goes out through the app's own Apple key or certificate. Each install is sent through Apple's sandbox or production gate, whichever its build reported. See Sandbox and production. See Delivery and analytics for what is counted.