Updated on 2024-07-30 GMT+08:00

Notification of Obtaining the User Profile Picture

Notification Description

A notification is sent for the access party to return the profile picture corresponding to the unique user ID.

Method Definition

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

Sample Code

- (void)downloadHeadPortraitWithThirdAccount:(NSString *)thirdAccount account:(NSString *)account number:(NSString *)number completionBlock:(void (^)(NSError * _Nullable, NSString * _Nullable))completionBlock {
   NSLog(@"thirdAccount:%@ -- account:%@ -- number:%@", thirdAccount, account, number);
    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);
    }
}

Precautions

  1. Set the headPortraitApiHandler proxy during SDK initialization or set the proxy on the target page.

Parameter Description

Table 1 Parameter description

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.

completionBlock

void(^)(NSError *_Nullable error, NSString *_Nullable headImagePath)

Result callback.