# Quick Start
# Integration
WARNING
Before integration, please ensure that the project is configured as follows, otherwise it may cause the program to crash:
- Add the - Privacy - Photo Library Usage Descriptionconfiguration in- info.plist.
- Add the - PHPhotoLibraryPreventAutomaticLimitedAccessAlertconfiguration in- info.plistand set it to- YES.
- Add the - PhotosUI.frameworksystem library under- TARGETS>- Build Phrases>- Link Binary with librariesin Xcode.
# Manually import
- Download the latest v4.x SDK in the GitHub Tags list (opens new window), and then import to your project;
- Add -ObjCto theOther Linker Flagsfield in your Build Settings in Xcode;
# Cocoapods
Integrate with Cocoapods:
pod 'AIHelpSDK', '~> 4.7.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;
}
