Help Center/ Meeting/ Client SDK Reference/ macOS SDK/ APIs/ UI Customization/ Customizing the Profile Picture Display
Updated on 2023-03-23 GMT+08:00

Customizing the Profile Picture Display

downloadHeadPortraitWithThirdAccount: account: number: completionBlock:

API Description

This API is used to customize the profile picture display after login.

Figure 1 Effect of blocking the profile picture display

Precautions

  1. The profile picture of a user who has not logged in cannot be customized.
  2. Profile pictures can be uploaded (see the API for uploading a profile picture) or implemented through injection. If both methods are implemented, the blocking is implemented, and the uploaded profile picture is not downloaded from the server.

Method Definition

1
- (void)downloadHeadPortraitWithThirdAccount:(NSString *)thirdAccount account:(NSString *)account number:(NSString *)number completionBlock:(void (^)(NSError * _Nullable, NSString * _Nullable))completionBlock

Parameter Description

Table 1

Parameter

Type

Description

thirdAccount

NSString

This parameter is preferentially used in the app ID login scenario.

account

NSString

This parameter is preferentially used in the account and password login scenario.

number

NSString

This parameter is preferentially used in the cross-enterprise scenario.

Return Values

None

Sample Code

- (void)downloadHeadPortraitWithThirdAccount:(NSString *)thirdAccount account:(NSString *)account number:(NSString *)number completionBlock:(void (^)(NSError * _Nullable, NSString * _Nullable))completionBlock {
    if (completionBlock) {
        /// Return the image path to the SDK.
        NSInteger index = arc4random() % 3;
        NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:[NSString stringWithFormat:@"head_icon_%lu", index] ofType:@"png"];
        
        completionBlock(nil, path);
    }
}