# Quick Start

# Integration

WARNING

Before integration, please ensure that the project is configured as follows, otherwise it may cause the program to crash:

  1. Add the Privacy - Photo Library Usage Description configuration in info.plist.

  2. Add the PHPhotoLibraryPreventAutomaticLimitedAccessAlert configuration in info.plist and set it to YES.

  3. Add the PhotosUI.framework system library under TARGETS > Build Phrases > Link Binary with libraries in Xcode.

# Manually import

  1. Download the latest v5.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.6.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.

# initialize

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

if (USER_FROM_MAINLAND_CHINA) {
    [AIHelpSupportSDK additionalSupportFor:AIHelpCN];
}
[AIHelpSupportSDK initializeWithDomainName:@"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.

# registerAsyncListener:eventType:

We also provide API for you to register SDK's events, including initialize status:

#import <AIHelpSupportSDK/AIHelpSupportSDK.h>

void listener(const char *eventData, void (*acknowledge)(const char *ackData)) {
    // When init job is done, you can get callback here
    // `eventData`: { "isSuccess": true, "message": "Success" }
}

[AIHelpSupportSDK registerAsyncListener:listener eventType:AIHelpEventInitialization];

# 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?

# 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 listener(const char *eventData, void (*acknowledge)(const char *ackData)) {
    // When init job is done, you can get callback here
    // `eventData`: { "isSuccess": true, "message": "Success" }
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    if (USER_FROM_MAINLAND_CHINA) {
        [AIHelpSupportSDK additionalSupportFor:AIHelpCN];
    }
    [AIHelpSupportSDK initializeWithDomainName:@"THIS IS YOUR APP DOMAIN"
                      appId:@"THIS IS YOUR APP ID"
                      language:@"THIS IS YOUR DEFAULT LANGUAGE(OPTIONAL)"];
    [AIHelpSupportSDK registerAsyncListener:listener eventType:AIHelpEventInitialization];
    return YES;
}
Last Updated: 7/7/2024, 10:13:59 AM