BMXUserManager Protocol Reference

Conforms to NSObject
Declared in BMXUserManager.h

Instance Methods

addDelegate:

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

bindDevice:completion:

Binding device push token

- (void)bindDevice:(NSString *)*token* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Binding device push token

Declared In

  • BMXUserManager.h

Example:

- (void)bindDeviceToken {
    NSString *deviceToken = [[NSUserDefaults standardUserDefaults] valueForKey:@"deviceToken"];
    if ([deviceToken length]) {
        [[[BMXClient sharedClient] userService] bindDevice:deviceToken completion:^(BMXError *error) {
- (void)bindDeviceToken {
    NSString *deviceToken = [[NSUserDefaults standardUserDefaults] valueForKey:@"deviceToken"];
    if ([deviceToken length]) {
        [[[BMXClient sharedClient] userService] bindDevice:deviceToken completion:^(BMXError *error) {

deleteDeviceByDeviceSN:completion:

Delete device

- (void)deleteDeviceByDeviceSN:(NSInteger)*deviceSN* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Delete device

Declared In

  • BMXUserManager.h

Example:

UITableViewRowAction *deleteRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:NSLocalizedString(@"Delete", @"删除")handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
    BMXDevice *device = self.deviceListArray[indexPath.row];
    [[[BMXClient sharedClient] userService] deleteDeviceByDeviceSN:device.deviceSN completion:^(BMXError *error) {
- (void)deviceTableViewCelldidClickButtonWithDevice:(BMXDevice *)device {
    [[[BMXClient sharedClient] userService] deleteDeviceByDeviceSN:device.deviceSN completion:^(BMXError *error) {

downloadAvatarWithProfile:thumbnail:progress:completion:

Download avatar

- (void)downloadAvatarWithProfile:(BMXUserProfile *)*profile* thumbnail:(BOOL)*thumbnail* progress:(void ( ^ ) ( int progress , BMXError *error ))*aProgress* completion:(void ( ^ ) ( BMXUserProfile *profile , BMXError *error ))*aCompletion*

Parameters

profile
User information

aProgress
Download progress

aCompletion
Callback

Discussion

Download avatar

Declared In

  • BMXUserManager.h

Example:

[[[BMXClient sharedClient] userService] getProfileForceRefresh:YES completion:^(BMXUserProfile *profile, BMXError *aError) {
    if (!aError) {
        IMAcount *account = [IMAcountInfoStorage loadObject];
        account.usedId = [NSString stringWithFormat:@"%lld", profile.userId];
        account.userName = profile.userName;
        [IMAcountInfoStorage saveObject:account];
        account.appid = [[BMXClient sharedClient] sdkConfig].appID;
        [self saveAccountToLoaclListWithaccount:account];
            
        [[[BMXClient sharedClient] userService] downloadAvatarWithProfile:profile thumbnail:YES progress:^(int progress, BMXError *error) {
- (void)configUserCodeAndContent {
    self.idLabel.text = [NSString stringWithFormat:@"id : %lld", self.profile.userId];
    self.nameLabel.text = [NSString stringWithFormat:NSLocalizedString(@"Nickname_name", @"昵称 : %@"), self.profile.userName];
    
    self.avatarImageView.image = [UIImage imageNamed:@"profileavatar"];
    
    if ([[NSFileManager defaultManager] fileExistsAtPath:self.profile.avatarThumbnailPath]) {
        UIImage *avarat = [UIImage imageWithContentsOfFile:self.profile.avatarThumbnailPath];
        self.avatarImageView.image = avarat;
    } else {
        [[[BMXClient sharedClient] userService] downloadAvatarWithProfile:self.profile thumbnail:YES progress:^(int progress, BMXError *error) {
- (void)getSelfAvatar:(BMXUserProfile *)profile {
    UIImage *avarat = [UIImage imageWithContentsOfFile:profile.avatarThumbnailPath];
    if (avarat) {
        self.selfImage  = avarat;
    }else {
        [[[BMXClient sharedClient] userService] downloadAvatarWithProfile:profile thumbnail:YES progress:^(int progress, BMXError *error) {
[[[BMXClient sharedClient] userService] getProfileForceRefresh:YES completion:^(BMXUserProfile *profile, BMXError *aError) {
    if (!aError) {
        IMAcount *account = [IMAcountInfoStorage loadObject];
        account.usedId = [NSString stringWithFormat:@"%lld", profile.userId];
        account.userName = profile.userName;
        [IMAcountInfoStorage saveObject:account];
        account.appid = [[BMXClient sharedClient] sdkConfig].appID;
        [self saveAccountToLoaclListWithaccount:account];
            
        [[[BMXClient sharedClient] userService] downloadAvatarWithProfile:profile thumbnail:YES progress:^(int progress, BMXError *error) {
- (void)userInfoDidUpdated:(BMXUserProfile *)userProflie {
    MAXLog(@"用户信息改变");
    [[[BMXClient sharedClient] userService] downloadAvatarWithProfile:userProflie thumbnail:YES  progress:^(int progress, BMXError *error) {
//        self.subTitleLabel.text = @"个性签名:赶快去更新签名吧";
//
//    }
//    [self.subTitleLabel sizeToFit];

    
    UIImage *avarat = [UIImage imageWithContentsOfFile:profile.avatarThumbnailPath];
    if (avarat) {
        self.avatarImageView.image  = avarat;
    }else {
        [[[BMXClient sharedClient] userService] downloadAvatarWithProfile:profile thumbnail:YES  progress:^(int progress, BMXError *error) {

getDeviceListCompletion:

Get device list

- (void)getDeviceListCompletion:(void ( ^ ) ( BMXError *error , NSArray *deviceList ))*aCompletionBlock*

Discussion

Get device list

Declared In

  • BMXUserManager.h

Example:

- (void)getDeviceList {
    [[[BMXClient sharedClient] userService] getDeviceListCompletion:^(BMXError *error, NSArray *deviceList) {

getProfileForceRefresh:completion:

Get user details

- (void)getProfileForceRefresh:(BOOL)*forceRefresh* completion:(void ( ^ ) ( BMXUserProfile *profile , BMXError *aError ))*aCompletionBlock*

Discussion

Get user details

Declared In

  • BMXUserManager.h

Example:

- (void)getProfile {
    [[[BMXClient sharedClient] userService] getProfileForceRefresh:YES completion:^(BMXUserProfile *profile, BMXError *aError) {
- (void)getProfile {
    
    [[[BMXClient sharedClient] userService] getProfileForceRefresh:NO completion:^(BMXUserProfile *profile, BMXError *aError) {
- (void)getMyProfile {
    [[[BMXClient sharedClient] userService] getProfileForceRefresh:NO completion:^(BMXUserProfile *profile, BMXError *aError) {
- (void)getProfile{
    [[[BMXClient sharedClient] userService] getProfileForceRefresh:YES completion:^(BMXUserProfile *profile, BMXError *aError) {
- (void)getprofile {
    [[[BMXClient sharedClient] userService] getProfileForceRefresh:YES completion:^(BMXUserProfile *profile, BMXError *aError) {
- (void)viewDidLoad {
    [super viewDidLoad];
    
//    [self setMainNavigationBarTitle:self.roster.userName];
    
    
    
    [self setNavigationBarTitle:self.roster.userName navLeftButtonIcon:@"blackback" navRightButtonTitle:nil];
    
    
    
    [[[BMXClient sharedClient] userService] getProfileForceRefresh:NO completion:^(BMXUserProfile *profile, BMXError *aError) {
- (void)getprofileWithToast:(BOOL)isNeed {
    if (isNeed == YES) {
        [HQCustomToast showWating];
    }
    [[[BMXClient sharedClient] userService] getProfileForceRefresh:NO completion:^(BMXUserProfile *profile, BMXError *aError) {
- (void)getprofile {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] userService] getProfileForceRefresh:NO completion:^(BMXUserProfile *profile, BMXError *aError) {

removeDelegate:

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

Example:

setAddFriendAuthMode:completion:

Set method to validate when adding friend

- (void)setAddFriendAuthMode:(BMXAddFriendAuthMode)*addFriendAuthMode* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

addFriendAuthMode
BMXAddFriendAuthMode

Discussion

Set method to validate when adding friend

Declared In

  • BMXUserManager.h

Example:

- (void)setAddFriendAuth:(BMXAddFriendAuthMode)mode {
    [[[BMXClient sharedClient] userService] setAddFriendAuthMode:mode completion:^(BMXError *error) {

setAuthQuestion:completion:

Set friend authentication questions

- (void)setAuthQuestion:(BMXAuthQuestion *)*authQuestion* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

authQuestion
BMXAuthQuestion

Discussion

Set friend authentication questions

Declared In

  • BMXUserManager.h

Example:

- (void)setQuestion:(NSString *)question answer:(NSString *)answer {
    BMXAuthQuestion *qustionModel = [[BMXAuthQuestion alloc] init];
    qustionModel.mQuestion = question;
    qustionModel.mAnswer = answer;
    
    [[[BMXClient sharedClient] userService] setAuthQuestion:qustionModel completion:^(BMXError *error) {

setAutoAcceptGroupInvite:completion:

Set whether to automatically accept group invitations

- (void)setAutoAcceptGroupInvite:(BOOL)*autoAcceptGroupInvite* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

autoAcceptGroupInvite
BOOL

Discussion

Set whether to automatically accept group invitations

Declared In

  • BMXUserManager.h

Example:

            [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
        }
    }];
} else if ([str isEqualToString:NSLocalizedString(@"Whether_to_download_thumbnail_attachments_automatically", @"是否自动下载缩略图附件")]) {
    [[[BMXClient sharedClient] userService] setAutoDownloadAttachment:state completion:^(BMXError *error) {
        if (!error) {
            [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
        }
    }];
} else if ([str isEqualToString:NSLocalizedString(@"Whether_to_accept_group_invitation_automatically", @"是否自动接受群邀请")]) {
    [[[BMXClient sharedClient] userService] setAutoAcceptGroupInvite:state completion:^(BMXError *error) {

setAutoDownloadAttachment:completion:

Set whether to automatically download thumbnail and voice attachment

- (void)setAutoDownloadAttachment:(BOOL)*autoDownloadAttachment* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

autoDownloadAttachment
BOOL

Discussion

Set whether to automatically download thumbnail and voice attachment

Declared In

  • BMXUserManager.h

Example:

            [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
        }
    }];
} else if ([str isEqualToString:NSLocalizedString(@"Whether_to_push_details", @"是否推送详情")]) {
    [[[BMXClient sharedClient] userService] setEnablePushDetail:state completion:^(BMXError *error) {
        if (!error) {
            [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
        }
    }];
} else if ([str isEqualToString:NSLocalizedString(@"Whether_to_download_thumbnail_attachments_automatically", @"是否自动下载缩略图附件")]) {
    [[[BMXClient sharedClient] userService] setAutoDownloadAttachment:state completion:^(BMXError *error) {

setEnablePushDetail:completion:

Set whether to push details

- (void)setEnablePushDetail:(BOOL)*enablePushDetail* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

enablePushDetail
BOOL

Discussion

Set whether to push details

Declared In

  • BMXUserManager.h

Example:

            [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
        }
    }];
} else if ([str isEqualToString:NSLocalizedString(@"Sound", @"声音")]) {
    [[[BMXClient sharedClient] userService] setNotificationSound:state completion:^(BMXError *error) {
        if (!error) {
            [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
        }
    }];
} else if ([str isEqualToString:NSLocalizedString(@"Whether_to_push_details", @"是否推送详情")]) {
    [[[BMXClient sharedClient] userService] setEnablePushDetail:state completion:^(BMXError *error) {

setEnablePushStatus:completion:

Set whether push is allowed

- (void)setEnablePushStatus:(BOOL)*enablePushStatus* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

enablePushStatus
BOOL

Discussion

Set whether push is allowed

Declared In

  • BMXUserManager.h

Example:

- (void)cellDidchangeSwitchStatus:(UISwitch *)mswtich cell:(TitleSwitchTableViewCell *)cell {
    NSIndexPath *indexPath = [self indexPathForCell:cell];
    NSDictionary *dic = self.cellDataArray[indexPath.section*2 + indexPath.row];
    NSString *str = dic[@"type"];
    BOOL state = mswtich.on ? YES : NO;
    
   if ([str isEqualToString:NSLocalizedString(@"Accept_new_message_notification", @"接受新消息通知")]) {
        [[[BMXClient sharedClient] userService] setEnablePushStatus:state completion:^(BMXError *error) {

setNickname:completion:

Set nickname

- (void)setNickname:(NSString *)*nickname* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Set nickname

Declared In

  • BMXUserManager.h

Example:

- (void)modifyNickname:(NSString *)nickname {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] userService] setNickname:nickname completion:^(BMXError *error) {

setNotificationSound:completion:

Set whether a new message is audibly alerted

- (void)setNotificationSound:(BOOL)*notificationSound* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

notificationSound
BOO

Discussion

Set whether a new message is audibly alerted

Declared In

  • BMXUserManager.h

Example:

- (void)cellDidchangeSwitchStatus:(UISwitch *)mswtich cell:(TitleSwitchTableViewCell *)cell {
    NSIndexPath *indexPath = [self indexPathForCell:cell];
    NSDictionary *dic = self.cellDataArray[indexPath.section*2 + indexPath.row];
    NSString *str = dic[@"type"];
    BOOL state = mswtich.on ? YES : NO;
    
   if ([str isEqualToString:NSLocalizedString(@"Accept_new_message_notification", @"接受新消息通知")]) {
        [[[BMXClient sharedClient] userService] setEnablePushStatus:state completion:^(BMXError *error) {
            if (!error) {
                [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
            }
        }];
    } else if ([str isEqualToString:NSLocalizedString(@"Vibrate", @"震动")]) {
        [[[BMXClient sharedClient] userService] setNotificationVibrate:state completion:^(BMXError *error) {
            if (!error) {
                [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
            }
        }];
    } else if ([str isEqualToString:NSLocalizedString(@"Sound", @"声音")]) {
        [[[BMXClient sharedClient] userService] setNotificationSound:state completion:^(BMXError *error) {

setNotificationVibrate:completion:

Set whether a new message is alerted in vibration

- (void)setNotificationVibrate:(BOOL)*notificationVibrate* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

notificationVibrate
BOOL

Discussion

Set whether a new message is alerted in vibration

Declared In

  • BMXUserManager.h

Example:

- (void)cellDidchangeSwitchStatus:(UISwitch *)mswtich cell:(TitleSwitchTableViewCell *)cell {
    NSIndexPath *indexPath = [self indexPathForCell:cell];
    NSDictionary *dic = self.cellDataArray[indexPath.section*2 + indexPath.row];
    NSString *str = dic[@"type"];
    BOOL state = mswtich.on ? YES : NO;
    
   if ([str isEqualToString:NSLocalizedString(@"Accept_new_message_notification", @"接受新消息通知")]) {
        [[[BMXClient sharedClient] userService] setEnablePushStatus:state completion:^(BMXError *error) {
            if (!error) {
                [HQCustomToast showDialog:NSLocalizedString(@"Set_successfully", @"设置成功")];
            }
        }];
    } else if ([str isEqualToString:NSLocalizedString(@"Vibrate", @"震动")]) {
        [[[BMXClient sharedClient] userService] setNotificationVibrate:state completion:^(BMXError *error) {

setPrivateInfo:completion:

Set private extension information

- (void)setPrivateInfo:(NSString *)*privateInfo* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

privateInfo
string

Discussion

Set private extension information

Declared In

  • BMXUserManager.h

Example:

- (void)setPrivateInfo:(NSString *)info {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] userService] setPrivateInfo:info completion:^(BMXError *error) {

setPublicInfo:completion:

Set public extension information

- (void)setPublicInfo:(NSString *)*publicInfo* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Parameters

publicInfo
string

Discussion

Set public extension information

Declared In

  • BMXUserManager.h

Example:

- (void)setpublicInfo:(NSString *)info {
    [HQCustomToast showWating];
    [[[BMXClient sharedClient] userService] setPublicInfo:info completion:^(BMXError *error) {

setsetPushNickname:completion:

Set push nickname

- (void)setsetPushNickname:(NSString *)*nickname* completion:(void ( ^ ) ( BMXError *error ))*aCompletionBlock*

Discussion

Set push nickname

Declared In

  • BMXUserManager.h

Example:

uploadAvatarWithData:progress:

Upload avatar

- (void)uploadAvatarWithData:(NSData *)*avatarData* progress:(void ( ^ ) ( int progress , BMXError *error ))*aProgressBlock*

Parameters

avatarData
Avatar

aProgressBlock
Upload progress

Discussion

Upload avatar

Declared In

  • BMXUserManager.h

Example:

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

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

results matching ""

    No results matching ""