更新时间:2024-06-28 GMT+08:00
上传个人头像
uploadSelfAvatarWithFilePath:callback:
接口描述
该接口用于上传用户自己头像。
注意事项
- 文件路径为头像路径。
- 大小限制200k。
- 只支持jpg、png。
- 为了头像展示效果,建议图片宽高比为1:1。
- 回调error表示错误信息,nil表示成功。
方法定义
1 | - (void)uploadSelfAvatarWithFilePath:(NSString *_Nullable)filePath callback:(_Nonnull HWMSDKCompleteHandler)callback; |
参数描述
参数 | 是否必须 | 类型 | 描述 |
|---|---|---|---|
filePath | 否 | NSString * | 头像文件路径 |
返回值
无
示例代码
1 2 3 4 5 6 7 8 9 10 | /// 上传用户个人头像 - (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:@"上传成功"]; } }]; } |
父主题:账号操作

