# Utility Functions

In order to facilitate your access and debugging, we provide some util API, you can choose according to the situation.

# enableLogging

to enable develop logging

[AIHelpSupportSDK enableLogging:YES];

# getSDKVersion

to get current SDK version

NSString* sdkVersion = [AIHelpSupportSDK getSDKVersion];

# isAIHelpShowing

to check whether AIHelp interface is showing now

bool isShowing = [AIHelpSupportSDK isAIHelpShowing];

# setOnSpecificUrlClickedCallback

To take over the click event for some specific urls with this API, you need to make some configuration as follows:

  1. Add thejs-bridge=enable to your url, such as: https://www.google.com?js-bridge=enable

  2. Register a callback to take over the click event for urls appended with js-bridge=enable:

void onSpecificUrlClickedCallback(const char * url){
    // url: https://www.google.com?js-bridge=enable
    // You can get the callback when user clicked the specific url
}

[AIHelpSupportSDK setOnSpecificUrlClickedCallback: onSpecificUrlClickedCallback];

# setOnAIHelpSessionOpenCallback

To register a callback for AIHelp's page opening event:

void openSDKCallBack {
    // You can get the callback when user opened the AIHelp page
}
[AIHelpSupportSDK setOnAIHelpSessionOpenCallback:openSDKCallBack];

# setOnAIHelpSessionCloseCallback

To register a callback for AIHelp's page closing event:

void closeSDKCallBack {
    // You can get the callback when user closed the AIHelp page
}
[AIHelpSupportSDK setOnAIHelpSessionCloseCallback:closeSDKCallBack];

# setOnOperationUnreadChangedCallback

To register a callback for operation articles' update:

void opUnreadCallBack(bool hasUnreadArticles) {
    // do something you want according to the unread status received
}
[AIHelpSupportSDK setOnOperationUnreadChangedCallback:opUnreadCallBack];

# additionalSupportFor

To provide domain support for the following country or region:

  • India
  • Mainland China

Be aware, this function should be called BEFORE init API:

if (USER_FROM_MAINLAND_CHINA) {
  [AIHelpSupportSDK additionalSupportFor:AIHelpCN];
}
[AIHelpSupportSDK initWithApiKey:@"THIS IS YOUR APP KEY"
                  domainName:@"THIS IS YOUR APP DOMAIN"
                  appId:@"THIS IS YOUR APP ID"
                  language:@"THIS IS YOUR DEFAULT LANGUAGE(OPTIONAL)"];
Last Updated: 5/13/2023, 11:24:18 AM