# 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 Description
configuration ininfo.plist
.Add the
PHPhotoLibraryPreventAutomaticLimitedAccessAlert
configuration ininfo.plist
and set it toYES
.Add the
PhotosUI.framework
system library underTARGETS
>Build Phrases
>Link Binary with libraries
in Xcode.
# Manually import
- Download the latest v5.x SDK in the GitHub Tags list (opens new window), and then import to your project;
- Add
-ObjC
to theOther 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;
}
Events →