Learn how to manage your users with QuickBlox.
signUp()
method.
Create a user using the code snippet below. Only login (or email) and password are required. Other fields are optional.
getUsers()
method. The code snippet below shows how to get a list of users created between the two given dates, and sorted in descending order.
Argument | Required | Description |
---|---|---|
requestBuilder | yes | Allows to set parameters for the request. |
QBPagedRequestBuilder
class:
Field | Required | Description |
---|---|---|
perPage | no | Number of records to return in one page. |
page | no | Number of pages with results to be returned. |
created_at
field and created between the two given dates.
Search operators | Applicable to types | Applicable to fields | Description |
---|---|---|---|
lt | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Less Than operator. |
gt | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Greater Than operator. |
gte | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Greater Than or Equal to operator. |
le | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Less or Equal to operator |
eq | number, string, date | id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id | Equal to operator. |
ne | number, string, date | id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id | Not Equal to operator. |
between | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Contained between values operator. |
in | number, string, date | id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id | IN array operator. |
created_at
field sorted in descending order.
Sort operator | Applicable to types | Applicable to fields | Description |
---|---|---|---|
sortAsc | All types | id, full_name, email, login, phone, website, created_at, updated_at,last_request_at, external_user_id | Search results will be sorted in ascending order by the specified field. |
sortDesc | All types | id, full_name, email, login, phone, website, created_at, updated_at,last_request_at, external_user_id | Search results will be sorted in descending order by the specified field. |
ExternalID
field) in QBUser
model to link users from QuickBlox with users from your external database.
updateUser()
method. If you want to change your password, you need to provide 2 parameters: password
and newPassword
. The updated user
entity will be returned.
null
into the user’s password
field if you do not want to change your password. Otherwise, you will need to add the user’s old password to the oldPassword
field.user
using the updateUser()
method. Thus, the snippet below shows how to update a tagList
and customData
fields.
Field | Required | Description |
---|---|---|
tags | no | User tags. An array of Strings. A tag must include alphanumeric characters only and start with a letter. The tag must be at least 3 and no more than 15 characters long. There are no spaces in the tag format. For example, the “tagOne” format is correct while the “tag one” format is incorrect. If more that 10 tags are provided, an error is returned: tag list should contain maximum 10 tags. |
customData | no | User custom data. Should be a String. You can convert any data types to String, for example, JSON, XML , etc. |
java.io.File
and then write it to the avatar
. Then, upload the file to the QuickBlox cloud storage by calling the uploadFileTask()
method and passing the avatar
to it. Now that the file is uploaded, get the ID of the uploaded file. See this section to learn more about file upload functionality in details.
To connect the file to the user, set the ID of the uploaded file to the fileId
field of the user
and call the updateUser()
method. As a result, the user avatar gets updated.
updateUser()
method:
Argument | Required | Description |
---|---|---|
user | yes | Specifies user fields that should be set. |
downloadFileById()
method.
Argument | Required | Descriotion |
---|---|---|
userAvatarID | yes | File unique identifier. |