Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Clicks Tracking

Method Objective

The method gives the system an understanding that the user clicked the campaign message: bulk, chain, transactional.

Syntax and parameters

sdk.notificationClicked(code, type)


NameTypeRequirementDescription
codestringrequired

Unique campaign code

The "src.id" value in the "payload" of the campaign should be used to define the value for this parameter. See Payload Examples.

typestringrequired

Campaign Type

The "src.type" value in the "payload" of the campaign should be used to define the value for this parameter. See Payload Examples.

Example of use

sdk.notificationClicked(code: "i7ykuagkjgfs", type: "mobile_push_transactional")


Token Send

sdk.setPushTokenNotification(token: "TOKEN_STRING") { (tokenResponse) in
  print("Token set response")
}

Payloads

Default Structure

{
  "aps": {
    "alert": {
      "title": "...",
      "subtitle": "...",
      "body": "...",
      "badge": 1
    },
    "mutable-content": 1
  },
  "image_url": "...",
  "event": {
    "type": "...",
    "uri": "..."
  },
  "src": {
    "type": "...",
    "id": "..."
  }
}



Basic Message

{
  "aps": {
    "alert": {
      "title": "Welcome aboard!",
      "subtitle": "Greeting message.",
      "body": "Hey, it's nice to know you're with us now. Check new updates in our application.",
      "badge": 1
    },
    "mutable-content": 1
  },
  "image_url": "...",
  "src": {
    "type": "bulk",
    "id": "33631"
  }
}



{
  "aps": {
    "alert": {
      "title": "Only today",
      "subtitle": "Special Offer",
      "body": "This special offer for Dyson products only for you!",
      "badge": 1
    },
    "mutable-content": 1
  },
  "image_url": "...",
  "event": {
    "type": "web",
    "uri": "https://example.com/landing/promo"
  },
  "src": {
    "type": "bulk",
    "id": "XFMjM4VAF4"
  }
}



Open Category

{
  "aps": {
    "alert": {
      "title": "Black Friday!",
      "subtitle": "Discount",
      "body": "Check our big sale from this category",
      "badge": 1
    },
    "mutable-content": 1
  },
  "image_url": "...",
  "event": {
    "type": "category",
    "uri": "BFRIDAY_CATEGORY_ID"
  },
  "src": {
    "type": "chain",
    "id": "72CONd54uF"
  }
}



Open Product

{
  "aps": {
    "alert": {
      "title": "...",
      "subtitle": "...",
      "body": "...",
      "badge": 1
    },
    "mutable-content": 1
  },
  "image_url": "...",
  "event": {
    "type": "product",
    "uri": "PRODUCT123"
  },
  "src": {
    "type": "chain",
    "id": "ugLxQ7KrnL"
  }
}



Open Custom Page

{
  "aps": {
    "alert": {
      "title": "...",
      "subtitle": "...",
      "body": "...",
      "badge": 1
    },
    "mutable-content": 1
  },
  "image_url": "...",
  "event": {
    "type": "custom",
    "uri": "order/status/36",
    "payload": {}
  },
  "src": {
    "type": "transactional",
    "id": "order_delivered"
  }
}
  • No labels