Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Initializing and Registering a Device

Initializing and Registering a Device

You need to register each device that you want to send push notifications to. The register operation takes care of two tasks:

  • Registers (initializes) the device with its vendor's push notification service—This step includes acquiring a push notification token from the vendor's push notifications service that authorizes Telerik Platform to send messages to the device.
  • Creates a device registration in Telerik Platform—This step includes saving the device's push notification token along with other details in Telerik Platform.

A device registration describes a single device that has been registered for push notifications in your Telerik Platform application. The object that represents the registration contains required system properties such as token, device model, operating system type, time zone, etc. as well as custom parameters that you have added during registration.

Later, when you send notifications to devices that run your app, you can use both the system and the custom parameters to precisely target who receives what.

This article is organized as follows:

Initializing a Device

When using the RESTful API you need to manually initialize the device which includes acquiring a push token from the vendor's push notification service. Refer to each vendor's official documentation to learn how to do that:

Registering a Device

After acquiring a push token for the device from its provider you are ready to complete the registration by sending it to Telerik Platform.

To do that, make a request to the appropriate RESTful endpoint as shown below. In the request body provide a JSON object containing all fields listed in Table of Registration Object Fields.

Request:
     POST https://api.everlive.com/v1/your-app-id/Push/Devices
Headers:
     Content-Type: application/json
Body:
    {
        "HardwareId": "device_id",
        "HardwareModel": "",
        "PlatformType": 3, // 1 for WindowsPhone, 2 for Windows, 3 for Android, 4 for iOS
        "PlatformVersion": "4.0.4",
        "PushToken": "some_token", // the token returned by the provider
        "Locale": "en-US",
        "TimeZone": "America/New_York",
        "Parameters": {
            "MyIntValue": 1,
            "MyDateValue": "2013-06-01T00:00:00Z"
        }
    }
Response:
    Status: 201 Created
    Content-Type: application/json
var device = {
    "HardwareId": "device_id",
    "HardwareModel": "",
    "PlatformType": 3, // 1 for WindowsPhone, 2 for Windows, 3 for Android, 4 for iOS
    "PlatformVersion": "4.0.4",
    "PushToken": "some_token", // the token returned by the provider
    "Locale": "en-US",
    "TimeZone": "America/New_York",
    "Parameters": {
        "MyIntValue": 1,
        "MyDateValue": "2013-06-01T00:00:00Z"
    }
};
$.ajax({
    type: "POST",
    url: 'https://api.everlive.com/v1/your-app-id/Push/Devices',
    contentType: "application/json",
    data: JSON.stringify(device),
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});

See Also


Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.