BMXRosterManager Protocol Reference

Conforms to NSObject
Declared in BMXRosterManager.h

Instance Methods

acceptRosterById:withCompletion:

Accept adding friend request

- (void)acceptRosterById:(NSInteger)*rosterId* withCompletion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Accept adding friend request

Declared In

  • BMXRosterManager.h

Example:

- (void)acceptApplication:(NSInteger)rosterId {
    [[[BMXClient sharedClient] rosterService] acceptRosterById:rosterId withCompletion:^(BMXError *error) {
- (void)acceptAddRosterById:(NSInteger)rosterId {
    [[[BMXClient sharedClient] rosterService] acceptRosterById:rosterId withCompletion:^(BMXError *error) {

addDelegate:

- (void)addDelegate:(id<BMXRosterServiceProtocol>)*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<BMXRosterServiceProtocol>)*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()];

addRosterListener:

Add friend change listener

- (void)addRosterListener:(id<BMXRosterServiceProtocol>)*listener*

Discussion

Add friend change listener

Declared In

  • BMXRosterManager.h

Example:

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpNavItem];
    [self selectView];
    [self rosterListTableView];
    [self getAllRoster];
    [self actionArray];
    [self.rosterListTableView reloadData];
    
    
    [self configSupportData];
    
    [[[BMXClient sharedClient] rosterService] addRosterListener:self];

addToBlockList:withCompletion:

Add to blacklist

- (void)addToBlockList:(long long)*rosterId* withCompletion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Add to blacklist

Declared In

  • BMXRosterManager.h

Example:

- (void)addToBlackList:(NSInteger)userId {
    [[[BMXClient sharedClient] rosterService] addToBlockList:userId
- (void)addToBlackList:(NSString *)userId {
    [[[BMXClient sharedClient] rosterService] addToBlockList:[userId integerValue] withCompletion:^(BMXError *error) {

applyAddRoster:reason:completion:

Request to add friend

- (void)applyAddRoster:(long long)*roster* reason:(NSString *)*reason* completion:(void ( ^ ) ( BMXRoster *roster , BMXError *error ))*aCompletionBlock*

Discussion

Request to add friend

Declared In

  • BMXRosterManager.h

Example:

- (void)addRosterId:(long long)rosterId reason:(NSString *)reason {
    MAXLog(@"%@", [[BMXClient sharedClient] rosterService]);
    [[[BMXClient sharedClient] rosterService] applyAddRoster:rosterId reason:reason completion:^(BMXRoster *roster, BMXError *error) {
- (void)addRosterId:(long long)rosterId reason:(NSString *)reason {
    MAXLog(@"%@", [[BMXClient sharedClient] rosterService]);
    [[[BMXClient sharedClient] rosterService] applyAddRoster:rosterId reason:reason completion:^(BMXRoster *roster, BMXError *error) {

declineRosterById:withReason:completion:

Reject adding friend request

- (void)declineRosterById:(NSInteger)*rosterId* withReason:(NSString *)*reason* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Reject adding friend request

Declared In

  • BMXRosterManager.h

Example:

- (void)declineRosterById:(NSInteger)roster reason:(NSString *)reason {
    [[[BMXClient sharedClient] rosterService] declineRosterById:roster withReason:reason completion:^(BMXError *error) {

downloadAvatarWithRoster:progress:completion:

Download avatar

- (void)downloadAvatarWithRoster:(BMXRoster *)*roster* progress:(void ( ^ ) ( int progress , BMXError *error ))*aProgress* completion:(void ( ^ ) ( BMXRoster *roster , BMXError *error ))*aCompletion*

Discussion

Download avatar

Declared In

  • BMXRosterManager.h

Example:

getApplicationListWithCursor:pageSize:completion:

Get list of adding friend requests

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

Discussion

Get list of adding friend requests

Declared In

  • BMXRosterManager.h

Example:

- (void)getApplicationList {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] rosterService] getApplicationListWithCursor:@"" pageSize:50 completion:^(NSArray *applicationList, NSString *cursor, int offset, BMXError *error) {

getBlockListforceRefresh:completion:

  • Get blacklist

- (void)getBlockListforceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray *blockList , BMXError *error ))*aCompletionBlock*

Parameters

forceRefresh
If forceRefresh == true, force pull from server-side

aCompletionBlock
BlockList ,Error

Discussion

  • Get blacklist

Declared In

  • BMXRosterManager.h

Example:

- (void)getBlackList {
    if (self.tipView) {
        [self.tipView removeFromSuperview];
    }

    [[[BMXClient sharedClient] rosterService] getBlockListforceRefresh:YES completion:^(NSArray *blockList, BMXError *error) {

getRosterListforceRefresh:completion:

  • Get friend list

- (void)getRosterListforceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray *rostIdList , BMXError *error ))*aCompletionBlock*

Parameters

forceRefresh
If forceRefresh == true, force pull from server-side

aCompletionBlock
List of friends

Discussion

  • Get friend list

Declared In

  • BMXRosterManager.h

Example:

- (void)getRosterList {
    [[[BMXClient sharedClient] rosterService] getRosterListforceRefresh:YES completion:^(NSArray *rostIdList, BMXError *error) {
- (void)getAllRosterWithToast:(BOOL)isNeed {
    if (isNeed == YES) {
        [HQCustomToast showWating];
    }
    [[[BMXClient sharedClient] rosterService] getRosterListforceRefresh:NO completion:^(NSArray *rostIdList, BMXError *error) {
- (void)getAllRoster {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] rosterService] getRosterListforceRefresh:NO completion:^(NSArray *rostIdList, BMXError *error) {
- (void)getAllRoster {
    [[[BMXClient sharedClient] rosterService] getRosterListforceRefresh:YES completion:^(NSArray *rostIdList, BMXError *error) {
- (void)getAllRoster {
    [[[BMXClient sharedClient] rosterService] getRosterListforceRefresh:YES completion:^(NSArray *rostIdList, BMXError *error) {
- (void)getAllRoster {
    [[[BMXClient sharedClient] rosterService] getRosterListforceRefresh:NO completion:^(NSArray *rostIdList, BMXError *error) {
- (void)getAllRosterWithToast:(BOOL)isNeed {
    if (isNeed == YES) {
        [HQCustomToast showWating];
    }
    [[[BMXClient sharedClient] rosterService] getRosterListforceRefresh:NO completion:^(NSArray *rostIdList, BMXError *error) {
- (void)getAllRoster {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] rosterService] getRosterListforceRefresh:NO completion:^(NSArray *rostIdList, BMXError *error) {

muteNotificationByRoster:muteNotificationStatus:completion:

Set whether to reject user message

- (void)muteNotificationByRoster:(BMXRoster *)*roster* muteNotificationStatus:(BOOL)*muteNotificationStatus* completion:(void ( ^ ) ( BMXRoster *roster , BMXError *error ))*aCompletionBlock*

Discussion

Set whether to reject user message

Declared In

  • BMXRosterManager.h

Example:

- (void)cellDidchangeSwitchStatus:(UISwitch *)mswtich cell:(TitleSwitchTableViewCell *)cell {
    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
    NSDictionary *dic = self.cellDataArray[indexPath.row];
    NSString *str = dic[@"type"];
    BOOL state = mswtich.on ? YES : NO;
    if ([str isEqualToString:NSLocalizedString(@"Do-Not-Disturb", @"消息免打扰")]) {
        [[[BMXClient sharedClient] rosterService] muteNotificationByRoster:self.currentRoster muteNotificationStatus:state completion:^(BMXRoster *roster, BMXError *error) {

removeDelegate:

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

Example:

removeRosterById:withCompletion:

Delete friend

- (void)removeRosterById:(long long)*rostId* withCompletion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Delete friend

Declared In

  • BMXRosterManager.h

Example:

-  (void)removeRoster:(NSInteger)rosterId {
    MAXLog(@"删除好友");
    [[[BMXClient sharedClient] rosterService] removeRosterById:rosterId withCompletion:^(BMXError *error) {

removeRosterFromBlockList:withCompletion:

Remove from blacklist

- (void)removeRosterFromBlockList:(NSInteger)*rostId* withCompletion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Remove from blacklist

Declared In

  • BMXRosterManager.h

Example:

- (void)removeRoster:(NSInteger)rosterId {
    [[[BMXClient sharedClient] rosterService] removeRosterFromBlockList:rosterId

removeRosterListener:

Remove friend change listener

- (void)removeRosterListener:(id<BMXRosterServiceProtocol>)*listener*

Discussion

Remove friend change listener

Declared In

  • BMXRosterManager.h

Example:

searchByRoserName:forceRefresh:completion:

Search by friend Name

- (void)searchByRoserName:(NSString *)*name* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( BMXRoster *roster , BMXError *error ))*aCompletionBlock*

Parameters

name
Friend name

aCompletionBlock
Friend

Discussion

Search by friend Name

Declared In

  • BMXRosterManager.h

Example:

- (void)searchByName:(NSString *)name {
    MAXLog(@"通过名字搜索好友");
    [[[BMXClient sharedClient]  rosterService] searchByRoserName:name forceRefresh:NO completion:^(BMXRoster *roster, BMXError *error) {

searchByRosterId:forceRefresh:completion:

Search by friend ID

- (void)searchByRosterId:(long long)*rosterId* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( BMXRoster *roster , BMXError *error ))*aCompletionBlock*

Parameters

rosterId
Friend ID

aCompletionBlock
Friend

Discussion

Search by friend ID

Declared In

  • BMXRosterManager.h

Example:

- (void)loadAccountData {
    NSArray *list = [AccountListStorage loadObject];
    self.accountArray = list;
    IMAcount *a = self.accountArray[0];
    [[[BMXClient sharedClient] rosterService] searchByRosterId:[a.usedId integerValue] forceRefresh:YES completion:^(BMXRoster *roster, BMXError *error) {
[[[BMXClient sharedClient] rosterService] updateItemAliasByRoster:self.currentRoster aliasJson:name completion:^(BMXRoster *roster, BMXError *error) {
    if (!error) {
        [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
        [[[BMXClient sharedClient] rosterService] searchByRosterId:self.currentRoster.rosterId forceRefresh:YES completion:^(BMXRoster *roster, BMXError *error) {
[[[BMXClient sharedClient] rosterService] updateItemExtensionByRoster:self.currentRoster extensionJson:ext completion:^(BMXRoster *roster, NSString *extensionJson) {
    [[[BMXClient sharedClient] rosterService] searchByRosterId:self.currentRoster.rosterId forceRefresh:YES completion:^(BMXRoster *roster, BMXError *error) {
- (void)getRosterInfo {
    [[[BMXClient sharedClient] rosterService] searchByRosterId:self.currentRoster.rosterId forceRefresh:YES completion:^(BMXRoster *roster, BMXError *error) {
            
        if (messageModel.messageObjc.isReadAcked == YES) {
            messageCell.readStatusLabel.text = NSLocalizedString(@"Read", @"已读");
        } else {
            messageCell.readStatusLabel.text = NSLocalizedString(@"Unread", @"未读");
        }
    }
        
} else {
    __weak  LHChatViewCell *weakCell = messageCell;
    [[[BMXClient sharedClient] rosterService] searchByRosterId:messageModel.messageObjc.fromId forceRefresh:NO completion:^(BMXRoster *roster, BMXError *error) {
            }
        }
    }];
}
    
if (self.messageType == BMXMessageTypeGroup) {
        
    messageModel.isChatGroup = YES;
        
    __weak  LHChatViewCell *weakCell = messageCell;
    [[[BMXClient sharedClient] rosterService] searchByRosterId:messageModel.messageObjc.fromId  forceRefresh:NO completion:^(BMXRoster *roster, BMXError *error) {
        } else {
//            if (messageModel.messageObjct.enableGroupAck == YES) {
                messageCell.readStatusLabel.text = [NSString stringWithFormat:NSLocalizedString(@"npersons_have_read", @"%d人已读"), messageModel.messageObjc.groupAckCount];
//            } else {
//                messageCell.readStatusLabel.text = @"";
//
//            }
        }
    } else {
        __weak  LHChatViewCell *weakCell = messageCell;
        [[[BMXClient sharedClient] rosterService] searchByRosterId:messageModel.messageObjc.fromId forceRefresh:NO completion:^(BMXRoster *roster, BMXError *error) {
            }
        }
    }];
}
    
if (self.messageType == BMXMessageTypeGroup) {
        
    messageModel.isChatGroup = YES;
        
    __weak  LHChatViewCell *weakCell = messageCell;
    [[[BMXClient sharedClient] rosterService] searchByRosterId:messageModel.messageObjc.fromId forceRefresh:NO completion:^(BMXRoster *roster, BMXError *error) {

searchRostersByRosterIdList:forceRefresh:completion:

Batch search for users

- (void)searchRostersByRosterIdList:(NSArray<NSNumber*> *)*rosterIdList* forceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( NSArray<BMXRoster*> *rosterList , BMXError *error ))*aCompletionBlock*

Parameters

rosterIdList
id

forceRefresh
If forceRefresh == true, force pull from server-side

aCompletionBlock
rosterList,error

Discussion

Batch search for users

Declared In

  • BMXRosterManager.h

Example:

- (void)getSupportListProfileWithArray:(NSArray *)array {
    [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:array forceRefresh:NO completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {
- (void)searchRostersByidArray:(NSArray *)idArray {
    [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:idArray forceRefresh:NO completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {
- (void)searchRostersByidArray:(NSArray *)idArray {
    [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:idArray forceRefresh:YES completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {
- (void)getRostersByidArray:(NSArray *)idArray {
    [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:idArray forceRefresh:YES completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {
[[[BMXClient sharedClient] chatService] getGroupAckMessageUserIdListWithMessage:self.message completion:^(NSArray *groupMemberIdList, BMXError *error) {
    self.alreadyRosterIdArray = groupMemberIdList;
    [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:groupMemberIdList forceRefresh:NO completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {
[[[BMXClient sharedClient] chatService] getGroupAckMessageUnreadUserIdListWithMessage:self.message completion:^(NSArray *groupMemberIdList, BMXError *error) {
    [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:groupMemberIdList forceRefresh:NO completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {
- (void)searchRostersByidArray:(NSArray *)idArray {
    [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:idArray forceRefresh:YES completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {
- (void)getRostersByidArray:(NSArray *)idArray {
    [[[BMXClient sharedClient] rosterService] searchRostersByRosterIdList:idArray forceRefresh:YES completion:^(NSArray<BMXRoster *> *rosterList, BMXError *error) {

updateItemAliasByRoster:aliasJson:completion:

Update friend's alias

- (void)updateItemAliasByRoster:(BMXRoster *)*roster* aliasJson:(NSString *)*aliasJson* completion:(void ( ^ ) ( BMXRoster *roster , BMXError *error ))*aCompletionBlock*

Discussion

Update friend's alias

Declared In

  • BMXRosterManager.h

Example:

- (void)setalias:(NSString *)name {
    [[[BMXClient sharedClient] rosterService] updateItemAliasByRoster:self.currentRoster aliasJson:name completion:^(BMXRoster *roster, BMXError *error) {

updateItemExtensionByRoster:extensionJson:completion:

Update friend extension information

- (void)updateItemExtensionByRoster:(BMXRoster *)*roster* extensionJson:(NSString *)*extensionJson* completion:(void ( ^ ) ( BMXRoster *roster , NSString *extensionJson ))*aCompletionBlock*

Discussion

Update friend extension information

Declared In

  • BMXRosterManager.h

Example:

- (void)setExtension:(NSString *)ext {
    [[[BMXClient sharedClient] rosterService] updateItemExtensionByRoster:self.currentRoster extensionJson:ext completion:^(BMXRoster *roster, NSString *extensionJson) {

updateItemLocalExtensionByRoster:localExtensionJson:completion:

Update friend's local extension information

- (void)updateItemLocalExtensionByRoster:(BMXRoster *)*roster* localExtensionJson:(NSString *)*localExtensionJson* completion:(void ( ^ ) ( BMXRoster *roster , BMXError *error ))*aCompletionBlock*

Discussion

Update friend's local extension information

Declared In

  • BMXRosterManager.h

Example:

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

results matching ""

    No results matching ""