# 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 v4.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.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;
}