Help Center/
Meeting/
Client SDK Reference/
iOS SDK/
API Reference/
Account Operations/
Uploading a Profile Picture
Updated on 2024-07-30 GMT+08:00
Uploading a Profile Picture
uploadSelfAvatarWithFilePath:callback:
API Description
This API is used to upload a profile picture.
Precautions
- The file path is the profile picture path.
- The maximum size is 200 KB.
- Only JPG and PNG files are supported.
- The recommended aspect ratio is 1:1.
- error: Error information. nil: Success.
Method Definition
1
|
- (void)uploadSelfAvatarWithFilePath:(NSString *_Nullable)filePath callback:(_Nonnull HWMSDKCompleteHandler)callback; |
Parameter Description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
filePath |
No |
NSString * |
Profile picture file path. |
Return Values
None
Sample Code
1 2 3 4 5 6 7 8 9 10 |
/// Upload a profile picture. - (void)uploadSelfAvatar { [[HWMBizSdk getBizOpenApi] uploadSelfAvatarWithFilePath:self.headImgPath callback:^(NSError * _Nullable error, id _Nullable result) { if (error) { [UIUtil showMessage:[NSString stringWithFormat:@"Failed to upload %@", error.localizedDescription]]; } else { [UIUtil showMessage:@"Upload succeeded."]; } }]; } |
Parent topic: Account Operations
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot