+
+@interface AIHelpSupportSDK : NSObject
+
+/**
+ * Initialize AIHelp sdk
+ *
+ * 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
+ * @param domainName This is your domain name without any http:// or forward slashes
+ * @param appId This is the unique ID assigned to your app
+ */
++ (void)initializeWithDomainName:(NSString *)domainName appId:(NSString *)appId;
+
+/**
+ * Initialize AIHelp sdk
+ *
+ * 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
+ * @param domainName This is your domain name without any http:// or forward slashes
+ * @param appId This is the unique ID assigned to your app
+ * @param language This is your expected init language
+ */
++ (void)initializeWithDomainName:(NSString *)domainName appId:(NSString *)appId language:(NSString *)language;
+
+/**
+ * Logs in a user using their user ID.
+ * * @param userId the unique identifier of the user to log in
+ */
++ (void)loginWithUserId:(NSString *)userId;
+
+/**
+ * Logs in a user using a LoginConfig object.
+ *
+ * Checkout {@link LoginConfig} for more information.
+ *
+ * @param config the configuration object containing login details.
+ * @see LoginConfig
+ */
++ (void)login:(AIHelpLoginConfig *)config;
+
+/**
+ * Show the AIHelp conversation screen.
+ *
+ * If you want to custom your welcome message, please check next method for more information.
+ */
++ (BOOL)showWithEntranceId:(NSString *)entranceId;
+
+/**
+ Show the AIHelp conversation screen.
+ */
++ (BOOL)showWithApiConfig:(AIHelpApiConfig *)apiConfig;
+
++ (void)showSingleFAQ:(NSString *)faqId showConversationMoment:(AIHelpFAQShowConversationMoment)showConversationMoment;
+
+/**
+ * Update a user's profile via UserConfig.
+ *
+ * Please check ECServiceUserConfigfor more detail information.
+ * @param config configs which contains all information about a user.
+ */
++ (void)updateUserInfo:(AIHelpUserConfig *)config;
+
+/**
+ * Clear the values set to a user, reset the userId to deviceId, userName to 'anonymous'.
+ */
++ (void)resetUserInfo;
+
+/**
+ * Change the SDK language. By default, the device's prefered language is used.
+ *
+ * The call will fail in the following cases :
+ * 1. If a AIHelp session is already active at the time of invocation
+ * 2. Language code is incorrect
+ * 3. Corresponding localization file is not found
+ * @param sdkLanguage the string representing the language code. For example, use 'fr' for French.
+ */
++ (void)updateSDKLanguage:(NSString*)sdkLanguage;
+
+/**
+ * Set log path for uploading.
+ *
+ * In order to serve your customers well, you can upload customer-related-logs when tickets are created or
+ * specific forms are submitted.
+ * @param path the absolute path of log, which will be uploaded when needed
+ */
++ (void)setUploadLogPath:(NSString*)path;
+
+/**
+ * set the pushToken and platform to enable push notifications.
+ *
+ * To enable push notifications in the Helpshift iOS SDK, set the Push Notifications’ deviceToken using this method inside your application:didRegisterForRemoteNotificationsWithDeviceToken application delegate.
+ * NOTE: You must get the specific push sdk in your App BEFORE this invocation.
+ *
+ * @param pushToken the pushToken received from the push notification servers.
+ * @param pushPlatform the specific push platform, please check ElvaTokenPlatform for more information.
+ */
++ (void)setPushToken:(NSString*)pushToken pushPlatform:(AIHelpTokenPlatform)pushPlatform;
+
+/**
+ * Get current AIHelp SDK version
+ * @return AIHelp SDK version
+ */
++ (NSString*)getSDKVersion;
+
+/**
+ * Whether AIHelp session is visible to users
+ * @return whether sdk is active
+ */
++ (BOOL)isAIHelpShowing;
+
+/**
+ * Whether to print logs.
+ *
+ * It only works in Debug mode
+ * @param enable YES/NO
+ */
++ (void)enableLogging:(BOOL)enable;
+
+/**
+ * Unregisters an event listener for a specific event type.
+ *
+ * @param eventType The type of event to stop listening for.
+ */
++ (void)registerAsyncListener:(AISupportAsyncEventListener)asyncEventListener
+ eventType:(AIHelpEventType)eventType;
+
++ (void)unregisterAsyncListenerWithEvent:(AIHelpEventType)eventType;
+
+/**
+ * Fetch unread message count proactively
+ */
++ (void)fetchUnreadMessageCount;
+
++ (void)fetchUnreadTaskCount;
+
+/**
+ * AIHelp provide additional support for some country or regions.
+ *
+ * @param countryOrRegion ISO country code, please check https://www.iso.org/obp/ui/#search to learn more.
+ */
++ (void)additionalSupportFor:(AIHelpPublishCountryOrRegion)countryOrRegion;
+
++ (void)showUrl:(NSString *)url;
+
++ (void)setKeyWindow:(UIWindow *)keyWin;
+
++ (void)close;
+
++ (void)logout;
+
++ (void)uninstall;
+
+@end
diff --git a/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/Info.plist b/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/Info.plist
new file mode 100644
index 0000000..8877f83
Binary files /dev/null and b/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/Info.plist differ
diff --git a/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/Modules/module.modulemap b/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/Modules/module.modulemap
new file mode 100644
index 0000000..4ddbb4f
--- /dev/null
+++ b/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/Modules/module.modulemap
@@ -0,0 +1,6 @@
+framework module AIHelpSupportSDK {
+ umbrella header "AIHelpSupportSDK.h"
+
+ export *
+ module * { export * }
+}
diff --git a/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/PrivacyInfo.xcprivacy b/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/PrivacyInfo.xcprivacy
new file mode 100644
index 0000000..cad0f17
--- /dev/null
+++ b/Assets/Plugins/iOS/AIHelpSDK/AIHelpSupportSDK.framework/PrivacyInfo.xcprivacy
@@ -0,0 +1,39 @@
+
+
+
+
+ NSPrivacyTracking
+
+ NSPrivacyTrackingDomains
+
+ NSPrivacyCollectedDataTypes
+
+ NSPrivacyAccessedAPITypes
+
+
+ NSPrivacyAccessedAPIType
+ NSPrivacyAccessedAPICategoryUserDefaults
+ NSPrivacyAccessedAPITypeReasons
+
+ CA92.1
+
+
+
+ NSPrivacyAccessedAPIType
+ NSPrivacyAccessedAPICategoryFileTimestamp
+ NSPrivacyAccessedAPITypeReasons
+
+ C617.1
+
+
+
+ NSPrivacyAccessedAPIType
+ NSPrivacyAccessedAPICategoryDiskSpace
+ NSPrivacyAccessedAPITypeReasons
+
+ 85F4.1
+
+
+
+
+
diff --git a/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.h b/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.h
new file mode 100644
index 0000000..94352e3
--- /dev/null
+++ b/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.h
@@ -0,0 +1,40 @@
+//
+// AIHelpUnity.h
+// AIHelpSupportSDK
+//
+// Created by AIHelp on 2020/8/15.
+// Copyright © 2020 AIHelp. All rights reserved.
+//
+
+#import
+
+#ifndef AIHelpUnity_h
+#define AIHelpUnity_h
+
+extern "C" void unity_initiailize (const char* domainName, const char* appId, const char* language);
+extern "C" void unity_registerAsyncEventListener (int eventType, AISupportAsyncEventListener listener);
+extern "C" void unity_unregisterAsyncEventListener (int eventType);
+
+extern "C" bool unity_show(const char* entranceId, const char* welcomeMessage);
+extern "C" void unity_showSingleFAQ(const char* faqId, int conversationMoment);
+
+extern "C" void unity_login (const char* userId, const char* userName, const char* serverId, const char* userTags, const char* customData);
+extern "C" void unity_logout ();
+extern "C" void unity_updateUserInfo (const char* userName, const char* serverId, const char* userTags, const char* customData);
+extern "C" void unity_resetUserInfo ();
+
+extern "C" void unity_fetchUnreadMessageCount ();
+extern "C" void unity_fetchUnreadTaskCount ();
+
+extern "C" void unity_updateSDKLanguage (const char* language);
+extern "C" void unity_setUploadLogPath (const char* path);
+extern "C" void unity_setPushTokenAndPlatform (const char* pushToken, int pushPlatform);
+extern "C" const char* unity_getSDKVersion ();
+extern "C" bool unity_isAIHelpShowing ();
+extern "C" void unity_enableLogging (bool enable);
+extern "C" void unity_showUrl (const char* url);
+extern "C" void unity_additionalSupportFor(int countryOrRegion);
+
+extern "C" void unity_close();
+
+#endif
diff --git a/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.h.meta b/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.h.meta
new file mode 100644
index 0000000..6bc99fa
--- /dev/null
+++ b/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.h.meta
@@ -0,0 +1,99 @@
+fileFormatVersion: 2
+guid: e6e0fefe80da6428686ed552a70d95ce
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints: []
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 0
+ validateReferences: 1
+ platformData:
+ - first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude iOS: 0
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 1
+ settings:
+ AddToEmbeddedBinaries: false
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.mm b/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.mm
new file mode 100644
index 0000000..732ceeb
--- /dev/null
+++ b/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.mm
@@ -0,0 +1,199 @@
+//
+// AIHelpUnity.m
+// AIHelpSupportSDK
+//
+// Created by AIHelp on 2020/8/15.
+// Copyright © 2020 AIHelp. All rights reserved.
+//
+#import "AIHelpUnity.h"
+#import
+#import
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+ NSString* charToNSString (const char* string)
+ {
+ if (string){
+ return [NSString stringWithUTF8String: string];
+ }else{
+ return [NSString stringWithUTF8String: ""];
+ }
+ }
+
+ const char* NSStringToChar (NSString* string)
+ {
+ if (string){
+ return string.UTF8String;
+ }else{
+ return @"".UTF8String;
+ }
+ }
+
+ AIHelpUserConfig* createUserConfig(const char* userName, const char* serverId, const char* userTags, const char* customData) {
+ NSString *_userTags = charToNSString(userTags);
+ NSString *_customData = charToNSString(customData);
+
+ AIHelpUserConfigBuilder *userBuilder = [[AIHelpUserConfigBuilder alloc] init];
+ userBuilder.userName = charToNSString(userName);
+ userBuilder.serverId = charToNSString(serverId);
+
+ if ([_userTags componentsSeparatedByString:@","]) {
+ userBuilder.userTags = [_userTags componentsSeparatedByString:@","];
+ }
+ if (_customData && _customData.length) {
+ NSData *jsonData = [_customData dataUsingEncoding:NSUTF8StringEncoding];
+ NSError *error;
+ NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error];
+ if (dic) {
+ userBuilder.customData = dic;
+ }
+ }
+ return [userBuilder build];
+ }
+
+ void unity_initiailize (const char* domainName, const char* appId, const char* language) {
+ NSString *_domainName = charToNSString(domainName);
+ NSString *_appId = charToNSString(appId);
+ NSString *_language = charToNSString(language);
+ [AIHelpSupportSDK initializeWithDomainName:_domainName appId:_appId language:_language];
+ }
+
+ void unity_registerAsyncEventListener (int eventType, AISupportAsyncEventListener listener) {
+ [AIHelpSupportSDK registerAsyncListener:listener eventType:(AIHelpEventType)eventType];
+ }
+
+ void unity_unregisterAsyncEventListener (int eventType) {
+ [AIHelpSupportSDK unregisterAsyncListenerWithEvent:(AIHelpEventType)eventType];
+ }
+
+ bool unity_show(const char* entranceId, const char* welcomeMessage) {
+ AIHelpApiConfigBuilder *configBuilder = [[AIHelpApiConfigBuilder alloc] init];
+ configBuilder.entranceId = charToNSString(entranceId);
+ configBuilder.welcomeMessage = charToNSString(welcomeMessage);
+ return [AIHelpSupportSDK showWithApiConfig:configBuilder.build];
+ }
+
+ void unity_showSingleFAQ(const char* faqId, int conversationMoment) {
+ AIHelpFAQShowConversationMoment moment = AIHelpFAQShowConversationMomentNever;
+ switch(conversationMoment){
+ case 1:
+ moment = AIHelpFAQShowConversationMomentNever;
+ break;
+ case 2:
+ moment = AIHelpFAQShowConversationMomentAlways;
+ break;
+ case 3:
+ moment = AIHelpFAQShowConversationMomentOnlyInAnswerPage;
+ break;
+ case 4:
+ moment = AIHelpFAQShowConversationMomentAfterMarkingUnhelpful;
+ break;
+ default:
+ break;
+ }
+ [AIHelpSupportSDK showSingleFAQ:charToNSString(faqId) showConversationMoment:moment];
+ }
+
+ void unity_login(const char* userId, const char* userName, const char* serverId, const char* userTags, const char* customData) {
+ NSString *_userId = charToNSString(userId);
+ AIHelpUserConfig *_userConfig = createUserConfig(userName, serverId, userTags, customData);
+ AIHelpLoginConfigBuilder *builder = [[AIHelpLoginConfigBuilder alloc] init];
+ builder.userId = _userId;
+ builder.userConfig = _userConfig;
+ [AIHelpSupportSDK login:builder.build];
+ }
+
+ void unity_logout() {
+ [AIHelpSupportSDK logout];
+ }
+
+ void unity_updateUserInfo(const char* userName, const char* serverId, const char* userTags, const char* customData) {
+ AIHelpUserConfig *userConfig = createUserConfig(userName, serverId, userTags, customData);
+ [AIHelpSupportSDK updateUserInfo:userConfig];
+ }
+
+ void unity_resetUserInfo () {
+ [AIHelpSupportSDK resetUserInfo];
+ }
+
+ void unity_fetchUnreadMessageCount () {
+ [AIHelpSupportSDK fetchUnreadMessageCount];
+ }
+
+ void unity_fetchUnreadTaskCount () {
+ [AIHelpSupportSDK fetchUnreadTaskCount];
+ }
+
+ void unity_updateSDKLanguage (const char* language) {
+ [AIHelpSupportSDK updateSDKLanguage:charToNSString(language)];
+ }
+
+ void unity_setUploadLogPath (const char* path) {
+ [AIHelpSupportSDK setUploadLogPath:charToNSString(path)];
+ }
+
+ void unity_setPushTokenAndPlatform (const char* pushToken, int pushPlatform) {
+ AIHelpTokenPlatform ePlatform;
+ switch (pushPlatform) {
+ case 1:
+ ePlatform = AIHelpTokenPlatformAPNS;
+ break;
+ case 2:
+ ePlatform = AIHelpTokenPlatformFirebase;
+ break;
+ case 3:
+ ePlatform = AIHelpTokenPlatformJpush;
+ break;
+ case 4:
+ ePlatform = AIHelpTokenPlatformGeTui;
+ break;
+ case 6:
+ ePlatform = AIHelpTokenPlatformHUAWEI;
+ break;
+ case 7:
+ ePlatform = AIHelpTokenPlatformOneSignal;
+ break;
+ default:
+ ePlatform = AIHelpTokenPlatformAPNS;
+ break;
+ }
+ [AIHelpSupportSDK setPushToken:charToNSString(pushToken) pushPlatform:ePlatform];
+ }
+
+ const char* unity_getSDKVersion () {
+ NSString *version = [AIHelpSupportSDK getSDKVersion];
+ return strdup(NSStringToChar(version));
+ }
+
+ bool unity_isAIHelpShowing () {
+ return [AIHelpSupportSDK isAIHelpShowing];
+ }
+
+ void unity_enableLogging (bool enable) {
+ [AIHelpSupportSDK enableLogging:enable];
+ }
+
+ void unity_showUrl (const char* url) {
+ [AIHelpSupportSDK showUrl:charToNSString(url)];
+ }
+
+ void unity_additionalSupportFor(int countryOrRegion) {
+ AIHelpPublishCountryOrRegion tmpCountryOrRegion = AIHelpCN;
+ if (countryOrRegion == 1) {
+ tmpCountryOrRegion = AIHelpCN;
+ }
+ if (countryOrRegion == 2) {
+ tmpCountryOrRegion = AIHelpIN;
+ }
+ [AIHelpSupportSDK additionalSupportFor:tmpCountryOrRegion];
+ }
+
+ void unity_close() {
+ [AIHelpSupportSDK close];
+ }
+
+#if defined(__cplusplus)
+}
+#endif
diff --git a/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.mm.meta b/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.mm.meta
new file mode 100644
index 0000000..3cbc883
--- /dev/null
+++ b/Assets/Plugins/iOS/AIHelpSDK/AIHelpUnity.mm.meta
@@ -0,0 +1,99 @@
+fileFormatVersion: 2
+guid: c6693f4afa489486196cc26c2e3491fd
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints: []
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 0
+ validateReferences: 1
+ platformData:
+ - first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude iOS: 0
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 1
+ settings:
+ AddToEmbeddedBinaries: false
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Resources.meta b/Assets/Resources.meta
new file mode 100644
index 0000000..dded218
--- /dev/null
+++ b/Assets/Resources.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c18c3fc094505401d97e13edb401995a
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Resources/BillingMode.json b/Assets/Resources/BillingMode.json
new file mode 100644
index 0000000..6f4bfb7
--- /dev/null
+++ b/Assets/Resources/BillingMode.json
@@ -0,0 +1 @@
+{"androidStore":"GooglePlay"}
\ No newline at end of file
diff --git a/Assets/Resources/BillingMode.json.meta b/Assets/Resources/BillingMode.json.meta
new file mode 100644
index 0000000..26f0f70
--- /dev/null
+++ b/Assets/Resources/BillingMode.json.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 733e203ba07744381a4282652e6437e5
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scenes.meta b/Assets/Scenes.meta
new file mode 100644
index 0000000..67ecede
--- /dev/null
+++ b/Assets/Scenes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1d12556d3cd13454d80078f1d69791e3
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity
new file mode 100644
index 0000000..2221b04
--- /dev/null
+++ b/Assets/Scenes/SampleScene.unity
@@ -0,0 +1,267 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+OcclusionCullingSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_OcclusionBakeSettings:
+ smallestOccluder: 5
+ smallestHole: 0.25
+ backfaceThreshold: 100
+ m_SceneGUID: 00000000000000000000000000000000
+ m_OcclusionCullingData: {fileID: 0}
+--- !u!104 &2
+RenderSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 9
+ m_Fog: 0
+ m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+ m_FogMode: 3
+ m_FogDensity: 0.01
+ m_LinearFogStart: 0
+ m_LinearFogEnd: 300
+ m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
+ m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
+ m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
+ m_AmbientIntensity: 1
+ m_AmbientMode: 0
+ m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
+ m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
+ m_HaloStrength: 0.5
+ m_FlareStrength: 1
+ m_FlareFadeSpeed: 3
+ m_HaloTexture: {fileID: 0}
+ m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
+ m_DefaultReflectionMode: 0
+ m_DefaultReflectionResolution: 128
+ m_ReflectionBounces: 1
+ m_ReflectionIntensity: 1
+ m_CustomReflection: {fileID: 0}
+ m_Sun: {fileID: 705507994}
+ m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
+ m_UseRadianceAmbientProbe: 0
+--- !u!157 &3
+LightmapSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 12
+ m_GIWorkflowMode: 1
+ m_GISettings:
+ serializedVersion: 2
+ m_BounceScale: 1
+ m_IndirectOutputScale: 1
+ m_AlbedoBoost: 1
+ m_EnvironmentLightingMode: 0
+ m_EnableBakedLightmaps: 1
+ m_EnableRealtimeLightmaps: 0
+ m_LightmapEditorSettings:
+ serializedVersion: 12
+ m_Resolution: 2
+ m_BakeResolution: 40
+ m_AtlasSize: 1024
+ m_AO: 0
+ m_AOMaxDistance: 1
+ m_CompAOExponent: 1
+ m_CompAOExponentDirect: 0
+ m_ExtractAmbientOcclusion: 0
+ m_Padding: 2
+ m_LightmapParameters: {fileID: 0}
+ m_LightmapsBakeMode: 1
+ m_TextureCompression: 1
+ m_FinalGather: 0
+ m_FinalGatherFiltering: 1
+ m_FinalGatherRayCount: 256
+ m_ReflectionCompression: 2
+ m_MixedBakeMode: 2
+ m_BakeBackend: 1
+ m_PVRSampling: 1
+ m_PVRDirectSampleCount: 32
+ m_PVRSampleCount: 500
+ m_PVRBounces: 2
+ m_PVREnvironmentSampleCount: 500
+ m_PVREnvironmentReferencePointCount: 2048
+ m_PVRFilteringMode: 2
+ m_PVRDenoiserTypeDirect: 0
+ m_PVRDenoiserTypeIndirect: 0
+ m_PVRDenoiserTypeAO: 0
+ m_PVRFilterTypeDirect: 0
+ m_PVRFilterTypeIndirect: 0
+ m_PVRFilterTypeAO: 0
+ m_PVREnvironmentMIS: 0
+ m_PVRCulling: 1
+ m_PVRFilteringGaussRadiusDirect: 1
+ m_PVRFilteringGaussRadiusIndirect: 5
+ m_PVRFilteringGaussRadiusAO: 2
+ m_PVRFilteringAtrousPositionSigmaDirect: 0.5
+ m_PVRFilteringAtrousPositionSigmaIndirect: 2
+ m_PVRFilteringAtrousPositionSigmaAO: 1
+ m_ExportTrainingData: 0
+ m_TrainingDataDestination: TrainingData
+ m_LightProbeSampleCountMultiplier: 4
+ m_LightingDataAsset: {fileID: 0}
+ m_LightingSettings: {fileID: 0}
+--- !u!196 &4
+NavMeshSettings:
+ serializedVersion: 2
+ m_ObjectHideFlags: 0
+ m_BuildSettings:
+ serializedVersion: 2
+ agentTypeID: 0
+ agentRadius: 0.5
+ agentHeight: 2
+ agentSlope: 45
+ agentClimb: 0.4
+ ledgeDropHeight: 0
+ maxJumpAcrossDistance: 0
+ minRegionArea: 2
+ manualCellSize: 0
+ cellSize: 0.16666667
+ manualTileSize: 0
+ tileSize: 256
+ accuratePlacement: 0
+ debug:
+ m_Flags: 0
+ m_NavMeshData: {fileID: 0}
+--- !u!1 &705507993
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 705507995}
+ - component: {fileID: 705507994}
+ m_Layer: 0
+ m_Name: Directional Light
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!108 &705507994
+Light:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 705507993}
+ m_Enabled: 1
+ serializedVersion: 8
+ m_Type: 1
+ m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
+ m_Intensity: 1
+ m_Range: 10
+ m_SpotAngle: 30
+ m_CookieSize: 10
+ m_Shadows:
+ m_Type: 2
+ m_Resolution: -1
+ m_CustomResolution: -1
+ m_Strength: 1
+ m_Bias: 0.05
+ m_NormalBias: 0.4
+ m_NearPlane: 0.2
+ m_Cookie: {fileID: 0}
+ m_DrawHalo: 0
+ m_Flare: {fileID: 0}
+ m_RenderMode: 0
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_Lightmapping: 1
+ m_LightShadowCasterMode: 0
+ m_AreaSize: {x: 1, y: 1}
+ m_BounceIntensity: 1
+ m_ColorTemperature: 6570
+ m_UseColorTemperature: 0
+ m_ShadowRadius: 0
+ m_ShadowAngle: 0
+--- !u!4 &705507995
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 705507993}
+ m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
+ m_LocalPosition: {x: 0, y: 3, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 1
+ m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
+--- !u!1 &963194225
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 963194228}
+ - component: {fileID: 963194227}
+ - component: {fileID: 963194226}
+ m_Layer: 0
+ m_Name: Main Camera
+ m_TagString: MainCamera
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!81 &963194226
+AudioListener:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 963194225}
+ m_Enabled: 1
+--- !u!20 &963194227
+Camera:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 963194225}
+ m_Enabled: 1
+ serializedVersion: 2
+ m_ClearFlags: 1
+ m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
+ m_projectionMatrixMode: 1
+ m_SensorSize: {x: 36, y: 24}
+ m_LensShift: {x: 0, y: 0}
+ m_GateFitMode: 2
+ m_FocalLength: 50
+ m_NormalizedViewPortRect:
+ serializedVersion: 2
+ x: 0
+ y: 0
+ width: 1
+ height: 1
+ near clip plane: 0.3
+ far clip plane: 1000
+ field of view: 60
+ orthographic: 0
+ orthographic size: 5
+ m_Depth: -1
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_RenderingPath: -1
+ m_TargetTexture: {fileID: 0}
+ m_TargetDisplay: 0
+ m_TargetEye: 3
+ m_HDR: 1
+ m_AllowMSAA: 1
+ m_AllowDynamicResolution: 0
+ m_ForceIntoRT: 0
+ m_OcclusionCulling: 1
+ m_StereoConvergence: 10
+ m_StereoSeparation: 0.022
+--- !u!4 &963194228
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 963194225}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 1, z: -10}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
diff --git a/Assets/Scenes/SampleScene.unity.meta b/Assets/Scenes/SampleScene.unity.meta
new file mode 100644
index 0000000..952bd1e
--- /dev/null
+++ b/Assets/Scenes/SampleScene.unity.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 9fc0d4010bbf28b4594072e72b8655ab
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta
new file mode 100644
index 0000000..9d54e59
--- /dev/null
+++ b/Assets/Scripts.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f097ef5454e16482897b25c8f6f49251
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp.meta b/Assets/Scripts/AIHelp.meta
new file mode 100644
index 0000000..e346e9b
--- /dev/null
+++ b/Assets/Scripts/AIHelp.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cf0ceb66caae447e3b600785afd69f33
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/AIHelpSupport.cs b/Assets/Scripts/AIHelp/AIHelpSupport.cs
new file mode 100644
index 0000000..826b326
--- /dev/null
+++ b/Assets/Scripts/AIHelp/AIHelpSupport.cs
@@ -0,0 +1,121 @@
+using System;
+namespace AIHelp
+{
+ public class AIHelpSupport
+ {
+ public static void Initialize(string domain, string appId, string language)
+ {
+ AIHelpCore.getInstance().Initialize(domain, appId, language);
+ }
+
+ public static void Initialize(string domain, string appId)
+ {
+ Initialize(domain, appId, "");
+ }
+
+ public static void RegisterAsyncEventListener(AIHelp.EventType eventType, AIHelpDelegate.AsyncEventListener listener)
+ {
+ AIHelpCore.getInstance().RegisterAsyncEventListener(eventType, listener);
+ }
+
+ public static void UnregisterAsyncEventListener(AIHelp.EventType eventType)
+ {
+ AIHelpCore.getInstance().UnregisterAsyncEventListener(eventType);
+ }
+
+ public static bool Show(string entranceId)
+ {
+ return AIHelpCore.getInstance().Show(entranceId);
+ }
+
+ public static bool Show(ApiConfig apiConfig)
+ {
+ return AIHelpCore.getInstance().Show(apiConfig);
+ }
+
+ public static void ShowSingleFAQ(string faqId, ConversationMoment moment)
+ {
+ AIHelpCore.getInstance().ShowSingleFAQ(faqId, moment);
+ }
+
+ public static void Login(string userId)
+ {
+ Login(new LoginConfig.Builder().SetUserId(userId).Build());
+ }
+
+ public static void Login(LoginConfig loginConfig)
+ {
+ AIHelpCore.getInstance().Login(loginConfig);
+ }
+
+ public static void Logout()
+ {
+ AIHelpCore.getInstance().Logout();
+ }
+
+ public static void UpdateUserInfo(UserConfig userConfig)
+ {
+ AIHelpCore.getInstance().UpdateUserInfo(userConfig);
+ }
+
+ public static void ResetUserInfo()
+ {
+ AIHelpCore.getInstance().ResetUserInfo();
+ }
+
+ public static void UpdateSDKLanguage(string language)
+ {
+ AIHelpCore.getInstance().UpdateSDKLanguage(language);
+ }
+
+ public static void SetUploadLogPath(string path)
+ {
+ AIHelpCore.getInstance().SetUploadLogPath(path);
+ }
+
+ public static void SetPushTokenAndPlatform(string pushToken, PushPlatform platform)
+ {
+ AIHelpCore.getInstance().SetPushTokenAndPlatform(pushToken, platform);
+ }
+
+ public static void FetchUnreadMessageCount()
+ {
+ AIHelpCore.getInstance().FetchUnreadMessageCount();
+ }
+
+ public static void FetchUnreadTaskCount()
+ {
+ AIHelpCore.getInstance().FetchUnreadTaskCount();
+ }
+
+ public static string GetSDKVersion()
+ {
+ return AIHelpCore.getInstance().GetSDKVersion();
+ }
+
+ public static bool IsAIHelpShowing()
+ {
+ return AIHelpCore.getInstance().IsAIHelpShowing();
+ }
+
+ public static void enableLogging(bool enable)
+ {
+ AIHelpCore.getInstance().EnableLogging(enable);
+ }
+
+ public static void ShowUrl(string url)
+ {
+ AIHelpCore.getInstance().ShowUrl(url);
+ }
+
+ public static void AdditionalSupportFor(PublishCountryOrRegion countryOrRegion)
+ {
+ AIHelpCore.getInstance().AdditionalSupportFor(countryOrRegion);
+ }
+
+ public static void Close()
+ {
+ AIHelpCore.getInstance().Close();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/AIHelpSupport.cs.meta b/Assets/Scripts/AIHelp/AIHelpSupport.cs.meta
new file mode 100644
index 0000000..77577cc
--- /dev/null
+++ b/Assets/Scripts/AIHelp/AIHelpSupport.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ef1e7be80affb4af588e5c113403b225
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Config.meta b/Assets/Scripts/AIHelp/Config.meta
new file mode 100644
index 0000000..6f67f0d
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2849caac28eb049d1aeabcee4d7abe31
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Config/ApiConfig.cs b/Assets/Scripts/AIHelp/Config/ApiConfig.cs
new file mode 100644
index 0000000..adfdf2c
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/ApiConfig.cs
@@ -0,0 +1,39 @@
+
+using System;
+namespace AIHelp
+{
+ public class ApiConfig
+ {
+ public string EntranceId { get; }
+ public string WelcomeMessage { get; }
+
+ private ApiConfig(Builder builder)
+ {
+ EntranceId = builder.EntranceId;
+ WelcomeMessage = builder.WelcomeMessage;
+ }
+
+ public class Builder
+ {
+ public string EntranceId { get; private set; }
+ public string WelcomeMessage { get; private set; }
+
+ public Builder SetEntranceId(string entranceId)
+ {
+ EntranceId = entranceId;
+ return this;
+ }
+
+ public Builder SetWelcomeMessage(string welcomeMessage)
+ {
+ WelcomeMessage = welcomeMessage;
+ return this;
+ }
+
+ public ApiConfig Build()
+ {
+ return new ApiConfig(this);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Config/ApiConfig.cs.meta b/Assets/Scripts/AIHelp/Config/ApiConfig.cs.meta
new file mode 100644
index 0000000..eb4d92c
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/ApiConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: af06fba061d114dee8bab53d2386c967
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Config/Delegate.cs b/Assets/Scripts/AIHelp/Config/Delegate.cs
new file mode 100644
index 0000000..8cfdddd
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/Delegate.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace AIHelp
+{
+ public class AIHelpDelegate
+ {
+ public delegate void AsyncEventListener(String jsonEventData, Action acknowledge);
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Config/Delegate.cs.meta b/Assets/Scripts/AIHelp/Config/Delegate.cs.meta
new file mode 100644
index 0000000..5ba619d
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/Delegate.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 667f6671ba9b540dba0f6c7aedc71883
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Config/Enum.cs b/Assets/Scripts/AIHelp/Config/Enum.cs
new file mode 100644
index 0000000..ef7bd4a
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/Enum.cs
@@ -0,0 +1,70 @@
+
+using System;
+namespace AIHelp
+{
+
+ public enum PushPlatform
+ {
+ APNS = 1, FIREBASE = 2, JIGUANG = 3, GETUI = 4, HUAWEI = 6, ONE_SIGNAL = 7
+ }
+
+ public enum ConversationMoment
+ {
+ NEVER = 1, ALWAYS = 2, ONLY_IN_ANSWER_PAGE = 3, AFTER_MARKING_UNHELPFUL = 4
+ }
+
+ public enum PublishCountryOrRegion
+ {
+ CN = 1, IN = 2
+ };
+
+ public enum EventType
+ {
+ /**
+ * Event for SDK initialization
+ */
+ Initialization,
+
+ /**
+ * Event for user login
+ */
+ UserLogin,
+
+ /**
+ * Event for enterprise authentication
+ */
+ EnterpriseAuth,
+
+ /**
+ * Event for opening or closing a session (window)
+ */
+ SessionOpen,
+ SessionClose,
+
+ /**
+ * Event for message arrival
+ */
+ MessageArrival,
+
+ /**
+ * Event for log upload
+ */
+ LogUpload,
+
+ /**
+ * Event for URL click
+ */
+ UrlClick,
+
+ /**
+ * Event for unread task count
+ */
+ UnreadTaskCount,
+
+ /**
+ * Event for conversation start, along with the user's first message
+ */
+ ConversationStart,
+ }
+
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Config/Enum.cs.meta b/Assets/Scripts/AIHelp/Config/Enum.cs.meta
new file mode 100644
index 0000000..f221aff
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/Enum.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9fbae61ea0fb14752bcd772995401549
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Config/LoginConfig.cs b/Assets/Scripts/AIHelp/Config/LoginConfig.cs
new file mode 100644
index 0000000..c495f6a
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/LoginConfig.cs
@@ -0,0 +1,39 @@
+
+using System;
+namespace AIHelp
+{
+ public class LoginConfig
+ {
+ public string UserId { get; }
+ public UserConfig UserConfig { get; }
+
+ private LoginConfig(Builder builder)
+ {
+ UserId = builder.UserId;
+ UserConfig = builder.UserConfig;
+ }
+
+ public class Builder
+ {
+ public string UserId { get; private set; }
+ public UserConfig UserConfig { get; private set; }
+
+ public Builder SetUserId(string userId)
+ {
+ UserId = userId;
+ return this;
+ }
+
+ public Builder SetUserConfig(UserConfig userConfig)
+ {
+ UserConfig = userConfig;
+ return this;
+ }
+
+ public LoginConfig Build()
+ {
+ return new LoginConfig(this);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Config/LoginConfig.cs.meta b/Assets/Scripts/AIHelp/Config/LoginConfig.cs.meta
new file mode 100644
index 0000000..406a97e
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/LoginConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 53e798a014f114fdf8e104f67b645563
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Config/UserConfig.cs b/Assets/Scripts/AIHelp/Config/UserConfig.cs
new file mode 100644
index 0000000..23d1799
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/UserConfig.cs
@@ -0,0 +1,57 @@
+
+using System;
+namespace AIHelp
+{
+ public class UserConfig
+ {
+ public string UserName { get; }
+ public string ServerId { get; }
+ public string UserTags { get; }
+ public string CustomData { get; }
+
+ private UserConfig(Builder builder)
+ {
+ UserName = builder.UserName;
+ ServerId = builder.ServerId;
+ UserTags = builder.UserTags;
+ CustomData = builder.CustomData;
+ }
+
+ public class Builder
+ {
+ public string UserName { get; private set; } = "anonymous";
+ public string ServerId { get; private set; } = "-1";
+ public string UserTags { get; private set; } = string.Empty;
+ public string CustomData { get; private set; } = string.Empty;
+
+ public Builder SetUserName(string userName)
+ {
+ UserName = userName;
+ return this;
+ }
+
+ public Builder SetServerId(string serverId)
+ {
+ ServerId = serverId;
+ return this;
+ }
+
+ public Builder SetUserTags(string userTags)
+ {
+ UserTags = userTags;
+ return this;
+ }
+
+ public Builder SetCustomData(string customDataJsonstring)
+ {
+ CustomData = customDataJsonstring;
+ return this;
+ }
+
+ public UserConfig Build()
+ {
+ return new UserConfig(this);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Config/UserConfig.cs.meta b/Assets/Scripts/AIHelp/Config/UserConfig.cs.meta
new file mode 100644
index 0000000..40b201a
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Config/UserConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e8a896a44c3dd450a881ddd9cc5ba37e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core.meta b/Assets/Scripts/AIHelp/Core.meta
new file mode 100644
index 0000000..754e1aa
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d75f665a144f143bebb1e0d2bd5d3266
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/AIHelpAndroidCore.cs b/Assets/Scripts/AIHelp/Core/AIHelpAndroidCore.cs
new file mode 100644
index 0000000..b3059f4
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/AIHelpAndroidCore.cs
@@ -0,0 +1,232 @@
+using UnityEngine;
+using System;
+
+namespace AIHelp
+{
+#if UNITY_ANDROID
+
+ public class AIHelpAndroidCore : IAIHelpCore
+ {
+
+ private AndroidJavaClass javaSupport;
+ private AndroidJavaObject currentActivity;
+
+ public AIHelpAndroidCore()
+ {
+ AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
+ javaSupport = new AndroidJavaClass("net.aihelp.init.AIHelpSupport");
+ currentActivity = jc.GetStatic("currentActivity");
+ }
+
+ public void Initialize(string domain, string appId, string language)
+ {
+ if (javaSupport != null && currentActivity != null)
+ {
+ javaSupport.CallStatic("initialize", currentActivity, domain, appId, language);
+ }
+ }
+
+ private AndroidJavaObject getLoginConfig(LoginConfig config)
+ {
+ AndroidJavaObject builder = new AndroidJavaObject("net.aihelp.config.LoginConfig$Builder");
+ builder.Call("setUserId", config.UserId);
+ builder.Call("setUserConfig", getUserConfig(config.UserConfig));
+ return builder.Call("build");
+ }
+
+ private AndroidJavaObject getApiConfig(ApiConfig config)
+ {
+ AndroidJavaObject builder = new AndroidJavaObject("net.aihelp.config.ApiConfig$Builder");
+ return builder.Call("build", config.EntranceId, config.WelcomeMessage);
+ }
+
+ private AndroidJavaObject getUserConfig(UserConfig config)
+ {
+ if(config == null) return null;
+ AndroidJavaObject builder = new AndroidJavaObject("net.aihelp.config.UserConfig$Builder");
+ builder.Call("setUserName", config.UserName);
+ builder.Call("setServerId", config.ServerId);
+ builder.Call("setUserTags", config.UserTags);
+ builder.Call("setCustomData", config.CustomData);
+ return builder.Call("build");
+ }
+
+ private AndroidJavaObject getPublishCountryOrRegion(PublishCountryOrRegion countryOrRegion)
+ {
+ AndroidJavaClass clz = new AndroidJavaClass("net.aihelp.config.enums.PublishCountryOrRegion");
+ return clz.CallStatic("fromValue", (int)countryOrRegion);
+ }
+
+ private AndroidJavaObject getPushPlatform(PushPlatform platform)
+ {
+ AndroidJavaClass clz = new AndroidJavaClass("net.aihelp.config.enums.PushPlatform");
+ return clz.CallStatic("fromValue", (int)platform);
+ }
+
+ private AndroidJavaObject getShowConversationMoment(ConversationMoment conversationMoment)
+ {
+ AndroidJavaClass clz = new AndroidJavaClass("net.aihelp.config.enums.ShowConversationMoment");
+ return clz.CallStatic("fromValue", (int)conversationMoment);
+ }
+
+ private AndroidJavaObject getEventType(EventType eventType)
+ {
+ AndroidJavaClass clz = new AndroidJavaClass("net.aihelp.event.EventType");
+ return clz.CallStatic("fromValue", (int)eventType);
+ }
+
+ public bool Show(string entranceId)
+ {
+ if (javaSupport != null && currentActivity != null)
+ {
+ return javaSupport.CallStatic("show", entranceId);
+ }
+ return false;
+ }
+
+ public bool Show(ApiConfig apiConfig)
+ {
+ if (javaSupport != null && currentActivity != null)
+ {
+ return javaSupport.CallStatic("show", getApiConfig(apiConfig));
+ }
+ return false;
+ }
+
+ public void ShowSingleFAQ(string faqId, ConversationMoment conversationMoment)
+ {
+ if (javaSupport != null && currentActivity != null)
+ {
+ javaSupport.CallStatic("showSingleFAQ", faqId, getShowConversationMoment(conversationMoment));
+ }
+ }
+
+ public void Login(LoginConfig loginConfig)
+ {
+ if (javaSupport != null && currentActivity != null)
+ {
+ javaSupport.CallStatic("login", getLoginConfig(loginConfig));
+ }
+ }
+
+ public void Logout()
+ {
+ if (javaSupport != null && currentActivity != null)
+ {
+ javaSupport.CallStatic("logout");
+ }
+ }
+
+ public void UpdateUserInfo(UserConfig config)
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("updateUserInfo", getUserConfig(config));
+ }
+ }
+
+ public void ResetUserInfo()
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("resetUserInfo");
+ }
+ }
+
+ public void UpdateSDKLanguage(string language)
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("updateSDKLanguage", language);
+ }
+ }
+
+ public void SetUploadLogPath(string logPath)
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("setUploadLogPath", logPath);
+ }
+ }
+
+ public void SetPushTokenAndPlatform(string logPath, PushPlatform pushPlatform)
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("setPushTokenAndPlatform", logPath, getPushPlatform(pushPlatform));
+ }
+ }
+
+ public void RegisterAsyncEventListener(AIHelp.EventType eventType, AIHelpDelegate.AsyncEventListener listener)
+ {
+ javaSupport.CallStatic("registerAsyncEventListener", getEventType(eventType), listener == null ? null : new AsyncEventListenerProxy(listener));
+ }
+
+ public void UnregisterAsyncEventListener(AIHelp.EventType eventType)
+ {
+ javaSupport.CallStatic("unregisterAsyncEventListener", getEventType(eventType));
+ }
+
+ public void FetchUnreadMessageCount()
+ {
+ javaSupport.CallStatic("fetchUnreadMessageCount");
+ }
+
+ public void FetchUnreadTaskCount()
+ {
+ javaSupport.CallStatic("fetchUnreadTaskCount");
+ }
+
+ public void ShowUrl(string url)
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("showUrl", url);
+ }
+ }
+
+ public void AdditionalSupportFor(PublishCountryOrRegion countryOrRegion)
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("additionalSupportFor", getPublishCountryOrRegion(countryOrRegion));
+ }
+ }
+
+ public string GetSDKVersion()
+ {
+ if (javaSupport != null)
+ {
+ return javaSupport.CallStatic("getSDKVersion");
+ }
+ return "";
+ }
+
+ public bool IsAIHelpShowing()
+ {
+ if (javaSupport != null)
+ {
+ return javaSupport.CallStatic("isAIHelpShowing");
+ }
+ return false;
+ }
+
+ public void EnableLogging(bool isOpen)
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("enableLogging", isOpen);
+ }
+ }
+
+ public void Close()
+ {
+ if (javaSupport != null)
+ {
+ javaSupport.CallStatic("close");
+ }
+ }
+
+ }
+#endif
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Core/AIHelpAndroidCore.cs.meta b/Assets/Scripts/AIHelp/Core/AIHelpAndroidCore.cs.meta
new file mode 100644
index 0000000..4500aeb
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/AIHelpAndroidCore.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5025625f2980b4854a698e38b5e1478f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/AIHelpCore.cs b/Assets/Scripts/AIHelp/Core/AIHelpCore.cs
new file mode 100644
index 0000000..0b4388f
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/AIHelpCore.cs
@@ -0,0 +1,174 @@
+using System;
+using UnityEngine;
+namespace AIHelp
+{
+ public class AIHelpCore
+ {
+ private IAIHelpCore helpCore;
+ private static AIHelpCore sInstance;
+
+ private AIHelpCore()
+ {
+
+#if UNITY_ANDROID
+ if (Application.platform == RuntimePlatform.Android) {
+ helpCore = new AIHelpAndroidCore();
+ }
+#endif
+
+#if UNITY_IOS
+ if (Application.platform == RuntimePlatform.IPhonePlayer)
+ {
+ helpCore = new AIHelpiOSCore();
+ }
+#endif
+ }
+
+ public static AIHelpCore getInstance()
+ {
+ if (sInstance == null)
+ {
+ sInstance = new AIHelpCore();
+ }
+ return sInstance;
+ }
+
+ public void Initialize(string domain, string appId, string language)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.Initialize(domain, appId, language);
+ }
+
+ public void Initialize(string domain, string appId)
+ {
+ Initialize(domain, appId, "");
+ }
+
+ public bool Show(string entranceId)
+ {
+ if (!IsHelpCorePrepared()) return false;
+ return helpCore.Show(entranceId);
+ }
+
+ public bool Show(ApiConfig apiConfig)
+ {
+ if (!IsHelpCorePrepared()) return false;
+ return helpCore.Show(apiConfig);
+ }
+
+ public void ShowSingleFAQ(string faqId, ConversationMoment moment)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.ShowSingleFAQ(faqId, moment);
+ }
+
+ public void Login(LoginConfig loginConfig)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.Login(loginConfig);
+ }
+
+ public void Logout()
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.Logout();
+ }
+
+ public void UpdateUserInfo(UserConfig userConfig)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.UpdateUserInfo(userConfig);
+ }
+
+ public void ResetUserInfo()
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.ResetUserInfo();
+ }
+
+ public void UpdateSDKLanguage(string language)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.UpdateSDKLanguage(language);
+ }
+
+ public void SetUploadLogPath(string path)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.SetUploadLogPath(path);
+ }
+
+ public void SetPushTokenAndPlatform(string pushToken, PushPlatform platform)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.SetPushTokenAndPlatform(pushToken, platform);
+ }
+
+ public void FetchUnreadMessageCount()
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.FetchUnreadMessageCount();
+ }
+
+ public void FetchUnreadTaskCount()
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.FetchUnreadTaskCount();
+ }
+
+ public string GetSDKVersion()
+ {
+ if (!IsHelpCorePrepared()) return "";
+ return helpCore.GetSDKVersion();
+ }
+
+ public bool IsAIHelpShowing()
+ {
+ if (!IsHelpCorePrepared()) return false;
+ return helpCore.IsAIHelpShowing();
+ }
+
+ public void EnableLogging(bool enable)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.EnableLogging(enable);
+ }
+
+ public void ShowUrl(string url)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.ShowUrl(url);
+ }
+
+ public void AdditionalSupportFor(PublishCountryOrRegion countryOrRegion)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.AdditionalSupportFor(countryOrRegion);
+ }
+
+ public void RegisterAsyncEventListener(AIHelp.EventType eventType, AIHelpDelegate.AsyncEventListener listener)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.RegisterAsyncEventListener(eventType, listener);
+ }
+
+ public void UnregisterAsyncEventListener(AIHelp.EventType eventType)
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.UnregisterAsyncEventListener(eventType);
+ }
+
+ public void Close()
+ {
+ if (!IsHelpCorePrepared()) return;
+ helpCore.Close();
+ }
+
+ private bool IsHelpCorePrepared()
+ {
+ return helpCore != null;
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Core/AIHelpCore.cs.meta b/Assets/Scripts/AIHelp/Core/AIHelpCore.cs.meta
new file mode 100644
index 0000000..711fdb9
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/AIHelpCore.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4f9ac1ead074e4a2586b265550d1fae8
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/AIHelpiOSCore.cs b/Assets/Scripts/AIHelp/Core/AIHelpiOSCore.cs
new file mode 100644
index 0000000..90d0701
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/AIHelpiOSCore.cs
@@ -0,0 +1,150 @@
+// We need this one for importing our IOS functions
+using System.Runtime.InteropServices;
+using AOT;
+using System;
+namespace AIHelp
+{
+
+#if UNITY_IOS
+ public partial class AIHelpiOSCore : IAIHelpCore
+ {
+
+ public void Initialize(string domain, string appId, string language = "")
+ {
+ unity_initiailize(domain, appId, language);
+ }
+
+ public void RegisterAsyncEventListener(AIHelp.EventType eventType, AIHelpDelegate.AsyncEventListener listener)
+ {
+ eventListeners[eventType] = listener;
+ unity_registerAsyncEventListener(eventType, OCAsyncEventListener);
+ }
+
+ public void UnregisterAsyncEventListener(AIHelp.EventType eventType)
+ {
+ unity_unregisterAsyncEventListener(eventType);
+ }
+
+ public bool Show(string entranceId)
+ {
+ return unity_show(entranceId, "");
+ }
+
+ public bool Show(ApiConfig apiConfig)
+ {
+ return unity_show(apiConfig.EntranceId, apiConfig.WelcomeMessage);
+ }
+
+ public void ShowSingleFAQ(string faqId, ConversationMoment moment)
+ {
+ unity_showSingleFAQ(faqId, (int)moment);
+ }
+
+ public void Login(LoginConfig loginConfig) {
+ var userConfig = loginConfig.UserConfig;
+ if (userConfig == null) {
+ userConfig = new UserConfig.Builder().Build();
+ }
+ unity_login(loginConfig.UserId, userConfig.UserName, userConfig.ServerId, userConfig.UserTags, userConfig.CustomData);
+ }
+
+ public void Logout() {
+ unity_logout();
+ }
+
+ public void UpdateUserInfo(UserConfig userConfig)
+ {
+ unity_updateUserInfo(userConfig.UserName, userConfig.ServerId, userConfig.UserTags, userConfig.CustomData);
+ }
+
+ public void ResetUserInfo()
+ {
+ unity_resetUserInfo();
+ }
+
+ public void UpdateSDKLanguage(string language)
+ {
+ unity_updateSDKLanguage(language);
+ }
+
+ public void SetUploadLogPath(string path)
+ {
+ unity_setUploadLogPath(path);
+ }
+
+ public void SetPushTokenAndPlatform(string pushToken, PushPlatform platform)
+ {
+ unity_setPushTokenAndPlatform(pushToken, getPushPlatform(platform));
+ }
+
+ public void FetchUnreadMessageCount()
+ {
+ unity_fetchUnreadMessageCount();
+ }
+
+ public void FetchUnreadTaskCount()
+ {
+ unity_fetchUnreadTaskCount();
+ }
+
+ public string GetSDKVersion()
+ {
+ return unity_getSDKVersion();
+ }
+
+ public bool IsAIHelpShowing()
+ {
+ return unity_isAIHelpShowing();
+ }
+
+ public void EnableLogging(bool enable)
+ {
+ unity_enableLogging(enable);
+ }
+
+ public void ShowUrl(string url)
+ {
+ unity_showUrl(url);
+ }
+
+ public void AdditionalSupportFor(PublishCountryOrRegion countryOrRegion)
+ {
+ unity_additionalSupportFor(countryOrRegion);
+ }
+
+ public void Close() {
+ unity_close();
+ }
+
+ private int getPushPlatform(PushPlatform platform){
+ int tempPlatform = 2;
+ if (platform == PushPlatform.APNS)
+ {
+ tempPlatform = 1;
+ }
+ else if (platform == PushPlatform.FIREBASE)
+ {
+ tempPlatform = 2;
+ }
+ else if (platform == PushPlatform.JIGUANG)
+ {
+ tempPlatform = 3;
+ }
+ else if (platform == PushPlatform.GETUI)
+ {
+ tempPlatform = 4;
+ }
+ else if (platform == PushPlatform.HUAWEI)
+ {
+ tempPlatform = 6;
+ }
+ else if (platform == PushPlatform.ONE_SIGNAL)
+ {
+ tempPlatform = 7;
+ }
+ return tempPlatform;
+ }
+
+ }
+#endif
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Core/AIHelpiOSCore.cs.meta b/Assets/Scripts/AIHelp/Core/AIHelpiOSCore.cs.meta
new file mode 100644
index 0000000..41e620b
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/AIHelpiOSCore.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e2a510a461fd54d4881c024ad42035ff
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/Android.meta b/Assets/Scripts/AIHelp/Core/Android.meta
new file mode 100644
index 0000000..28eab60
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/Android.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b10e874e5837b4579b62e9924a20f806
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/Android/AsyncEventListenerProxy.cs b/Assets/Scripts/AIHelp/Core/Android/AsyncEventListenerProxy.cs
new file mode 100644
index 0000000..dd9d5a9
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/Android/AsyncEventListenerProxy.cs
@@ -0,0 +1,56 @@
+using UnityEngine;
+using System;
+
+namespace AIHelp
+{
+#if UNITY_ANDROID
+ public class AsyncEventListenerProxy : AndroidJavaProxy
+ {
+ private readonly AIHelpDelegate.AsyncEventListener eventListener;
+ private AndroidJavaObject ackRef;
+
+ public AsyncEventListenerProxy(AIHelpDelegate.AsyncEventListener eventListener) : base("net.aihelp.event.AsyncEventListener")
+ {
+ this.eventListener = eventListener;
+ }
+
+ void onAsyncEventReceived(string jsonEventData, AndroidJavaObject ack)
+ {
+ ackRef = ack;
+ var jniThread = System.Threading.Thread.CurrentThread;
+
+ Action acknowledge = jsonAckData =>
+ {
+ bool isAttached = false;
+ bool isAsync = System.Threading.Thread.CurrentThread != jniThread;
+ try
+ {
+ // Attach the current thread to the JNI environment
+ if (AndroidJNI.AttachCurrentThread() == (int)IntPtr.Zero)
+ {
+ isAttached = true;
+ }
+ if (ackRef != null)
+ {
+ ackRef.Call("acknowledge", jsonAckData);
+ }
+ }
+ catch (Exception e)
+ {
+ // Handle any exceptions that may occur during the JNI call
+ Debug.LogError("Exception during JNI call: " + e.Message);
+ }
+ finally
+ {
+ if (isAsync && isAttached)
+ {
+ // Ensure we detach the current thread from the JNI environment if it was attached
+ AndroidJNI.DetachCurrentThread();
+ }
+ }
+ };
+ eventListener(jsonEventData, acknowledge);
+ }
+ }
+#endif
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Core/Android/AsyncEventListenerProxy.cs.meta b/Assets/Scripts/AIHelp/Core/Android/AsyncEventListenerProxy.cs.meta
new file mode 100644
index 0000000..bea40b4
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/Android/AsyncEventListenerProxy.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 212c0cec872fc40fca66b6827ac48f80
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/IAIHelpCore.cs b/Assets/Scripts/AIHelp/Core/IAIHelpCore.cs
new file mode 100644
index 0000000..9fea063
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/IAIHelpCore.cs
@@ -0,0 +1,38 @@
+using System;
+
+namespace AIHelp
+{
+ public interface IAIHelpCore
+ {
+ void Initialize(string domain, string appId, string language);
+
+ bool Show(string entranceId);
+ bool Show(ApiConfig apiConfig);
+ void ShowSingleFAQ(string faqId, ConversationMoment moment);
+
+ void Login(LoginConfig loginConfig);
+ void Logout();
+ void UpdateUserInfo(UserConfig userConfig);
+ void ResetUserInfo();
+
+ void UpdateSDKLanguage(string language);
+ void SetUploadLogPath(string path);
+ void SetPushTokenAndPlatform(string pushToken, PushPlatform platform);
+
+ void FetchUnreadMessageCount();
+ void FetchUnreadTaskCount();
+
+ string GetSDKVersion();
+ bool IsAIHelpShowing();
+ void EnableLogging(bool enable);
+ void ShowUrl(string url);
+ void AdditionalSupportFor(PublishCountryOrRegion countryOrRegion);
+
+ void RegisterAsyncEventListener(AIHelp.EventType eventType, AIHelpDelegate.AsyncEventListener listener);
+ void UnregisterAsyncEventListener(AIHelp.EventType eventType);
+
+ void Close();
+
+ }
+
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Core/IAIHelpCore.cs.meta b/Assets/Scripts/AIHelp/Core/IAIHelpCore.cs.meta
new file mode 100644
index 0000000..b386f88
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/IAIHelpCore.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b63a845cae20749c1be5d13f2ccd2ede
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/iOS.meta b/Assets/Scripts/AIHelp/Core/iOS.meta
new file mode 100644
index 0000000..4a79570
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/iOS.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 54ad73766cfa345e6a6859b9ade52598
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/iOS/DllImports.cs b/Assets/Scripts/AIHelp/Core/iOS/DllImports.cs
new file mode 100644
index 0000000..53d272f
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/iOS/DllImports.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Runtime.InteropServices;
+using AOT;
+
+namespace AIHelp
+{
+ #if UNITY_IOS
+ public partial class AIHelpiOSCore
+ {
+ [DllImport("__Internal")]
+ private static extern void unity_initiailize(string domainName, string appId, string language);
+
+ [DllImport("__Internal")]
+ private static extern void unity_registerAsyncEventListener(AIHelp.EventType eventType, AIHelpAsyncEventListener listener);
+
+ [DllImport("__Internal")]
+ private static extern void unity_unregisterAsyncEventListener(AIHelp.EventType eventType);
+
+ [DllImport("__Internal")]
+ private static extern void unity_login(string userId, string userName, string serverId, string userTags, string customData);
+
+ [DllImport("__Internal")]
+ private static extern void unity_logout();
+
+ [DllImport("__Internal")]
+ private static extern void unity_updateUserInfo(string userName, string serverId, string userTags, string customData);
+
+ [DllImport("__Internal")]
+ private static extern void unity_resetUserInfo();
+
+ [DllImport("__Internal")]
+ private static extern void unity_updateSDKLanguage(string language);
+
+ [DllImport("__Internal")]
+ private static extern void unity_setUploadLogPath(string path);
+
+ [DllImport("__Internal")]
+ private static extern void unity_setPushTokenAndPlatform(string pushToken, int pushPlatform);
+
+ [DllImport("__Internal")]
+ private static extern string unity_getSDKVersion();
+
+ [DllImport("__Internal")]
+ private static extern bool unity_isAIHelpShowing();
+
+ [DllImport("__Internal")]
+ private static extern void unity_enableLogging(bool enable);
+
+ [DllImport("__Internal")]
+ private static extern void unity_close();
+
+ [DllImport("__Internal")]
+ private static extern bool unity_show(string entranceId, string welcomeMessage);
+
+ [DllImport("__Internal")]
+ private static extern void unity_showSingleFAQ(string faqId, int conversationMoment);
+
+ [DllImport("__Internal")]
+ private static extern void unity_fetchUnreadMessageCount();
+
+ [DllImport("__Internal")]
+ private static extern void unity_fetchUnreadTaskCount();
+
+ [DllImport("__Internal")]
+ private static extern void unity_showUrl(string url);
+
+ [DllImport("__Internal")]
+ private static extern void unity_additionalSupportFor(PublishCountryOrRegion countryOrRegion);
+ }
+ #endif
+}
diff --git a/Assets/Scripts/AIHelp/Core/iOS/DllImports.cs.meta b/Assets/Scripts/AIHelp/Core/iOS/DllImports.cs.meta
new file mode 100644
index 0000000..9b40eb3
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/iOS/DllImports.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 35414e6ccf0a84d9bb2566d2180a0a6f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/iOS/PartialAsyncEventListener.cs b/Assets/Scripts/AIHelp/Core/iOS/PartialAsyncEventListener.cs
new file mode 100644
index 0000000..faafd09
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/iOS/PartialAsyncEventListener.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Runtime.InteropServices;
+using AOT;
+using UnityEngine;
+using System.Collections.Generic;
+
+namespace AIHelp
+{
+#if UNITY_IOS
+ public partial class AIHelpiOSCore
+ {
+ private static Dictionary eventListeners =
+ new Dictionary();
+
+ // 在 cs 注册的回调方法
+ static event AIHelpDelegate.AsyncEventListener csAsyncEventListener;
+
+ // oc 传过来的 ack 回调,缓存下来异步使用
+ public static Acknowledgement AckDelegate { get; set; }
+
+ // 声明一个符合 ack 回调的代理,用来持有 ack 回调指针的时候使用
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void Acknowledgement(string ackJsonData);
+
+ // OC 回调方法签名 - event, ack
+ public delegate void AIHelpAsyncEventListener(string jsonEventData, IntPtr acknowledgePtr);
+
+ [MonoPInvokeCallback(typeof(AIHelpAsyncEventListener))]
+ private static void OCAsyncEventListener(string jsonEventData, IntPtr acknowledgePtr)
+ {
+ var intEventType = SimpleJsonParser.ExtractEventTypeFromJson(jsonEventData);
+ if (intEventType != -1) {
+ AIHelp.EventType eventType = (AIHelp.EventType)SimpleJsonParser.ExtractEventTypeFromJson(jsonEventData);
+ if (eventListeners.TryGetValue(eventType, out var listener))
+ {
+ Action acknowledge = jsonAckData => {
+ if (acknowledgePtr != IntPtr.Zero) {
+ AckDelegate = Marshal.GetDelegateForFunctionPointer(acknowledgePtr);
+ AckDelegate?.Invoke(jsonAckData);
+ }
+ };
+ listener?.Invoke(jsonEventData, acknowledge);
+ } else {
+ Debug.LogError($"[AIHelp] Unable to find any listener for event type: {eventType}. Have you declared it?");
+ }
+ } else {
+ Debug.LogError($"[AIHelp] Unable to retrieve eventType from eventData: {jsonEventData}");
+ }
+ }
+ }
+#endif
+}
diff --git a/Assets/Scripts/AIHelp/Core/iOS/PartialAsyncEventListener.cs.meta b/Assets/Scripts/AIHelp/Core/iOS/PartialAsyncEventListener.cs.meta
new file mode 100644
index 0000000..6510fe0
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/iOS/PartialAsyncEventListener.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 07b537e2737b74ea38fb190ca953a218
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AIHelp/Core/iOS/SimpleJsonParser.cs b/Assets/Scripts/AIHelp/Core/iOS/SimpleJsonParser.cs
new file mode 100644
index 0000000..c115ac4
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/iOS/SimpleJsonParser.cs
@@ -0,0 +1,46 @@
+using System;
+
+public static class SimpleJsonParser
+{
+ public static int ExtractEventTypeFromJson(string json)
+ {
+ string fieldValue = ExtractFieldFromJson(json, "eventType");
+ if (string.IsNullOrEmpty(fieldValue))
+ {
+ return -1;
+ }
+ return int.Parse(fieldValue);
+ }
+
+ public static string ExtractFieldFromJson(string json, string fieldName)
+ {
+ string target = $"\"{fieldName}\":";
+ int startIndex = json.IndexOf(target, StringComparison.OrdinalIgnoreCase);
+ if (startIndex >= 0)
+ {
+ startIndex += target.Length;
+ // Skip whitespace
+ while (char.IsWhiteSpace(json[startIndex])) startIndex++;
+
+ // Determine if the value is a string or number
+ if (json[startIndex] == '"') // string value
+ {
+ startIndex++;
+ int endIndex = json.IndexOf('"', startIndex);
+ if (endIndex > startIndex)
+ {
+ return json.Substring(startIndex, endIndex - startIndex);
+ }
+ }
+ else // numeric value
+ {
+ int endIndex = json.IndexOfAny(new[] { ',', '}', ' ' }, startIndex);
+ if (endIndex > startIndex)
+ {
+ return json.Substring(startIndex, endIndex - startIndex).Trim();
+ }
+ }
+ }
+ return "";
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AIHelp/Core/iOS/SimpleJsonParser.cs.meta b/Assets/Scripts/AIHelp/Core/iOS/SimpleJsonParser.cs.meta
new file mode 100644
index 0000000..9f9eee6
--- /dev/null
+++ b/Assets/Scripts/AIHelp/Core/iOS/SimpleJsonParser.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fb9be6b068ec448f48556f9a85df870c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/AlHelperManager.cs b/Assets/Scripts/AlHelperManager.cs
new file mode 100644
index 0000000..184c8ea
--- /dev/null
+++ b/Assets/Scripts/AlHelperManager.cs
@@ -0,0 +1,359 @@
+using System.Threading;
+using System.Threading.Tasks;
+using System;
+using System.Collections;
+using System.Linq;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using AOT;
+using UnityEngine;
+using AIHelp;
+
+public class AlHelperManager : MonoBehaviour
+{
+ //public string domain = "release.aihelp.net";
+
+ //public string appId = "";
+ //public string Language = "";
+ private static AlHelperManager _instance;
+
+ public static AlHelperManager Instance
+ {
+ get {
+ if (_instance == null)
+ {
+ GameObject obj = new GameObject("AlHelperManager");
+ _instance = obj.AddComponent();
+ DontDestroyOnLoad(obj);
+ }
+ return _instance;
+ }
+
+ }
+
+ public void Initialize(string domain, string appId,string language = "")
+ {
+ UnityMainThreadDispatcher.Initialize();
+ AIHelpSupport.enableLogging(true);
+
+ AIHelpSupport.Initialize(domain, appId, language);
+ RegisterAIHelpEventListener();
+ }
+
+ private void Awake()
+ {
+ //UnityMainThreadDispatcher.Initialize();
+ //AIHelpSupport.enableLogging(true);
+
+//#if UNITY_ANDROID
+// if (Application.platform == RuntimePlatform.Android)
+// {
+// appId = "TryElva_platform_79453658-02b7-42fb-9384-8e8712539777";
+// }
+//#endif
+//#if UNITY_IOS
+// if (Application.platform == RuntimePlatform.IPhonePlayer)
+// {
+// appId = "TryElva_platform_09ebf7fa-8d45-4843-bd59-cfda3d8a8dc0";
+// }
+//#endif
+ //AIHelpSupport.Initialize(domain, appId);
+ //RegisterAIHelpEventListener();
+ }
+
+ private void Start()
+ {
+ //Dictionary dic = new Dictionary()
+ //{
+ // {"Canvas/customer", customerServiceClick},
+ // {"Canvas/helpcenter", helpCenterClick},
+ // {"Canvas/custom", customEntranceClick},
+ // {"Canvas/singleFAQ", singleFAQClick},
+ // {"Canvas/updateUserInfo", updateUserInfoClick},
+ // {"Canvas/updateSDKLanguage", updateSDKLanguageClick},
+ // {"Canvas/isHelpShow", isHelpShowClick},
+ // {"Canvas/unreadMeassage", unreadMeassageClick},
+ // {"Canvas/uploadLog", upLoadLogClick},
+ // {"Canvas/enableLogging", enableLoggingClick},
+ // {"Canvas/SDKVersion", SDKVersionClick},
+ // //{"Canvas/showUrl", showUrlClick},
+ // //{"Canvas/runAcceleration", runAccelerationClick},
+ //};
+
+ //dic.All(keyval =>
+ //{
+ // GameObject robotObj = GameObject.Find(keyval.Key);
+
+ // Button robotBtn = (Button)robotObj.GetComponent