# 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

FAIHelpForUEModule::Get().GetAIHelp()->EnableLogging(true);

# GetSDKVersion()

to get current SDK version

FString sdkVersion = FAIHelpForUEModule::Get().GetAIHelp()->GetSDKVersion();

# IsAIHelpShowing()

to check whether AIHelp interface is showing now

bool isShowing = FAIHelpForUEModule::Get().GetAIHelp()->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) {
    // You can get the callback when user closed the AIHelp page
}
FAIHelpForUEModule::Get().GetAIHelp()->SetOnSpecificUrlClickedCallback(onSpecificUrlClickedCallback);

# SetOnAIHelpSessionOpenCallback()

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

void onAIHelpSessionOpened() {
    // You can get the callback when user closed the AIHelp page
}
FAIHelpForUEModule::Get().GetAIHelp()->SetOnAIHelpSessionOpenCallback(onAIHelpSessionOpened);

# SetOnAIHelpSessionCloseCallback()

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

void onAIHelpSessionClosed() {
    // You can get the callback when user closed the AIHelp page
}
FAIHelpForUEModule::Get().GetAIHelp()->SetOnAIHelpSessionCloseCallback(onAIHelpSessionClosed);

# SetOnOperationUnreadChangedCallback()

To register a callback for operation articles' update:

void onOperationUnreadChanged(hasUnreadArticles) {
    // You can get the callback when user closed the AIHelp page
}
FAIHelpForUEModule::Get().GetAIHelp()->SetOnOperationUnreadChangedCallback(onOperationUnreadChanged);

# 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) {
  FAIHelpForUEModule::Get().GetAIHelp()->AdditionalSupportFor(EAIHelpPublishCountryOrRegion::China);
}
FAIHelpForUEModule::Get().GetAIHelp()->Init(
    "THIS IS YOUR APP KEY",
    "THIS IS YOUR APP DOMAIN",
    "THIS IS YOUR APP ID",
    "THIS IS YOUR DEFAULT LANGUAGE(OPTIONAL)"
);
Last Updated: 7/27/2023, 4:16:40 AM