华为云会议 Meeting-上传个人头像:uploadSelfAvatarWithFilePath:callback:

时间:2025-02-12 15:11:43

uploadSelfAvatarWithFilePath:callback:

接口描述

该接口用于上传用户自己头像。

注意事项

  1. 文件路径为头像路径。
  2. 大小限制200k。
  3. 只支持jpg、png。
  4. 为了头像展示效果,建议图片宽高比为1:1。
  5. 回调error表示错误信息,nil表示成功。

方法定义

1
- (void)uploadSelfAvatarWithFilePath:(NSString *_Nullable)filePath callback:(_Nonnull HWMSDKCompleteHandler)callback;

参数描述

表1

参数

是否必须

类型

描述

filePath

NSString *

头像文件路径

返回值

示例代码

 1 2 3 4 5 6 7 8 910
/// 上传用户个人头像- (void)uploadSelfAvatar {    [[HWMBizSdk getBizOpenApi] uploadSelfAvatarWithFilePath:self.headImgPath callback:^(NSError * _Nullable error, id  _Nullable result) {        if (error) {            [UIUtil showMessage:[NSString stringWithFormat:@"上传失败%@", error.localizedDescription]];        } else {            [UIUtil showMessage:@"上传成功"];        }    }];}
support.huaweicloud.com/sdkreference-meeting/ios_login_0002.html