Help Center

Local Navigation

Retrieve a BlackBerry device ID

Retrieve the userID integer for the user account assigned to the BlackBerry device.
To search for a specific BlackBerry® device, use the user account assigned to the BlackBerry device.
  1. Invoke findDeviceForUser().
    FindDeviceForUserResult result=coreWebService.findDeviceForUser(userId, locale, true);
  2. Check the result for errors and handle any errors.
    if (result.getFindDeviceForUserReturnStatus().getCode()!= FindDeviceForUserReturnStatusEnumType.SUCCESS)
    { 
           // handle any errors
    }
  3. Verify that there is a BlackBerry device assigned to the the user account.
    if (result.getDevice() == null)
    { 
           // notify the user
    }
  4. Return the BlackBerry device ID.
    int deviceID = result.getDevice().getDeviceId();
    return deviceID;

Index


Was this information helpful? Send us your comments.