The Trakopolis API server sends push notification as a JSON-serialized object with properties:

  • Version – protocol version number. Equal to “1.0”
  • Subscribers – array of notifications for subscriber

Notification object contains: 

  • SubscriberToken – unique subscriber token that has been used during subscriber registration
  • Alerts – array of new alerts
  • OutgoingMessages – array of outgoing messages

Alerts notification object contains: 

  • Unread – number of “unread” alerts
  • Items – array of new alerts

Outgoing messages notification object contains: 

  • Unread – number of “unread” outgoing messages
  • Items – array of new outgoing messages

Notification payload example:

{
  "Version": "1.0",
  "Guid": "1eb6f726-8fd1-48a2-9477-7b178dc93e43",
  "Subscribers": [{
   "SubscriberToken": "Unique_subscriber_push_token",
   "Alerts": {
    "Unread": 10,
    "Items": [{
     "AlertId": 12345678,
     "AssetId": 1234,
     "AssetName": "Asset ABC",
     "DriverId": 2345,
     "DriverName": "John Doe",
     "Message": "Alert text"
    }]
   },
   "OutgoingMessages": {
    "Unread": 78,
    "Items": [{
     "Message": "Message text"
    }]
   }
  }]
 }					

Single notification can contain notifications up to 100 subscribers, every notification message can have information about both alerts and outgoing messages. Example of push notification message: