BMXGroupManager Protocol Reference

Conforms to NSObject
Declared in BMXGroupManager.h

Instance Methods

acceptApplicationByGroup:applicantId:completion:

Accept application of membership

- (void)acceptApplicationByGroup:(BMXGroup *)*group* applicantId:(long long)*applicantId* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Accept application of membership

Declared In

  • BMXGroupManager.h

Example:

-(void) touchedActionWithRet:(BOOL) ret atIndex:(NSInteger) index {
    BMXGroupApplication* application = [self.applicationArray objectAtIndex:index];
    if(ret) { //同意
        [[[BMXClient sharedClient] groupService] acceptApplicationByGroup:self.group applicantId:application.applicationId completion:^(BMXError *error) {

acceptInvitationByGroup:inviter:completion:

Accept to join group

- (void)acceptInvitationByGroup:(BMXGroup *)*group* inviter:(long long)*inviter* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Accept to join group

Declared In

  • BMXGroupManager.h

Example:

addAdmins:admins:message:completion:

Add Admin

- (void)addAdmins:(BMXGroup *)*group* admins:(NSArray<NSNumber*> *)*admins* message:(NSString *)*message* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

admins
Array:id

message
String

aCompletionBlock
BMXError

Discussion

Add Admin

Declared In

  • BMXGroupManager.h

Example:

-(void) dealWithMembersWithSection:(NSInteger) section Row:(NSInteger) row
{
    if(section == 0) {// 取消管理
        NSString* uid = [self.adminUidArray objectAtIndex:row];
        NSNumber *uidnumber = [NSNumber numberWithLongLong:[uid longLongValue]];
        [[[BMXClient sharedClient] groupService] removeAdmins:self.group admins:@[uidnumber] reason:NSLocalizedString(@"Add_admin", @"添加管理") completion:^(BMXError *error) {
            if(!error) {
                [self.adminUidArray removeObject:uid];
                [self.normalUidArray addObject:uid];
                [self.tableView reloadData];
            }else {
                MAXLog(@"error : %ld", error.errorCode);
            }
            
        }];
    }else { //添加管理
        NSNumber* uid = [NSNumber numberWithLongLong:[[self.normalUidArray objectAtIndex:row] longLongValue]];
        [[[BMXClient sharedClient] groupService] addAdmins:self.group admins:@[uid] message:NSLocalizedString(@"Cancellation_management", @"取消管理") completion:^(BMXError *error) {
- (void)addAdminsId:(NSArray*)adminsId message:(NSString *)message {
    [[[BMXClient sharedClient] groupService] addAdmins:self.group admins:adminsId message:message completion:^(BMXError *error) {

addDelegate:

- (void)addDelegate:(id<BMXGroupServiceProtocol>)*aDelegate*

Example:

- (void)registerAPNs {
    [[[BMXClient sharedClient] pushService] start];
    [[[BMXClient sharedClient] pushService] addDelegate:self];
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self configCollectionView];
    self.view.clipsToBounds = YES;
    [[[BMXClient sharedClient] chatService] addDelegate:self];
- (void)addIMListener {
    BMXClient *client = [BMXClient sharedClient];
    [[client rosterService] addDelegate:self];
- (void)addIMListener {
    BMXClient *client = [BMXClient sharedClient];
    [[client rosterService] addDelegate:self];
    [[client chatService] addDelegate:self];
- (void)addIMListener {
    BMXClient *client = [BMXClient sharedClient];
    [[client rosterService] addDelegate:self];
    [[client chatService] addDelegate:self];
    [[client userService] addDelegate:self];
- (void)addIMListener {
    BMXClient *client = [BMXClient sharedClient];
    [[client rosterService] addDelegate:self];
    [[client chatService] addDelegate:self];
    [[client userService] addDelegate:self];
    [[client groupService] addDelegate:self];

addDelegate:delegateQueue:

- (void)addDelegate:(id<BMXGroupServiceProtocol>)*aDelegate* delegateQueue:(dispatch_queue_t)*aQueue*

Example:

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    self.account = [IMAcountInfoStorage loadObject];
    [self  getMyProfile];
    
    [self setUpNavItem];
    [self setupSubview];
    
    [self loadMessages];
    
    [self scrollToBottomAnimated:NO refresh:NO];
    
    [[[BMXClient sharedClient] chatService] addDelegate:self delegateQueue:dispatch_get_main_queue()];

addGroupListener:

Add group change listener

- (void)addGroupListener:(id<BMXGroupServiceProtocol>)*listener*

Discussion

Add group change listener

Declared In

  • BMXGroupManager.h

Example:

addMembersToGroup:memberIdlist:message:completion:

Add group member

- (void)addMembersToGroup:(BMXGroup *)*group* memberIdlist:(NSArray<NSNumber*> *)*memberIdlist* message:(NSString *)*message* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

memberIdlist
id array

message
Adding information

aCompletionBlock
BMXError

Discussion

Add group member

Declared In

  • BMXGroupManager.h

Example:

[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Confirm", @"确定") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    UITextField* tfield = alertController.textFields.firstObject;
    NSString* message = tfield.text;
    [[[BMXClient sharedClient] groupService] addMembersToGroup:self.group memberIdlist:ids message:message completion:^(BMXError *error) {
- (void)addMembersWithmembersId:(NSArray*)membersId message:(NSString *)message {
    [[[BMXClient sharedClient] groupService] addMembersToGroup:self.group memberIdlist:membersId message:message completion:^(BMXError *error) {

banGroup:duration:completion:

Ban all members

- (void)banGroup:(BMXGroup *)*group* duration:(long long)*duration* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Ban all members

Declared In

  • BMXGroupManager.h

Example:

- (void)p_configBanGroup {
    void(^aCompletionBlock)(BMXError *error) =^(BMXError *error) {
        if (error == nil) {
            MAXLog(@"设置成功");
            [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
            [self.tableView reloadData];
        } else {
            [HQCustomToast showDialog:error.errorMessage];
        }
    };
    if (self.isGroupBanned){
        [[[BMXClient sharedClient] groupService] unbanGroup:self.group completion:aCompletionBlock];
    }else{
        [[[BMXClient sharedClient] groupService] banGroup:self.group duration:600 completion:aCompletionBlock];

banMembers:group:reason:duration:completion:

Ban

- (void)banMembers:(NSArray<NSNumber*> *)*members* group:(BMXGroup *)*group* reason:(NSString *)*reason* duration:(long long)*duration* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Ban

Declared In

  • BMXGroupManager.h

Example:

UIAlertAction* okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Confirm", @"确定") style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
    BMXRoster* roster = [self.memberList objectAtIndex:index];
    NSNumber* rosterId = [NSNumber numberWithLongLong:roster.rosterId];
    NSString* muteDurationStr = [alert.textFields objectAtIndex:0].text;
    NSInteger duration = [muteDurationStr longLongValue];
    [[[BMXClient sharedClient] groupService] banMembers:@[rosterId] group:self.group reason:NSLocalizedString(@"Ban", @"禁言") duration:duration completion:^(BMXError *error) {

blockMembers:members:completion:

Add to blacklist

- (void)blockMembers:(BMXGroup *)*group* members:(NSArray<NSNumber*> *)*members* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Add to blacklist

Declared In

  • BMXGroupManager.h

Example:

UIAlertAction* okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Confirm", @"确定") style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
    BMXRoster* roster = [self.memberList objectAtIndex:index];
    NSNumber *rosterId = [NSNumber numberWithLongLong:roster.rosterId];
    [[[BMXClient sharedClient] groupService] blockMembers:self.group members:@[rosterId] completion:^(BMXError *error) {

creatGroupWithCreateGroupOption:completion:

Create group

- (void)creatGroupWithCreateGroupOption:(BMXCreatGroupOption *)*option* completion:(void ( ^ ) ( BMXGroup *group , BMXError *error ))*aCompletionBlock*

Parameters

option
BMXCreatGroupOption

aCompletionBlock
Group info ,Error

Discussion

Create group

Declared In

  • BMXGroupManager.h

Example:

[[GroupCreateAlertView alloc] initWithFrame:CGRectZero Text:NSLocalizedString(@"Create_message", @"创建信息") OK:^(NSString *title, NSString *description, NSString *message, BOOL isChatroom) {
    BMXCreatGroupOption *option = [[BMXCreatGroupOption alloc] initWithGroupName:title groupDescription:description isPublic:YES];
    option.message = message;
    option.members = ids;
    option.isChatroom = isChatroom;
    [[[BMXClient sharedClient] groupService] creatGroupWithCreateGroupOption:option completion:^(BMXGroup *group, BMXError *error) {

declineApplicationByGroup:applicantId:completion:

Reject application of membership

- (void)declineApplicationByGroup:(BMXGroup *)*group* applicantId:(long long)*applicantId* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Reject application of membership

Declared In

  • BMXGroupManager.h

Example:

-(void) touchedActionWithRet:(BOOL) ret atIndex:(NSInteger) index {
    BMXGroupApplication* application = [self.applicationArray objectAtIndex:index];
    if(ret) { //同意
        [[[BMXClient sharedClient] groupService] acceptApplicationByGroup:self.group applicantId:application.applicationId completion:^(BMXError *error) {
            MAXLog(@"同意成功...");
            if (!error) {
                [self getApplyList];
                [[NSNotificationCenter defaultCenter] postNotificationName:@"KEY_NOTIFICATION_GROUP_MEMBER_UPDATED" object:nil];
            }
            
        }];
    }else {
        [[[BMXClient sharedClient] groupService] declineApplicationByGroup:self.group applicantId:application.applicationId completion:^(BMXError *error) {

declineInvitationByGroup:inviter:completion:

Reject invitation to join group

- (void)declineInvitationByGroup:(BMXGroup *)*group* inviter:(long long)*inviter* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Reject invitation to join group

Declared In

  • BMXGroupManager.h

Example:

deleteAnnouncementWithGroup:announcementId:completion:

Delete group announcement

- (void)deleteAnnouncementWithGroup:(BMXGroup *)*group* announcementId:(long long)*announcementId* completion:(void ( ^ ) ( BMXGroup *group , BMXError *error ))*aCompletionBlock*

Discussion

Delete group announcement

Declared In

  • BMXGroupManager.h

Example:

destroyGroup:completion:

Destroy group (valid only for group Owner)

- (void)destroyGroup:(BMXGroup *)*group* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

aCompletionBlock
Error

Discussion

Destroy group (valid only for group Owner)

Declared In

  • BMXGroupManager.h

Example:

- (void) destroyGroup {
    [[[BMXClient sharedClient] groupService] destroyGroup:self.group completion:^(BMXError *error) {
- (void)destroyGroupWithGroup:(BMXGroup *)group {
    [[[BMXClient sharedClient] groupService] destroyGroup:group completion:^(BMXError *error) {
- (void)destroyGroupWithGroup:(BMXGroup *)group {
    [[[BMXClient sharedClient] groupService] destroyGroup:group completion:^(BMXError *error) {

downloadAvatarWithGroup:progress:completion:

Download group avatar

- (void)downloadAvatarWithGroup:(BMXGroup *)*group* progress:(void ( ^ ) ( int progress , BMXError *error ))*aProgress* completion:(void ( ^ ) ( BMXGroup *resultGroup , BMXError *error ))*aCompletion*

Discussion

Download group avatar

Declared In

  • BMXGroupManager.h

Example:

- (void)configGrouopCodeAndContent {
    self.idLabel.text = [NSString stringWithFormat:@"id : %lld", self.group.groupId];
    self.nameLabel.text = [NSString stringWithFormat:NSLocalizedString(@"Nickname_name", @"昵称 : %@"), self.group.name];
    
    self.avatarImageView.image = [UIImage imageNamed:@"group_placeHo"];
    
    if ([[NSFileManager defaultManager] fileExistsAtPath:self.group.avatarThumbnailPath]) {
        UIImage *avarat = [UIImage imageWithContentsOfFile:self.group.avatarThumbnailPath];
        self.avatarImageView.image = avarat;
    } else {
        [[[BMXClient sharedClient] groupService] downloadAvatarWithGroup:self.group progress:^(int progress, BMXError *error) {
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    

    
    [self setupSubview];
    
    self.avatarImageview.image = [UIImage imageNamed:@"contact_placeholder"];
    self.nameLabel.text = self.group.name;

    [self setNavigationBarTitle:NSLocalizedString(@"Join_group", @"加入群") navLeftButtonIcon:@"blackback"];
    
    UIImage *avarat = [UIImage imageWithContentsOfFile:self.group.avatarThumbnailPath];
    if (avarat) {
        self.avatarImageview.image = avarat;
    }else {
        [[[BMXClient sharedClient] groupService] downloadAvatarWithGroup:self.group progress:^(int progress, BMXError *error) {
-(UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSInteger row = indexPath.row;
    GroupCommonCell* cell = [tableView dequeueReusableCellWithIdentifier:@"GroupCommonCell"];
    if(cell == nil) {
        cell = [[GroupCommonCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"GroupCommonCell"];
    }
    NSString* tableTitle = [_tableTitleArray objectAtIndex:row];
    if (row == 0) {
        [cell setMainText:tableTitle detailText:@"" switcherFlag:NO switcherTarget:nil switcherSelector:nil];
        [cell showAccesor:YES];
        [cell.avatarImageView setHidden:NO];
        
        if (self.group.avatarThumbnailPath > 0 && [[NSFileManager defaultManager] fileExistsAtPath:self.group.avatarThumbnailPath]) {
            cell.avatarImageView.image = [UIImage imageWithContentsOfFile:self.group.avatarThumbnailPath];
        }else {
            [[[BMXClient sharedClient] groupService] downloadAvatarWithGroup:self.group progress:^(int progress, BMXError *error) {
- (void)refreshByGroup:(BMXGroup *)group {
    
    self.avatarImg.image = [UIImage imageNamed:@"group_placeHo"]; 
    self.nicknameLabel.text = group.name;
    
    if (group.avatarThumbnailPath > 0 && [[NSFileManager defaultManager] fileExistsAtPath:group.avatarThumbnailPath]) {
        self.avatarImg.image = [UIImage imageWithContentsOfFile:group.avatarThumbnailPath];
    }else {
        
        [[[BMXClient sharedClient] groupService] downloadAvatarWithGroup:group progress:^(int progress, BMXError *error) {
            cell.titleLabel.text = group.name != nil ? group.name : NSLocalizedString(@"No_name_for_now", @"暂无名字");
            cell.avatarImageView.image = [UIImage imageNamed:@"group_placeHo"];
            
            if (group.avatarThumbnailPath > 0 && [[NSFileManager defaultManager] fileExistsAtPath:group.avatarThumbnailPath]) {
                dispatch_async(dispatch_get_main_queue(), ^{
                    cell.avatarImageView.image = [UIImage imageWithContentsOfFile:group.avatarThumbnailPath];
                });
//                MAXLog(@"group:%@", group.avatarThumbnailPath);

            }else {
                [[[BMXClient sharedClient] groupService] downloadAvatarWithGroup:group progress:^(int progress, BMXError *error) {

downloadSharedFileFromGroup:shareFile:progress:completion:

Download share file in group

- (void)downloadSharedFileFromGroup:(BMXGroup *)*group* shareFile:(BMXGroupSharedFile *)*shareFile* progress:(void ( ^ ) ( int progress , BMXError *error ))*aProgress* completion:(void ( ^ ) ( BMXGroup *resultGroup , BMXError *error ))*aCompletion*

Discussion

Download share file in group

Declared In

  • BMXGroupManager.h

Example:

editGroupAnnouncement:title:content:completion:

Write group announcement

- (void)editGroupAnnouncement:(BMXGroup *)*group* title:(NSString *)*title* content:(NSString *)*content* completion:(void ( ^ ) ( BMXGroup *group , BMXError *error ))*aCompletionBlock*

Discussion

Write group announcement

Declared In

  • BMXGroupManager.h

Example:

- (void)touchedRightBar {
    MAXLog(@"发布群公告...");
    [[[BMXClient sharedClient] groupService] editGroupAnnouncement:self.group title:_titleField.text content:_textView.text completion:^(BMXGroup *group, BMXError *error) {

getAdmins:forceRefresh:completion:

Get Admins list, pull from server if forceRefreshed is set

- (void)getAdmins:(BMXGroup *)*group* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray<BMXGroupMember*> *, BMXError *error ))*aCompletionBlock*

Discussion

Get Admins list, pull from server if forceRefreshed is set

Declared In

  • BMXGroupManager.h

Example:

-(void) getManageList
{
    [[[BMXClient sharedClient] groupService] getAdmins:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *adminList, BMXError *error) {
-(void) getAdminList
{
    [[[BMXClient sharedClient] groupService] getAdmins:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *groupMembers, BMXError *error) {
-(void) getManageList // 管理员不能被操作.
{
    [[[BMXClient sharedClient] groupService] getAdmins:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *adminList, BMXError *error) {
-(void) getAdminList
{
    [[[BMXClient sharedClient] groupService] getAdmins:self.group forceRefresh:NO completion:^(NSArray<BMXGroupMember *> *groupMembers, BMXError *error) {

getAnnouncementListWithGroup:forceRefresh:completion:

Get group announcements list

- (void)getAnnouncementListWithGroup:(BMXGroup *)*group* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray *annoucmentArray , BMXError *error ))*aCompletionBlock*

Discussion

Get group announcements list

Declared In

  • BMXGroupManager.h

Example:

- (void)getAnnoument {
    [[[BMXClient sharedClient] groupService] getAnnouncementListWithGroup:self.group forceRefresh:YES completion:^(NSArray *annoucmentArray, BMXError *error) {

getApplicationListByCursor:pageSize:completion:

Get a list of group applications in pages

- (void)getApplicationListByCursor:(NSString *)*cursor* pageSize:(int)*pageSize* completion:(void ( ^ ) ( NSArray *applicationList , NSString *cursor , long long offset , BMXError *error ))*aCompletionBlock*

Discussion

Get a list of group applications in pages

Declared In

  • BMXGroupManager.h

Example:

- (void) getApplyList {
    [[[BMXClient sharedClient] groupService] getApplicationListByCursor:@"" pageSize:100 completion:^(NSArray *applicationList, NSString *cursor, long long offset, BMXError *error) {

getBannedMembersByGroup:completion:

Get a list of banned members

- (void)getBannedMembersByGroup:(BMXGroup *)*group* completion:(void ( ^ ) ( NSArray<BMXGroupBannedMember*> *bannedMemberList , BMXError *error ))*aCompletionBlock*

Discussion

Get a list of banned members

Declared In

  • BMXGroupManager.h

Example:

- (void)getMuteList {
    [[[BMXClient sharedClient] groupService] getBannedMembersByGroup:self.group completion:^(NSArray<BMXGroupBannedMember *> *muteMemberList, BMXError *error) {

getBlockList:cursor:pageSize:completion:

Paged to get blacklist

- (void)getBlockList:(BMXGroup *)*group* cursor:(NSString *)*cursor* pageSize:(int)*pageSize* completion:(void ( ^ ) ( NSArray *memberList , NSString *cursor , long long offset , BMXError *error ))*aCompletionBlock*

Parameters

cursor
string

pageSize
int

aCompletionBlock
NSArray *memberList,

Discussion

Paged to get blacklist

Declared In

  • BMXGroupManager.h

Example:

getBlockListByGroup:forceRefresh:completion:

Get blacklist

- (void)getBlockListByGroup:(BMXGroup *)*group* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray<BMXGroupMember*> *, BMXError *error ))*aCompletionBlock*

Discussion

Get blacklist

Declared In

  • BMXGroupManager.h

Example:

- (void)getBlackList {
    [[[BMXClient sharedClient] groupService] getBlockListByGroup:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *blockList, BMXError *error) {

getGroupByName:completion:

Query local group information by group name and retrieve the group from local database by group name query

- (void)getGroupByName:(NSString *)*name* completion:(void ( ^ ) ( NSArray *groupList , BMXError *error ))*aCompletionBlock*

Parameters

name
Keyword of group name for query

aCompletionBlock
Group list information returned by search result,BMXErrorCode

Discussion

Query local group information by group name and retrieve the group from local database by group name query

Declared In

  • BMXGroupManager.h

Example:

getGroupInfoByGroupId:forceRefresh:completion:

Get group information

- (void)getGroupInfoByGroupId:(long long)*groupId* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( BMXGroup *group , BMXError *error ))*aCompletionBlock*

Parameters

groupId
Group id

forceRefresh
Pull from server if forceRefresh is set

aCompletionBlock
Group

Discussion

Get group information

Declared In

  • BMXGroupManager.h

Example:

- (void)getGroupDetailInfo {
    [[[BMXClient sharedClient] groupService] getGroupInfoByGroupId:self.group.groupId forceRefresh:YES completion:^(BMXGroup *group, BMXError *error) {
            }else {
                // 获取不到资料时,新建一个对象占位
                [tempProfileArray addObject:NSLocalizedString(@"Unable_to_access_profile", @"无法获取资料")];
            }
        }];
    }
                   
     dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
                    
} else {
    [[[BMXClient sharedClient] groupService] getGroupInfoByGroupId:conversation.conversationId forceRefresh:NO completion:^(BMXGroup *group, BMXError *error) {
- (void)searcGroupById:(NSInteger)groupId WithInfo:(NSString *)info{
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] groupService]  getGroupInfoByGroupId:groupId forceRefresh:YES completion:^(BMXGroup *group, BMXError *error) {
dispatch_async(queue, ^{
    if (messageObjc.messageType == BMXMessageTypeSingle) {
        IMAcount *im =  [IMAcountInfoStorage loadObject];
                    
        NSString *fromIdstr = [NSString stringWithFormat:@"%lld", messageObjc.fromId];
        NSInteger rosterId = [fromIdstr isEqualToString:im.usedId] ? messageObjc.toId : messageObjc.fromId;
                    
        [[[BMXClient sharedClient] rosterService] searchByRosterId:rosterId forceRefresh:NO completion:^(BMXRoster *roster, BMXError *error) {
            dispatch_semaphore_signal(semaphore);
            if (roster) {
                            
                [tempProfileArray addObject:roster];
            }
        }];
         dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
    }else {
                    
        [[[BMXClient sharedClient] groupService] getGroupInfoByGroupId:messageObjc.conversationId forceRefresh:NO completion:^(BMXGroup *group, BMXError *error) {
dispatch_async(queue, ^{
    if (messageObjc.messageType == BMXMessageTypeSingle) {
        IMAcount *im =  [IMAcountInfoStorage loadObject];
        NSString *fromIdStr = [NSString stringWithFormat:@"%lld", messageObjc.fromId];
        NSInteger rosterId = [fromIdStr isEqualToString:im.usedId] ? messageObjc.toId : messageObjc.fromId;
                
        [[[BMXClient sharedClient] rosterService] searchByRosterId:rosterId forceRefresh:NO completion:^(BMXRoster *roster, BMXError *error) {
            dispatch_semaphore_signal(semaphore);
            if (roster) {
                        
                [tempProfileArray addObject:roster];
            }
        }];
        dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
    }else {
                
        [[[BMXClient sharedClient] groupService] getGroupInfoByGroupId:messageObjc.conversationId forceRefresh:NO completion:^(BMXGroup *group, BMXError *error) {

getGroupInfoByGroupIdArray:forceRefresh:completion:

Get the list of group information for the incoming group id, pull from server if forceRefreshed is set

- (void)getGroupInfoByGroupIdArray:(NSArray<NSNumber*> *)*groupIdArray* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray *aGroups , BMXError *aError ))*aCompletionBlock*

Discussion

Get the list of group information for the incoming group id, pull from server if forceRefreshed is set

Declared In

  • BMXGroupManager.h

Example:

    dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{
        dispatch_group_enter(group);
        [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:rosterIds forceRefresh:NO completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {
            MAXLog(@"%lu", (unsigned long)rosterList.count);
            for (BMXRoster* roster in rosterList) {
                [self.rosterInfos setObject:roster forKey:[NSString stringWithFormat:@"%lld", roster.rosterId]];
            }
            dispatch_group_leave(group);
        }];
//        // 下面是群的。。。。
        dispatch_group_enter(group);
        [[[BMXClient sharedClient] groupService] getGroupInfoByGroupIdArray:gids forceRefresh:NO completion:^(NSArray *aGroups, BMXError *aError) {

getGroupListForceRefresh:completion:

Get group list

- (void)getGroupListForceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray *groupList , BMXError *error ))*aCompletionBlock*

Parameters

forceRefresh
Pull from server if forceRefresh is set

aCompletionBlock
GroupList, Error

Discussion

Get group list

Declared In

  • BMXGroupManager.h

Example:

- (void)getGroupList {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] groupService] getGroupListForceRefresh:NO completion:^(NSArray *groupList, BMXError *error) {
+ (void)getGroupListcompletion:(void(^)(NSArray <BMXGroup *>*group, NSString *errmsg))aCompletionBlock {
    [[[BMXClient sharedClient] groupService] getGroupListForceRefresh:YES completion:^(NSArray *groupList, BMXError *error) {
- (void)getGroupList {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] groupService] getGroupListForceRefresh:NO completion:^(NSArray *groupList, BMXError *error) {
- (void)getGroupList {
    [[[BMXClient sharedClient] groupService] getGroupListForceRefresh:YES completion:^(NSArray *groupList, BMXError *error) {

getInvitationListByCursor:pageSize:completion:

Get group invitation list in pages

- (void)getInvitationListByCursor:(NSString *)*cursor* pageSize:(int)*pageSize* completion:(void ( ^ ) ( NSArray *invitationList , NSString *cursor , long long offset , BMXError *error ))*aCompletionBlock*

Parameters

cursor
string

pageSize
int

aCompletionBlock
NSArray *invitationList,

Discussion

Get group invitation list in pages

Declared In

  • BMXGroupManager.h

Example:

- (void) getApplyList {
    
    [[[BMXClient sharedClient] groupService] getInvitationListByCursor:@"" pageSize:100 completion:^(NSArray *invitationList, NSString *cursor, long long offset, BMXError *error) {

getLatestAnnouncementWithGroup:forceRefresh:completion:

Get the latest group announcement

- (void)getLatestAnnouncementWithGroup:(BMXGroup *)*group* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( BMXGroupAnnounment *groupAnnounment , BMXError *error ))*aCompletionBlock*

Discussion

Get the latest group announcement

Declared In

  • BMXGroupManager.h

Example:

getMemberList:cursor:pageSize:completion:

Get group member list in pages

- (void)getMemberList:(BMXGroup *)*group* cursor:(NSString *)*cursor* pageSize:(int)*pageSize* completion:(void ( ^ ) ( NSArray *memberList , NSString *cursor , long long offset , BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

cursor
String

pageSize
int

aCompletionBlock
NSArray *memberList,

Discussion

Get group member list in pages

Declared In

  • BMXGroupManager.h

Example:

getMembers:forceRefresh:completion:

Get group member list,

- (void)getMembers:(BMXGroup *)*group* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray<BMXGroupMember*> *groupList , BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

forceRefresh
Pull from server if forceRefresh is set, max. 1,000 members

aCompletionBlock
List:BMXGroupMember ,BMXError

Discussion

Get group member list,

Declared In

  • BMXGroupManager.h

Example:

- (void)getMembers {
    [[[BMXClient sharedClient] groupService] getMembers:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *groupList, BMXError *error) {
- (void)getMembers {
    [[[BMXClient sharedClient] groupService] getMembers:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *groupList, BMXError *error) {
- (void)getMembers {
    [[[BMXClient sharedClient] groupService] getMembers:self.currentGroup forceRefresh:NO completion:^(NSArray<BMXGroupMember *> *groupList, BMXError *error) {
- (void)getMembers {
    [[[BMXClient sharedClient] groupService] getMembers:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *groupList, BMXError *error) {
- (void)getMembers {
    [[[BMXClient sharedClient] groupService] getMembers:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *groupList, BMXError *error) {
- (void)getMembers {
    [[[BMXClient sharedClient] groupService] getMembers:self.group forceRefresh:YES completion:^(NSArray<BMXGroupMember *> *groupList, BMXError *error) {

getMembersNickName:memberIdlist:completion:

Get group member nicknames in batch

- (void)getMembersNickName:(BMXGroup *)*group* memberIdlist:(NSArray<NSNumber*> *)*memberIdlist* completion:(void ( ^ ) ( NSArray *aGroupMembers , BMXError *aError ))*aCompletionBlock*

Discussion

Get group member nicknames in batch

Declared In

  • BMXGroupManager.h

Example:

getSharedFilesListByGroup:forceRefresh:completion:

Get a list of share files in group

- (void)getSharedFilesListByGroup:(BMXGroup *)*group* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray<BMXGroupSharedFile*> *sharedFileList , BMXError *error ))*aCompletionBlock*

Discussion

Get a list of share files in group

Declared In

  • BMXGroupManager.h

Example:

- (void)get {
    [[[BMXClient sharedClient ] groupService] getSharedFilesListByGroup:self.group forceRefresh:YES

getbannedMemberListGroup:cursor:pageSize:completion:

Paged to get ban list

- (void)getbannedMemberListGroup:(BMXGroup *)*group* cursor:(NSString *)*cursor* pageSize:(int)*pageSize* completion:(void ( ^ ) ( NSArray *memberList , NSString *cursor , long long offset , BMXError *error ))*aCompletionBlock*

Parameters

cursor
string

pageSize
int

aCompletionBlock
NSArray *memberList

Discussion

Paged to get ban list

Declared In

  • BMXGroupManager.h

Example:

joinGroup:message:completion:

Join a group, which may require admin approval depending on group settings

- (void)joinGroup:(BMXGroup *)*group* message:(NSString *)*message* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

message
Membership application information

aCompletionBlock
Error

Discussion

Join a group, which may require admin approval depending on group settings

Declared In

  • BMXGroupManager.h

Example:

leaveGroup:completion:

Quit group

- (void)leaveGroup:(BMXGroup *)*group* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

aCompletionBlock
Error

Discussion

Quit group

Declared In

  • BMXGroupManager.h

Example:

- (void)leaveGroup {
    [[[BMXClient sharedClient] groupService] leaveGroup:self.group completion:^(BMXError *error) {

loadGroupInfo:completion:

Get group details, pull the latest information from server

- (void)loadGroupInfo:(BMXGroup *)*group* completion:(void ( ^ ) ( BMXGroup *group , BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

aCompletionBlock
BMXGroup,BMXError

Discussion

Get group details, pull the latest information from server

Declared In

  • BMXGroupManager.h

Example:

- (void)getGroupDetailInfo {
    [[[BMXClient sharedClient] groupService] loadGroupInfo:self.group completion:^(BMXGroup *group, BMXError *error) {

muteMessageByGroup:msgMuteMode:completion:

Block group message

- (void)muteMessageByGroup:(BMXGroup *)*group* msgMuteMode:(BMXGroupMsgMuteMode)*msgMuteMode* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Block group message

Declared In

  • BMXGroupManager.h

Example:

-(void)setMsgMuteModeBy:(BMXGroupMsgMuteMode)mode {
    [[[BMXClient sharedClient] groupService] muteMessageByGroup:self.group msgMuteMode:mode completion:^(BMXError *error) {

removeAdmins:admins:reason:completion:

Remove admin

- (void)removeAdmins:(BMXGroup *)*group* admins:(NSArray<NSNumber*> *)*admins* reason:(NSString *)*reason* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

admins
Array:id

reason
String

aCompletionBlock
BMXError

Discussion

Remove admin

Declared In

  • BMXGroupManager.h

Example:

-(void) dealWithMembersWithSection:(NSInteger) section Row:(NSInteger) row
{
    if(section == 0) {// 取消管理
        NSString* uid = [self.adminUidArray objectAtIndex:row];
        NSNumber *uidnumber = [NSNumber numberWithLongLong:[uid longLongValue]];
        [[[BMXClient sharedClient] groupService] removeAdmins:self.group admins:@[uidnumber] reason:NSLocalizedString(@"Add_admin", @"添加管理") completion:^(BMXError *error) {

removeDelegate:

- (void)removeDelegate:(id<BMXGroupServiceProtocol>)*aDelegate*

Example:

removeGroupListener:

Remove group change listener

- (void)removeGroupListener:(id<BMXGroupServiceProtocol>)*listener*

Discussion

Remove group change listener

Declared In

  • BMXGroupManager.h

Example:

removeMembersWithGroup:memberlist:reason:completion:

Remove group member

- (void)removeMembersWithGroup:(BMXGroup *)*group* memberlist:(NSArray<NSNumber*> *)*memberList* reason:(NSString *)*reason* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
BMXGroup

memberList
memberlist

reason
reason

aCompletionBlock
BMXError

Discussion

Remove group member

Declared In

  • BMXGroupManager.h

Example:

- (void)removeMembersWithMembersId:(NSArray*)membersId message:(NSString *)message {
    [[[BMXClient sharedClient] groupService] removeMembersWithGroup:self.group memberlist:membersId reason:message completion:^(BMXError *error) {
- (void)deleteR:(BMXRoster *)roster{
    NSNumber *s= [NSNumber numberWithLongLong: roster.rosterId];
    [[[BMXClient sharedClient] groupService]removeMembersWithGroup:self.group memberlist:@[s] reason:@"" completion:^(BMXError *error) {

removeSharedFileFromGroup:file:completion:

Remove shared file in group

- (void)removeSharedFileFromGroup:(BMXGroup *)*group* file:(BMXGroupSharedFile *)*file* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Remove shared file in group

Declared In

  • BMXGroupManager.h

Example:

setAllowMemberModifyWithGroup:enable:completion:

Set whether group members are allowed to set group information

- (void)setAllowMemberModifyWithGroup:(BMXGroup *)*group* enable:(BOOL)*enable* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
Group to operate on

enable
Whether allowed to operate

aCompletionBlock
BMXError

Discussion

Set whether group members are allowed to set group information

Declared In

  • BMXGroupManager.h

Example:

setAvatarWithGroup:avatarData:progress:completion:

Set group avatar

- (void)setAvatarWithGroup:(BMXGroup *)*group* avatarData:(NSData *)*avatarData* progress:(void ( ^ ) ( int progress , BMXError *error ))*aProgress* completion:(void ( ^ ) ( BMXGroup *resultGroup , BMXError *error ))*aCompletion*

Discussion

Set group avatar

Declared In

  • BMXGroupManager.h

Example:

[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
    UIImage *image = [photos firstObject];
    NSData *imageData = UIImagePNGRepresentation(image);
    [[[BMXClient sharedClient] groupService] setAvatarWithGroup:self.group avatarData:imageData progress:^(int progress, BMXError *error) {

setEnableReadAckWithGroup:enable:completion:

Set whether group message read acknowledgement is enabled

- (void)setEnableReadAckWithGroup:(BMXGroup *)*group* enable:(BOOL)*enable* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
Group to operate on

enable
Enable or not

aCompletionBlock
BMXError

Discussion

Set whether group message read acknowledgement is enabled

Declared In

  • BMXGroupManager.h

Example:

- (void)p_configEnableRecieveAck {
    [[[BMXClient sharedClient] groupService] setEnableReadAckWithGroup:self.group enable:!self.group.enableReadAck completion:^(BMXError *error) {

setGroupDescription:description:completion:

Set group description

- (void)setGroupDescription:(BMXGroup *)*group* description:(NSString *)*description* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Set group description

Declared In

  • BMXGroupManager.h

Example:

setGroupExtensionWithGroup:extension:completion:

Set group extension information

- (void)setGroupExtensionWithGroup:(BMXGroup *)*group* extension:(NSString *)*extension* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Set group extension information

Declared In

  • BMXGroupManager.h

Example:

setGroupName:name:completion:

Set group name

- (void)setGroupName:(BMXGroup *)*group* name:(NSString *)*name* completion:(void ( ^ ) ( BMXGroup *group , BMXError *error ))*aCompletionBlock*

Discussion

Set group name

Declared In

  • BMXGroupManager.h

Example:

-(void) touchedRightBar {
    [[[BMXClient sharedClient] groupService] setGroupName:self.group name:_textField.text completion:^(BMXGroup *group, BMXError *error) {

setHistoryVisibleWithGroup:enable:completion:

Set whether group members are allowed to enable visible message history

- (void)setHistoryVisibleWithGroup:(BMXGroup *)*group* enable:(BOOL)*enable* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

group
Group to operate on

enable
Enable or not

aCompletionBlock
BMXError

Discussion

Set whether group members are allowed to enable visible message history

Declared In

  • BMXGroupManager.h

Example:

setInviteModeWithGroup:mode:completion:

Set invitation mode

- (void)setInviteModeWithGroup:(BMXGroup *)*group* mode:(BMXGroupInviteMode)*inviteMode* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Set invitation mode

Declared In

  • BMXGroupManager.h

Example:

- (void)invitmodeWith:(BMXGroupInviteMode)mode {
    [[[BMXClient sharedClient] groupService] setInviteModeWithGroup:self.group mode:mode completion:^(BMXError *error) {

setJoinAuthModeWithGroup:joinAuthMode:completion:

Set approval mode for joining group

- (void)setJoinAuthModeWithGroup:(BMXGroup *)*group* joinAuthMode:(BMXGroupJoinAuthMode)*mode* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Set approval mode for joining group

Declared In

  • BMXGroupManager.h

Example:

- (void)joinAuthWith:(BMXGroupJoinAuthMode)mode {
    [[[BMXClient sharedClient] groupService] setJoinAuthModeWithGroup:self.group joinAuthMode:mode completion:^(BMXError *error) {

setMsgPushModeWithGroup:mode:completion:

Set group message notification mode

- (void)setMsgPushModeWithGroup:(BMXGroup *)*group* mode:(BMXGroupMsgPushMode)*mode* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Set group message notification mode

Declared In

  • BMXGroupManager.h

Example:

- (void)groupNofiyWith:(BMXGroupMsgPushMode)mode {
    [[[BMXClient sharedClient] groupService] setMsgPushModeWithGroup:self.group mode:mode completion:^(BMXError *error) {

setMyNicknameWithGroup:nickName:completion:

Set nickname in group

- (void)setMyNicknameWithGroup:(BMXGroup *)*group* nickName:(NSString *)*nickName* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Set nickname in group

Declared In

  • BMXGroupManager.h

Example:

handler:^(UIAlertAction * action) {
    //响应事件
    //得到文本信息
    for(UITextField *text in alert.textFields){
        MAXLog(@"text = %@", text.text);
        [[[BMXClient sharedClient] groupService] setMyNicknameWithGroup:self.group nickName:text.text completion:^(BMXError *error) {

transferOwnerByGroup:newOwnerId:completion:

Transfer of group Owner

- (void)transferOwnerByGroup:(BMXGroup *)*group* newOwnerId:(long long)*newOwnerId* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Transfer of group Owner

Declared In

  • BMXGroupManager.h

Example:

-(void) transferOwner
{
    BMXRoster* roster = [self.memberList objectAtIndex:_selectedIndex];
    [[[BMXClient sharedClient] groupService] transferOwnerByGroup:self.group newOwnerId:roster.rosterId completion:^(BMXError *error) {

unbanGroup:completion:

Unban all members

- (void)unbanGroup:(BMXGroup *)*group* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Unban all members

Declared In

  • BMXGroupManager.h

Example:

- (void)p_configBanGroup {
    void(^aCompletionBlock)(BMXError *error) =^(BMXError *error) {
        if (error == nil) {
            MAXLog(@"设置成功");
            [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
            [self.tableView reloadData];
        } else {
            [HQCustomToast showDialog:error.errorMessage];
        }
    };
    if (self.isGroupBanned){
        [[[BMXClient sharedClient] groupService] unbanGroup:self.group completion:aCompletionBlock];

unbanMembersByGroup:members:reason:completion:

Unban

- (void)unbanMembersByGroup:(BMXGroup *)*group* members:(NSArray<NSNumber*> *)*members* reason:(NSString *)*reason* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Unban

Declared In

  • BMXGroupManager.h

Example:

-(void) removeMuteListWithIds: (NSArray*) uids
{
    [[[BMXClient sharedClient] groupService] unbanMembersByGroup:self.group  members:uids reason:@"unmute member" completion:^(BMXError *error) {

unblockMember:members:completion:

Unblacklist

- (void)unblockMember:(BMXGroup *)*group* members:(NSArray<NSNumber*> *)*members* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Unblacklist

Declared In

  • BMXGroupManager.h

Example:

-(void) removeBlackList: (NSArray*) uids
{
    [[[BMXClient sharedClient] groupService] unblockMember:self.group members:uids completion:^(BMXError *error) {

uploadSharedFileToGroup:filePathStr:displayName:extionName:progress:completion:

Add shared file in group

- (void)uploadSharedFileToGroup:(BMXGroup *)*group* filePathStr:(NSString *)*filePathStr* displayName:(NSString *)*displayName* extionName:(NSString *)*extionName* progress:(void ( ^ ) ( int progress , BMXError *error ))*aProgress* completion:(void ( ^ ) ( BMXGroup *resultGroup , BMXError *error ))*aCompletion*

Discussion

Add shared file in group

Declared In

  • BMXGroupManager.h

Example:

© 2019-2023 MaximTop | Homepage Last modified time: 2022-09-21 11:43:07

results matching ""

    No results matching ""