Retrieve Device Registration

Top  Previous  Next

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.
Synchronous Method:

public DeviceRegistration getDeviceRegistration() throws BackendlessException;

Asynchronous Method:

public void getDeviceRegistration( AsyncCallback<DeviceRegistration> responder );

Return value:

DeviceRegistration- the AsyncCallback argument of the asynchronous method receives an instance of DeviceRegistration in the handleResponse method.

Errors:

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

Description

5000

Unable to retrieve device registration - unknown device ID.

 

Examples:

String applicationID = "";
String secretKey = "";
String version = "";
String gcmSenderID = "";
// this call must be somewhere early on in the application initialization
Backendless.initApp( appContextOrActivity, applicationId, secretKey, version);

DeviceRegistration devReg = Backendless.Messaging.getDeviceRegistration();

 


Please let us know how we can improve the documentation by leaving a comment. All technical questions should be posted to the Backendless Support forum. We do not respond to the technical questions on the documentation pages.: