0
我需要了解如何執行此操作 我想讓特定用戶成爲管理員,如果管理員登錄然後 我的Quickblox帳戶中的所有用戶都顯示在UserFragment類中(其中是默認值), 如果其他用戶登錄,UserFragment類應只顯示管理員。 這意味着管理員可以與其他用戶聊天,其他用戶只能與管理員聊天。獲取quickblox聊天中的用戶列表
我需要了解如何執行此操作 我想讓特定用戶成爲管理員,如果管理員登錄然後 我的Quickblox帳戶中的所有用戶都顯示在UserFragment類中(其中是默認值), 如果其他用戶登錄,UserFragment類應只顯示管理員。 這意味着管理員可以與其他用戶聊天,其他用戶只能與管理員聊天。獲取quickblox聊天中的用戶列表
[QBRequest logInWithUserEmail:@"adminEmail" password:@"adminPassword" successBlock:^(QBResponse * _Nonnull response, QBUUser * _Nullable user) {
//You get userid of admin in user.ID
if(user.ID == 1234567){ //Pass ID of your admin which you can take from https://admin.quickblox.com
// Fetch all users
}else{
// Retrieve user by ID for admin
}
errorBlock:^(QBResponse * _Nonnull response) {
// Handle error
}];
現在,獲取您可以使用的所有用戶。
QBGeneralResponsePage *page = [QBGeneralResponsePage responsePageWithCurrentPage:1 perPage:10];
[QBRequest usersForPage:page successBlock:^(QBResponse *response, QBGeneralResponsePage *pageInformation, NSArray *users) {
// Successful response contains current page infromation + list of users
} errorBlock:^(QBResponse *response) {
// Handle error
}];
現在,獲取管理詳細信息。
//Pass your admin ID here
[QBRequest usersWithIDs:@[@12345] page:[QBGeneralResponsePage responsePageWithCurrentPage:1 perPage:10] successBlock:^(QBResponse *response, QBGeneralResponsePage *page, NSArray *users) {
// Details of admin in users
} errorBlock:^(QBResponse *response) {
// Handle error here
}];
您也可以參考用於獲取用戶
https://quickblox.com/developers/SimpleSample-users-ios#Retrieving_all_Users
此鏈接