# 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

AIHelpSupport.EnableLogging(true);

# GetSDKVersion()

to get current SDK version

string sdkVersion = AIHelpSupport.GetSDKVersion();

# IsAIHelpShowing()

to check whether AIHelp interface is showing now

boolean isShowing = AIHelpSupport.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:

AIHelpSupport.SetOnSpecificUrlClickedCallback((url) => {
    // url: https://www.google.com?js-bridge=enable
    // You can get the callback when user clicked the specific url
});

# SetOnAIHelpSessionOpenCallback()

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

AIHelpSupport.SetOnAIHelpSessionOpenCallback(() => {
    // You can get the callback when user opened the AIHelp page
});

# SetOnAIHelpSessionCloseCallback()

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

AIHelpSupport.SetOnAIHelpSessionCloseCallback(() => {
    // You can get the callback when user closed the AIHelp page
});

# SetOnOperationUnreadChangedCallback()

To register a callback for operation articles' update:

AIHelpSupport.SetOnOperationUnreadChangedCallback((hasUnreadArticles) => {
    // do something you want according to the unread status received
});

# 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) {
  AIHelpSupport.AdditionalSupportFor(PublishCountryOrRegion.CN);
}
AIHelpSupport.Init(this, "appKey", "domain", "appId", "defaultLanguage(optional)");
Last Updated: 6/7/2023, 9:55:33 AM