# User Info

Now you can set up and update user information in a simpler and clearer way.

# API

# updateUserInfo

You can call this method to update user information whenever you need.

AIHelpUserConfigBuilder *userBuilder = [[AIHelpUserConfigBuilder alloc] init];
userBuilder.userName = @"AIHelper";
userBuilder.userTags = @[@"recharge", @"suggestion"];
userBuilder.customData = @{@"level":@34, @"total_recharge":@300, @"remaining":@"56"};
[AIHelpSupportSDK updateUserInfo:userBuilder.build];

# resetUserInfo

Call this method to inform AIHelp when user logs out to clear current logged-in user's information:

[AIHelpSupportSDK resetUserInfo];

# Definition

# userConfig

  • Type: AIHelpUserConfig
  • Default: nil
  • Detail: Optional. Configuration for user info, such as username, user id, user tags, etc.

# userName

  • Type: NSString
  • Default: anonymous
  • Detail: Optional. The display name for current user.

# serverId

  • Type: NSString
  • Default: -1
  • Detail: Optional. The server ID for current user.

# userTags

  • Type: NSArray
  • Default: nil
  • Detail: Optional. Split multiple tags by ',', empty string by default. When setting tags for users, you should ensure that the tags you are setting has been added in advance in the dashboard of AIHelp:

# customData

  • Type: NSDictionary
  • Default: nil
  • Detail: Optional. Custom data to display in dashboard with a jsonString format: {"key":"value", "key":"value"}

# Scenario

Let's assume a scenario where you want to get some information about your users in the dashboard of AIHelp.

The details are as follows:

1、User level;

2、total recharge amount;

3、remaining bills;

Then, the code example for this scenario is as follows:

- (void)updateUserInfo {
    AIHelpUserConfigBuilder *userBuilder = [[AIHelpUserConfigBuilder alloc] init];
    userBuilder.userId = @"123456789";
    userBuilder.userName = @"AIHelper";
    userBuilder.userTags = @[@"recharge", @"suggestion"];
    userBuilder.customData = @{@"level":@34, @"total_recharge":@300, @"remaining":@"56"};
    [AIHelpSupportSDK updateUserInfo:userBuilder.build];
}

# Page Example

After the configuration is completed, when the user submits a complaint, you can get this in the AIHelp dashboard:

Last Updated: 6/25/2024, 3:43:05 AM