Skip to content

Retrieve Device Registration

Backendless server returns information about device registration with the API documented below. The input parameter of the API is deviceId - the value returned by the device registration API.

Blocking API

public DeviceRegistration getDeviceRegistration() throws BackendlessException;

Non-Blocking API

public void getDeviceRegistration( AsyncCallback<DeviceRegistration> responder );

Return value:

Device registration object - an instance of the DeviceRegistration class. Provides access to the following properties:

Argument                Description
deviceToken a token assigned by the push notification service provider (Google Cloud Messaging, Apple Push Notification Service, Microsoft Push Notification Service).
deviceId a unique identification of the device registered to receive push notifications.
os operating system identifier
osVersion version of the operating system
channels an array of Backendless messaging channels device is registered with.
expiration a timestamp indicating when the device registration should expire.


The following errors may occur during the device registration API callThe following errors may occur during the device registration API call. See the Error Handling section for details on how to retrieve the error code when the server returns an error:

Error Code
Unable to retrieve device registration - unknown device ID.


// do not forget to call Backendless.initApp in the app initialization code

DeviceRegistration devReg = Backendless.Messaging.getDeviceRegistration();