Skip to end of metadata
Go to start of metadata

Last Updated: Friday, January 10, 2020



Overview

The Vibes Push Device Callbacks for Vibes Push Notifications SDK are events that are triggered when a device is added, moved, updated, or removed to/from a Person. The callbacks provide important information about device association for a Person which lets the push messaging system send the right message to the right device for a Person.

Important Terminology

The following table shows the terminology used for device callbacks.

NameDescription
person_idThis is the primarily identifier of a Person in the Vibes system. It will always be created and associated to a device, and is also used for sending messages.
external_person_idThis is the primary identifier of a Person in the customer system and is associated to a Person using Associate Person to Device. It will always be created and associated to a device, and can also be used for sending messages. 
vibes_device_idThis is the primary identifier of a push device in the SDK and APIs.
push_tokenThis is the token provided by Apple or Google to send notifications to a device indicating if push is enabled or disabled.

Device Added Callback

This event is triggered when a device is added to a Person, or a device is moved from one Person to another Person. The device object contains a reference to the device that was added. 

{
  "event_id": "AB234SDFD234",
  "event_type": "device_added",
  "event_date": "2017-03-15T15:42:23Z",
  "delivery_attempt": "1",
  "person": {
    "person_id": "ABC123",
    "external_id": "ex1234",
    "url": "/companies/:company_key/mobiledb/persons/ABC123"
  },
  "push_device": {
    "app_id": "abe57f09-3126-4a7e-abc5-cac779710fd7",
    "vibes_device_id": "92e9d683-dd1e-4646-88d7-b89fc415a5c1",
    "push_token": "62171B3484EE776DB11083F06C90CF970B9C50AC263F46F5B3FBA3CBAF23601F",
    "device_os": "ANDROID",
    "url": "/mobile_apps/abe57f09-3126-4a7e-abc5-cac779710fd7/devices/92e9d683-dd1e-4646-88d7-b89fc415a5c1"
  }
}

Device Removed Callback

This event is triggered when a device is removed from a Person, or a device is moved from one Person to another Person. The device object contains a reference to the device that was added.

{
  "event_id": "AB234SDFD234",
  "event_type": "device_removed",
  "event_date": "2017-03-15T15:42:23Z",
  "delivery_attempt": "1",
  "person": {
    "person_id": "ABC123",
    "external_id": "ex1234",
    "url": "/companies/:company_id/mobiledb/persons/ABC123"
  },
  "push_device": {
    "app_id": "abe57f09-3126-4a7e-abc5-cac779710fd7",
    "vibes_device_id": "92e9d683-dd1e-4646-88d7-b89fc415a5c1",
    "push_token": "62171B3484EE776DB11083F06C90CF970B9C50AC263F46F5B3FBA3CBAF23601F",
    "device_os": "ANDROID",
    "url": "/mobile_apps/abe57f09-3126-4a7e-abc5-cac779710fd7/devices/92e9d683-dd1e-4646-88d7-b89fc415a5c1"
  }
}

Device Updated Callback

This event is triggered when a device had push enabled or disabled. The device object contains a reference to the device that was updated. The push_token is the value provided by Apple or Google to send notifications to those systems.

  • If push is enabled, the value will be present.
  • If push is disabled, the value will be blank.

{
  "event_id": "AB234SDFD234",
  "event_type": "device_updated",
  "event_date": "2017-03-15T15:42:23Z",
  "delivery_attempt": "1",
  "person": {
    "person_id": "ABC123",
    "external_id": "ex1234",
    "url": "/companies/:company_id/mobiledb/persons/ABC123"
  },
  "push_device": {
    "app_id": "abe57f09-3126-4a7e-abc5-cac779710fd7",
    "vibes_device_id": "92e9d683-dd1e-4646-88d7-b89fc415a5c1",
    "push_token": "62171B3484EE776DB11083F06C90CF970B9C50AC263F46F5B3FBA3CBAF23601F",
    "device_os": "ANDROID",
    "url": "/mobile_apps/abe57f09-3126-4a7e-abc5-cac779710fd7/devices/92e9d683-dd1e-4646-88d7-b89fc415a5c1"
  }
}

Additional Resources

  • No labels