# Quick Start

TIP

AIHelp offers both C++ and blueprint options for integration, allowing you to choose your preferred method.

For the rest of the documentation, we will be using C++ for code examples.

# Integration

AIHelp Unreal Plugin is an encapsulation for Android and iOS with bridge files to the native code.

For starters, download (opens new window) the AIHelpForUE plugin provided by AIHelp and import it into your project. Afterwards, you can integrate Android and iOS SDK according the following guide.

# Android

Android is using Gradle under the hood, you can find the dependency code in the AIHelpForUE/AIHelp_UPL.xml file:

dependencies {
    implementation 'net.aihelp:android-aihelp-aar:3.4.+'
}

The third-party-library used by AIHelp are as follows: androidx.recyclerView, okhttp3, okio.

If you're only integrating AIHelp AAR file, please make sure you've got all these libraries in your dependency.

# iOS

iOS is using .framework library under the hood, download (opens new window) the latest version of 3.x.

  1. Add Privacy - Photo Library Usage Description declaration to your info.plist.

  2. Add -ObjC to the Other Linker Flags field in your Build Settings in Xcode.

# API

WARNING

Please ensure you are doing the initialization job at the very beginning of your application's lifecycle, otherwise there maybe unintended runtime exception.

# Init()

You can do the AIHelp initialization job by calling this method:

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)"
);       

AIHelp provides additional domain support for specific country or region, check here to learn more.

# SetOnAIHelpInitializedCallback()

We also provide apis for you to monitor SDK's initialization status:




 

void onAIHelpInit() {
    // do something you want
}
FAIHelpForUEModule::Get().GetAIHelp()->SetOnAIHelpInitializedCallback(onAIHelpInit);

# Definition

# appKey / domain / appId

  • Type: FString
  • Details: Required. You can get these parameters at here:

# language

  • Type: FString
  • Default: device's locale language
  • Details: Optional. This is AIHelp's default initialize language; If you are not Setting this, we will use device's locale language to initialize AIHelp SDK.
  • See also: Check here to learn language code you may need. Going International?

# FOnAIHelpInitializedDelegate

  • Type: void (*OnAIHelpInitializedCallback)(void)
  • Default: null
  • Details: Optional. AIHelp's initialization callback, you'll get notified when the init job is done.

# Code Example

Please ensure you are initializing AIHelp at the very beginning of your application's lifecycle.

The code examples are as follows:

void onAIHelpInit() {
    // do something you want
}

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)"
);        
FAIHelpForUEModule::Get().GetAIHelp()->SetOnAIHelpInitializedCallback(onAIHelpInit);
Last Updated: 11/8/2023, 3:45:06 AM