Updated on 2023-03-23 GMT+08:00

Customizing the Profile Picture

API Description

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

Scenarios
Figure 1 PiP view

Figure 2 Gallery view

Figure 3 Mini window

Precautions

The profile picture of a user who has not logged in cannot be customized.

Method Definition

1
public Bitmap queryContactAvatar(String account, String thirdUserId, String sipNumber)

Parameter Description

Table 1

Parameter

Type

Description

account

String

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

thirdUserId

String

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

sipNumber

String

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

Return Values

Table 2

Parameter

Type

Description

bitmap

Bitmap

Bitmap class of the profile picture.

Sample Code
sdkConfig.setQueryContactInfoStrategy(new IQueryContactInfoStrategy() {
    @Override    
    public Bitmap queryContactAvatar(String account, String thirdUserId, String sipNumber) {
        Log.i(TAG, "setQueryContactInfoStrategy account: " + account + " thirdUserId: " + thirdUserId + " sipNumber: " + sipNumber);  
        // When a third party queries the address book, the profile picture of the corresponding user is returned. In the sample code, a default picture is returned.
        return BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher);
    }
});