commit | author | age
|
10792d
|
1 |
// |
L |
2 |
// AIHelpSupportSDK |
|
3 |
// |
|
4 |
// Created by AIHelp. |
|
5 |
// Copyright © 2020 aihelp.net. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <Foundation/Foundation.h> |
|
9 |
#import <AIHelpSupportSDK/AIHelpSDKConfig.h> |
|
10 |
#import <UIKit/UIKit.h> |
|
11 |
|
38d19a
|
12 |
typedef void (*AISupportInitCallBack)(const bool isSuccess, const char * message); |
10792d
|
13 |
typedef void (*AISupportMessageCallBack)(const int unreadCount); |
38d19a
|
14 |
typedef void (*AISupportPingCallBack)(const char * log); |
10792d
|
15 |
typedef void (*AISupportIsSpecificFormCallBack)(void); |
L |
16 |
typedef void (*AISupportOpenSDKCallBack)(void); |
|
17 |
typedef void (*AISupportCloseSDKCallBack)(void); |
|
18 |
typedef void (*AISupportOperationUnReadCallBack)(const bool hasUnreadArticles); |
38d19a
|
19 |
typedef void (*AISupportSpecificUrlClickedCallBack)(const char * url); |
10792d
|
20 |
|
L |
21 |
@interface AIHelpSupportSDK : NSObject |
|
22 |
|
|
23 |
/** |
|
24 |
* Initialize AIHelp sdk |
|
25 |
* |
|
26 |
* When initializing AIHelp you must pass these three tokens. You initialize AIHelp by adding the following lines in the implementation file for your app delegate, ideally at the top of application:didFinishLaunchingWithOptions |
|
27 |
* @param apiKey This is your developer API Key |
|
28 |
* @param domainName This is your domain name without any http:// or forward slashes |
|
29 |
* @param appId This is the unique ID assigned to your app |
|
30 |
*/ |
|
31 |
+ (void)initWithApiKey:(NSString *)apiKey domainName:(NSString *)domainName appId:(NSString *)appId; |
|
32 |
|
|
33 |
/** |
|
34 |
* Initialize AIHelp sdk |
|
35 |
* |
|
36 |
* When initializing AIHelp you must pass these three tokens. You initialize AIHelp by adding the following lines in the implementation file for your app delegate, ideally at the top of application:didFinishLaunchingWithOptions |
|
37 |
* @param apiKey This is your developer API Key |
|
38 |
* @param domainName This is your domain name without any http:// or forward slashes |
|
39 |
* @param appId This is the unique ID assigned to your app |
|
40 |
* @param language This is your expected init language |
|
41 |
*/ |
|
42 |
+ (void)initWithApiKey:(NSString *)apiKey domainName:(NSString *)domainName appId:(NSString *)appId language:(NSString *)language; |
|
43 |
|
|
44 |
/** |
38d19a
|
45 |
* Show the AIHelp conversation screen. |
10792d
|
46 |
* |
38d19a
|
47 |
* If you want to custom your welcome message, please check next method for more information. |
10792d
|
48 |
*/ |
38d19a
|
49 |
+ (BOOL)showWithEntranceId:(NSString *)entranceId; |
10792d
|
50 |
|
L |
51 |
/** |
38d19a
|
52 |
Show the AIHelp conversation screen. |
10792d
|
53 |
*/ |
38d19a
|
54 |
+ (BOOL)showWithApiConfig:(AIHelpApiConfig *)apiConfig; |
10792d
|
55 |
|
38d19a
|
56 |
+ (void)showSingleFAQ:(NSString *)faqId showConversationMoment:(AIHelpFAQShowConversationMoment)showConversationMoment; |
10792d
|
57 |
|
L |
58 |
/** |
|
59 |
* Update a user's profile via UserConfig. |
|
60 |
* |
|
61 |
* Please check ECServiceUserConfigfor more detail information. |
|
62 |
* @param config configs which contains all information about a user. |
|
63 |
*/ |
|
64 |
+ (void)updateUserInfo:(AIHelpUserConfig *)config; |
|
65 |
|
|
66 |
/** |
|
67 |
* Clear the values set to a user, reset the userId to deviceId, userName to 'anonymous'. |
|
68 |
*/ |
|
69 |
+ (void)resetUserInfo; |
|
70 |
|
|
71 |
/** |
|
72 |
* Change the SDK language. By default, the device's prefered language is used. |
|
73 |
* |
|
74 |
* The call will fail in the following cases : |
|
75 |
* 1. If a AIHelp session is already active at the time of invocation |
|
76 |
* 2. Language code is incorrect |
|
77 |
* 3. Corresponding localization file is not found |
|
78 |
* @param sdkLanguage the string representing the language code. For example, use 'fr' for French. |
|
79 |
*/ |
|
80 |
+ (void)updateSDKLanguage:(NSString*)sdkLanguage; |
|
81 |
|
|
82 |
/** |
|
83 |
* Set log path for uploading. |
|
84 |
* |
|
85 |
* In order to serve your customers well, you can upload customer-related-logs when tickets are created or |
|
86 |
* specific forms are submitted. |
|
87 |
* @param path the absolute path of log, which will be uploaded when needed |
|
88 |
*/ |
|
89 |
+ (void)setUploadLogPath:(NSString*)path; |
|
90 |
|
|
91 |
/** |
|
92 |
* set the pushToken and platform to enable push notifications. |
|
93 |
* |
|
94 |
* To enable push notifications in the Helpshift iOS SDK, set the Push Notifications’ deviceToken using this method inside your application:didRegisterForRemoteNotificationsWithDeviceToken application delegate. |
|
95 |
* NOTE: You must get the specific push sdk in your App BEFORE this invocation. |
|
96 |
* |
|
97 |
* @param pushToken the pushToken received from the push notification servers. |
|
98 |
* @param pushPlatform the specific push platform, please check ElvaTokenPlatform for more information. |
|
99 |
*/ |
|
100 |
+ (void)setPushToken:(NSString*)pushToken pushPlatform:(AIHelpTokenPlatform)pushPlatform; |
|
101 |
|
|
102 |
/** |
|
103 |
* Get current AIHelp SDK version |
|
104 |
* @return AIHelp SDK version |
|
105 |
*/ |
|
106 |
+ (NSString*)getSDKVersion; |
|
107 |
|
|
108 |
/** |
|
109 |
* Whether AIHelp session is visible to users |
|
110 |
* @return whether sdk is active |
|
111 |
*/ |
|
112 |
+ (BOOL)isAIHelpShowing; |
|
113 |
|
|
114 |
/** |
|
115 |
* Whether to print logs. |
|
116 |
* |
|
117 |
* It only works in Debug mode |
|
118 |
* @param enable YES/NO |
|
119 |
*/ |
|
120 |
+ (void)enableLogging:(BOOL)enable; |
|
121 |
|
|
122 |
/** |
|
123 |
* The preferred screen orientation sdk would like to run in. |
|
124 |
* |
|
125 |
* NOTE: The SDK direction must be included in the program direction Settings, otherwise the setting will fail |
|
126 |
* @param interfaceOrientationMask please refer to the UIInterfaceOrientationMask API |
|
127 |
*/ |
|
128 |
+ (void)setSDKInterfaceOrientationMask:(UIInterfaceOrientationMask)interfaceOrientationMask; |
|
129 |
|
|
130 |
/** |
|
131 |
* Set up host address for network check with result callback. |
|
132 |
* |
|
133 |
* With this api, you can get the network check result passing back to you. |
|
134 |
* @param address host address for network checking, without schemes such 'https://' or 'http://'. |
|
135 |
* For example, you can pass in 'www.google.com' or just 'google.com', no schemes are needed. |
|
136 |
* @param callback network check result callback, you can get the check result via this callback |
|
137 |
*/ |
|
138 |
+ (void)setNetworkCheckHostAddress:(NSString*)address callback:(AISupportPingCallBack)callback; |
|
139 |
|
|
140 |
/** |
|
141 |
* Register callback for the process of AIHelp's initialization. |
|
142 |
* |
|
143 |
* After you register this callback, SDK will let you know if the init work is done. |
|
144 |
* You can call this method either before or after the init method. |
|
145 |
* @param callback callback for AIHelp initialization |
|
146 |
*/ |
|
147 |
+ (void)setOnInitializedCallback:(AISupportInitCallBack)callback; |
|
148 |
|
|
149 |
/** |
|
150 |
* start in-app unread message count polling |
|
151 |
* |
|
152 |
* This is a schedule work, get unread message count every five minutes. |
|
153 |
* If you want to stop a started polling, just pass null to the listener parameters. |
|
154 |
* @param callback callback for unread message polling |
|
155 |
*/ |
|
156 |
+ (void)startUnreadMessageCountPolling:(AISupportMessageCallBack)callback; |
|
157 |
|
|
158 |
/** |
|
159 |
* Set the SDK display mode |
|
160 |
* |
|
161 |
* Default following system |
|
162 |
* @param mode |
|
163 |
0: follow the system |
|
164 |
1: light mode |
|
165 |
2: dark mode |
|
166 |
*/ |
|
167 |
+ (void)setSDKAppearanceMode:(int)mode; |
|
168 |
|
|
169 |
/** |
|
170 |
* AIHelp provide additional support for some country or regions. |
|
171 |
* |
|
172 |
* @param countryOrRegion ISO country code, please check https://www.iso.org/obp/ui/#search to learn more. |
|
173 |
*/ |
|
174 |
+ (void)additionalSupportFor:(AIHelpPublishCountryOrRegion)countryOrRegion; |
|
175 |
|
|
176 |
+ (void)showUrl:(NSString *)url; |
|
177 |
|
|
178 |
+ (void)setKeyWindow:(UIWindow *)keyWin; |
|
179 |
|
|
180 |
+ (void)setOnAIHelpSessionOpenCallback:(AISupportOpenSDKCallBack)callback; |
|
181 |
|
|
182 |
+ (void)setOnAIHelpSessionCloseCallback:(AISupportCloseSDKCallBack)callback; |
|
183 |
|
|
184 |
+ (void)setOnSpecificFormSubmittedCallback:(AISupportIsSpecificFormCallBack)callBack; |
|
185 |
|
|
186 |
+ (void)setOnOperationUnreadChangedCallback:(AISupportOperationUnReadCallBack)callback; |
|
187 |
|
38d19a
|
188 |
+ (void)setOnSpecificUrlClickedCallback:(AISupportSpecificUrlClickedCallBack)callback; |
L |
189 |
|
10792d
|
190 |
+ (void)setSDKEdgeInsetsWithTop:(float)top bottom:(float)bottom enable:(BOOL)enable; |
L |
191 |
+ (void)setSDKEdgeColorWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha; |
|
192 |
|
38d19a
|
193 |
+ (void)close; |
10792d
|
194 |
|
L |
195 |
@end |