# Quick Start

# Integration

TIP

Please ensure to add Privacy - Photo Library Usage Description declaration to your info.plist. Otherwise, you might not be able to upload images or videos.

# Manually import

  1. Download the latest v4.x SDK in the GitHub Tags list (opens new window), and then import to your project;
  2. Add -ObjC to the Other Linker Flags field in your Build Settings in Xcode;

# Cocoapods

Integrate with Cocoapods:

pod 'AIHelpSDK', '~> 4.5.0'

# 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) {
    [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)"];

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:










 



#import <AIHelpSupportSDK/AIHelpSupportSDK.h>
...

void AIHelp_onInitializationCallback(const bool isSuccess, const char * message) {
    // do something you want
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [AIHelpSupportSDK setOnInitializedCallback:AIHelp_onInitializationCallback];
    return YES;
}

# Definition

# appKey / domain / appId

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

# language

  • Type: NSString
  • 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?

# onAIHelpInitializedCallback

  • Type: (void(*)(const bool isSuccess, const char * message))
  • Default: nil
  • Details: Optional. AIHelp's initialization callback, you'll get notified when the init job is done.

# Code Example

Please ensure you are initializing AIHelp in application: didFinishLaunchingWithOptions: method of your AppDelegate.m.

You can start the AIHelp initialization job by calling the init API:

The code examples are as follows:

 








 
 
 
 
 
 
 
 



#import <AIHelpSupportSDK/AIHelpSupportSDK.h>
...

void AIHelp_onInitializationCallback(const bool isSuccess, const char * message) {
    // do something you want
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    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)"];
    [AIHelpSupportSDK setOnInitializedCallback:AIHelp_onInitializationCallback];
    return YES;
}
Last Updated: 11/17/2023, 4:30:50 AM