This is our documentation for beta version of QuickBlox Flutter SDK. Please contact our Customer Support Team to provide your feedback, suggestions, and requests to improve this page.
The user module manages all things related to user accounts handling, authentication, account data, password remind, etc.
Before you begin
- Visit our Key Concepts page to get an overall understanding of the most important QuickBlox concepts.
- Register a QuickBlox account. This is a matter of a few minutes and you will be able to use this account to build your apps.
- Configure QuickBlox SDK for your app. Check out our Setup page for more details.
- Create a user session to be able to use QuickBlox functionality. See our Authentication page to learn how to do it.
Create user
Create a user using the code snippet below. Only login (or email) and password are required. Other fields are optional.
try {
QBUser user = await QB.users.createUser(
login,
password,
email,
blobId: blobId,
eexternalUserId: xternalUserId,
facebookId: facebookId,
twitterId: twitterId,
fullName: fullName,
phone: phone,
website: website,
customData: customData,
tagList: tagList);
} on PlatformException catch (e) {
// Some error occured, look at the exception message for more details
}
Parameters | Description |
---|---|
login | User login. |
password | User password. |
(optional) User email. | |
blobId | (optional) User blob ID. |
externalUserId | (optional) User external ID. |
facebookId | (optional) User facebook ID. |
twitterId | (deprecated) User twitter ID. |
fullName | (optional) User full name. |
phone | (optional) User phone. |
website | (optional) User website. |
customData | (optional) User custom data. |
tagList | (optional) User tag list. |
Update user
Update a user profile using the following code snippet. If you want to change your password, you need to provide 2 parameters: password
and newPassword
. The updated user
entity will be returned.
try {
QBUser user = await QB.users.updateUser(
login,
newPassword: newPassword,
password: password,
email: email,
blobId: blobId,
externalUserId: externalUserId,
facebookId: facebookId,
twitterId: twitterId,
fullName: fullName,
phone: phone,
website: website,
customData: customData,
tagList: tagList);
} on PlatformException catch (e) {
// Some error occured, look at the exception message for more details
}
Parameters | Description |
---|---|
login | User login. |
newPassword | (optional) User new password. |
password | (optional) User current password. |
(optional) User email. | |
blobId | (optional) User blob ID. |
externalUserId | (optional) User external ID. |
facebookId | (optional) User Facebook ID. |
twitterId | (deprecated) User Twitter ID. |
fullName | (optional) User full name. |
phone | (optional) User phone. |
website | (optional) User website. |
customData | (optional) User custom data. |
tagList | (optional) User tag list. |
Retrieve users
Retrieve users by ID
To get a list of users by ID for a current account, use the following code snippet.
QBFilter qbFilter = new QBFilter();
qbFilter.field = QBUsersFilterFields.ID;
qbFilter.operator = QBUsersFilterOperators.IN;
qbFilter.type = QBUsersFilterTypes.NUMBER;
try {
List<QBUser> userList = await QB.users.getUsers(
sort: qbSort,
filter: qbFilter,
page: page,
perPage: perPage);
} on PlatformException catch (e) {
// Some error occured, look at the exception message for more details
}
Parameters | Description |
---|---|
sort | (optional) Parameter for sorting users. |
filter | (optional) Parameter for filtering users. |
page | (optional) Current page. |
perPage | (optional) Quantity of users per page. |
Retrieve users by full name
To get a list of users by full name for a current account, use the following code snippet.
QBFilter qbFilter = new QBFilter();
qbFilter.field = QBUsersFilterFields.FULL_NAME;
qbFilter.operator = QBUsersFilterOperators.IN;
qbFilter.type = QBUsersFilterTypes.STRING;
try {
List<QBUser> userList = await QB.users.getUsers(
sort: qbSort,
filter: qbFilter,
page: page,
perPage: perPage);
} on PlatformException catch (e) {
// Some error occured, look at the exception message for more details
}
Parameters | Description |
---|---|
sort | (optional) Parameter for sorting users. |
filter | (optional) Parameter for filtering users. |
page | (optional) Current page. |
perPage | (optional) Quantity of users per page. |
Retrieve users by tag
To get a list of users by tag for a current account, use the following code snippet.
List<String> tags = new List();
tags.add("test");
try {
List<QBUser> userList = await QB.users.getUsersByTag(
tags,
page: page,
perPage: perPage
);
} on PlatformException catch (e) {
// Some error occured, look at the exception message for more details
}
Parameters | Description |
---|---|
tags | An array of tags. Min: 1. |
page | (optional) Current page. Default: 1. |
perPage | (optional) A number of users per page. Min: 1. Default: 100. |
Updated a day ago
What's Next
Chat |