com.taptap.sdk.core 4.3.0-aplha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Editor/BuildTargetUtils.cs +14 -0
- package/Editor/BuildTargetUtils.cs.meta +11 -0
- package/Editor/LinkXMLGenerator.cs +70 -0
- package/Editor/LinkXMLGenerator.cs.meta +11 -0
- package/Editor/Plist.cs +954 -0
- package/Editor/Plist.cs.meta +3 -0
- package/Editor/SDKLinkProcessBuild.cs +119 -0
- package/Editor/SDKLinkProcessBuild.cs.meta +11 -0
- package/Editor/TapFileHelper.cs +168 -0
- package/Editor/TapFileHelper.cs.meta +3 -0
- package/Editor/TapSDK.Core.Editor.asmdef +15 -0
- package/Editor/TapSDK.Core.Editor.asmdef.meta +7 -0
- package/Editor/TapSDKCoreCompile.cs +284 -0
- package/Editor/TapSDKCoreCompile.cs.meta +3 -0
- package/Editor/TapSDKCoreIOSProcessor.cs +74 -0
- package/Editor/TapSDKCoreIOSProcessor.cs.meta +3 -0
- package/Editor/UI/ScrollViewEditor.cs +267 -0
- package/Editor/UI/ScrollViewEditor.cs.meta +12 -0
- package/Editor/UI/ScrollViewExEditor.cs +34 -0
- package/Editor/UI/ScrollViewExEditor.cs.meta +12 -0
- package/Editor/UI/TapSDK.UI.Editor.asmdef +17 -0
- package/Editor/UI/TapSDK.UI.Editor.asmdef.meta +7 -0
- package/Editor/UI.meta +9 -0
- package/Editor.meta +8 -0
- package/Mobile/Editor/NativeDependencies.xml +22 -0
- package/Mobile/Editor/NativeDependencies.xml.meta +7 -0
- package/Mobile/Editor/TapCommonMobileProcessBuild.cs +20 -0
- package/Mobile/Editor/TapCommonMobileProcessBuild.cs.meta +11 -0
- package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef +17 -0
- package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef.meta +7 -0
- package/Mobile/Editor.meta +8 -0
- package/Mobile/Runtime/AndroidNativeWrapper.cs +50 -0
- package/Mobile/Runtime/AndroidNativeWrapper.cs.meta +11 -0
- package/Mobile/Runtime/Bridge.cs +84 -0
- package/Mobile/Runtime/Bridge.cs.meta +11 -0
- package/Mobile/Runtime/BridgeAndroid.cs +73 -0
- package/Mobile/Runtime/BridgeAndroid.cs.meta +11 -0
- package/Mobile/Runtime/BridgeCallback.cs +35 -0
- package/Mobile/Runtime/BridgeCallback.cs.meta +11 -0
- package/Mobile/Runtime/BridgeIOS.cs +113 -0
- package/Mobile/Runtime/BridgeIOS.cs.meta +11 -0
- package/Mobile/Runtime/Command.cs +119 -0
- package/Mobile/Runtime/Command.cs.meta +11 -0
- package/Mobile/Runtime/Constants.cs +9 -0
- package/Mobile/Runtime/Constants.cs.meta +11 -0
- package/Mobile/Runtime/EngineBridgeInitializer.cs +33 -0
- package/Mobile/Runtime/EngineBridgeInitializer.cs.meta +11 -0
- package/Mobile/Runtime/IBridge.cs +15 -0
- package/Mobile/Runtime/IBridge.cs.meta +11 -0
- package/Mobile/Runtime/IOSNativeWrapper.cs +273 -0
- package/Mobile/Runtime/IOSNativeWrapper.cs.meta +11 -0
- package/Mobile/Runtime/Result.cs +37 -0
- package/Mobile/Runtime/Result.cs.meta +11 -0
- package/Mobile/Runtime/TapCoreMobile.cs +71 -0
- package/Mobile/Runtime/TapCoreMobile.cs.meta +11 -0
- package/Mobile/Runtime/TapEventMobile.cs +265 -0
- package/Mobile/Runtime/TapEventMobile.cs.meta +11 -0
- package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef +18 -0
- package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef.meta +7 -0
- package/Mobile/Runtime/TapUUID.cs +9 -0
- package/Mobile/Runtime/TapUUID.cs.meta +11 -0
- package/Mobile/Runtime.meta +8 -0
- package/Mobile.meta +8 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins.meta +8 -0
- package/Resources/Fonts/taptap-sdk-bold.ttf +0 -0
- package/Resources/Fonts/taptap-sdk-bold.ttf.meta +22 -0
- package/Resources/Fonts/taptap-sdk.ttf +0 -0
- package/Resources/Fonts/taptap-sdk.ttf.meta +21 -0
- package/Resources/Fonts.meta +8 -0
- package/Resources/Loading.prefab +260 -0
- package/Resources/Loading.prefab.meta +7 -0
- package/Resources/TapCommonTip.prefab +194 -0
- package/Resources/TapCommonTip.prefab.meta +7 -0
- package/Resources/TapCommonToastBlack.prefab +528 -0
- package/Resources/TapCommonToastBlack.prefab.meta +7 -0
- package/Resources/TapCommonToastWhite.prefab +411 -0
- package/Resources/TapCommonToastWhite.prefab.meta +7 -0
- package/Resources/TapSDKCommonTapIcon-v2.png +0 -0
- package/Resources/TapSDKCommonTapIcon-v2.png.meta +128 -0
- package/Resources/TapSDKCommonTapIcon.png +0 -0
- package/Resources/TapSDKCommonTapIcon.png.meta +128 -0
- package/Resources/TapSDKCommonToastBg.png +0 -0
- package/Resources/TapSDKCommonToastBg.png.meta +128 -0
- package/Resources/TapSDKConstantUIRoot.prefab +100 -0
- package/Resources/TapSDKConstantUIRoot.prefab.meta +7 -0
- package/Resources/TapSDKUIRoot.prefab +100 -0
- package/Resources/TapSDKUIRoot.prefab.meta +7 -0
- package/Resources/TapTapBtn_White.png +0 -0
- package/Resources/TapTapBtn_White.png.meta +128 -0
- package/Resources/TapTapBtn_White_2.png +0 -0
- package/Resources/TapTapBtn_White_2.png.meta +128 -0
- package/Resources/ToastBackground.png +0 -0
- package/Resources/ToastBackground.png.meta +128 -0
- package/Resources/detail_bg.png +0 -0
- package/Resources/detail_bg.png.meta +92 -0
- package/Resources/success.png +0 -0
- package/Resources/success.png.meta +128 -0
- package/Resources/taptap-bg.png +0 -0
- package/Resources/taptap-bg.png.meta +140 -0
- package/Resources/taptap-close.png +0 -0
- package/Resources/taptap-close.png.meta +146 -0
- package/Resources/taptap-router-v2.png +0 -0
- package/Resources/taptap-router-v2.png.meta +128 -0
- package/Resources/taptap-router.png +0 -0
- package/Resources/taptap-router.png.meta +146 -0
- package/Resources/taptap-sdk-refresh 1.png +0 -0
- package/Resources/taptap-sdk-refresh 1.png.meta +128 -0
- package/Resources/taptap-toast-error.png +0 -0
- package/Resources/taptap-toast-error.png.meta +128 -0
- package/Resources/taptap-toast-info.png +0 -0
- package/Resources/taptap-toast-info.png.meta +128 -0
- package/Resources/taptap-toast-success.png +0 -0
- package/Resources/taptap-toast-success.png.meta +128 -0
- package/Resources/taptap-toast-warning.png +0 -0
- package/Resources/taptap-toast-warning.png.meta +128 -0
- package/Resources.meta +8 -0
- package/Runtime/Internal/Http/TapHttpClient.cs +176 -0
- package/Runtime/Internal/Http/TapHttpClient.cs.meta +11 -0
- package/Runtime/Internal/Http/TapHttpUtils.cs +83 -0
- package/Runtime/Internal/Http/TapHttpUtils.cs.meta +11 -0
- package/Runtime/Internal/Http.meta +8 -0
- package/Runtime/Internal/Init/IInitTask.cs +18 -0
- package/Runtime/Internal/Init/IInitTask.cs.meta +11 -0
- package/Runtime/Internal/Init.meta +8 -0
- package/Runtime/Internal/Json/TapJsonConverter.cs +40 -0
- package/Runtime/Internal/Json/TapJsonConverter.cs.meta +11 -0
- package/Runtime/Internal/Json.meta +8 -0
- package/Runtime/Internal/Platform/ITapCorePlatform.cs +12 -0
- package/Runtime/Internal/Platform/ITapCorePlatform.cs.meta +11 -0
- package/Runtime/Internal/Platform/ITapEventPlatform.cs +37 -0
- package/Runtime/Internal/Platform/ITapEventPlatform.cs.meta +11 -0
- package/Runtime/Internal/Platform/PlatformTypeUtils.cs +46 -0
- package/Runtime/Internal/Platform/PlatformTypeUtils.cs.meta +11 -0
- package/Runtime/Internal/Platform.meta +8 -0
- package/Runtime/Internal/UI/Base/Const.cs +27 -0
- package/Runtime/Internal/UI/Base/Const.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs +240 -0
- package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/LoadingPanelController.cs +29 -0
- package/Runtime/Internal/UI/Base/LoadingPanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/MonoSingleton.cs +102 -0
- package/Runtime/Internal/UI/Base/MonoSingleton.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/Singleton.cs +29 -0
- package/Runtime/Internal/UI/Base/Singleton.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/TipPanelController.cs +45 -0
- package/Runtime/Internal/UI/Base/TipPanelController.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs +95 -0
- package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs +79 -0
- package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/UIManager.cs +724 -0
- package/Runtime/Internal/UI/Base/UIManager.cs.meta +11 -0
- package/Runtime/Internal/UI/Base.meta +8 -0
- package/Runtime/Internal/UI/BasePanel/BasePanelController.cs +385 -0
- package/Runtime/Internal/UI/BasePanel/BasePanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/BasePanel.meta +8 -0
- package/Runtime/Internal/UI/Params/BasePanelConfig.cs +18 -0
- package/Runtime/Internal/UI/Params/BasePanelConfig.cs.meta +11 -0
- package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs +7 -0
- package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs.meta +11 -0
- package/Runtime/Internal/UI/Params.meta +8 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs +76 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool.meta +9 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs +828 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs +245 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView.meta +9 -0
- package/Runtime/Internal/UI/ScrollViewEx.meta +8 -0
- package/Runtime/Internal/UI.meta +8 -0
- package/Runtime/Internal/Utils/BridgeUtils.cs +29 -0
- package/Runtime/Internal/Utils/BridgeUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils/ImageUtils.cs +147 -0
- package/Runtime/Internal/Utils/ImageUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils/TapLoom.cs +155 -0
- package/Runtime/Internal/Utils/TapLoom.cs.meta +11 -0
- package/Runtime/Internal/Utils/UrlUtils.cs +34 -0
- package/Runtime/Internal/Utils/UrlUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils.meta +8 -0
- package/Runtime/Internal.meta +8 -0
- package/Runtime/Public/DataStorage.cs +141 -0
- package/Runtime/Public/DataStorage.cs.meta +11 -0
- package/Runtime/Public/ITapPropertiesProxy.cs +6 -0
- package/Runtime/Public/ITapPropertiesProxy.cs.meta +11 -0
- package/Runtime/Public/Json.cs +636 -0
- package/Runtime/Public/Json.cs.meta +11 -0
- package/Runtime/Public/Log/TapLogLevel.cs +7 -0
- package/Runtime/Public/Log/TapLogLevel.cs.meta +11 -0
- package/Runtime/Public/Log/TapLogger.cs +48 -0
- package/Runtime/Public/Log/TapLogger.cs.meta +11 -0
- package/Runtime/Public/Log.meta +8 -0
- package/Runtime/Public/Platform.cs +27 -0
- package/Runtime/Public/Platform.cs.meta +11 -0
- package/Runtime/Public/RegionType.cs +8 -0
- package/Runtime/Public/RegionType.cs.meta +11 -0
- package/Runtime/Public/SafeDictionary.cs +27 -0
- package/Runtime/Public/SafeDictionary.cs.meta +11 -0
- package/Runtime/Public/TapError.cs +62 -0
- package/Runtime/Public/TapError.cs.meta +11 -0
- package/Runtime/Public/TapErrorCode.cs +44 -0
- package/Runtime/Public/TapErrorCode.cs.meta +11 -0
- package/Runtime/Public/TapException.cs +24 -0
- package/Runtime/Public/TapException.cs.meta +11 -0
- package/Runtime/Public/TapLanguage.cs +21 -0
- package/Runtime/Public/TapLanguage.cs.meta +11 -0
- package/Runtime/Public/TapLocalizeManager.cs +128 -0
- package/Runtime/Public/TapLocalizeManager.cs.meta +11 -0
- package/Runtime/Public/TapTapEvent.cs +93 -0
- package/Runtime/Public/TapTapEvent.cs.meta +11 -0
- package/Runtime/Public/TapTapSDK.cs +96 -0
- package/Runtime/Public/TapTapSDK.cs.meta +11 -0
- package/Runtime/Public/TapTapSDKCoreOptions.cs +104 -0
- package/Runtime/Public/TapTapSDKCoreOptions.cs.meta +11 -0
- package/Runtime/Public.meta +8 -0
- package/Runtime/TapSDK.Core.Runtime.asmdef +3 -0
- package/Runtime/TapSDK.Core.Runtime.asmdef.meta +7 -0
- package/Runtime.meta +8 -0
- package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs +20 -0
- package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs.meta +11 -0
- package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef +17 -0
- package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef.meta +7 -0
- package/Standalone/Editor.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist +46 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo +0 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources +115 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle.meta +33 -0
- package/Standalone/Plugins/macOS.meta +8 -0
- package/Standalone/Plugins.meta +8 -0
- package/Standalone/Runtime/Internal/Constants.cs +37 -0
- package/Standalone/Runtime/Internal/Constants.cs.meta +11 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs +152 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs.meta +11 -0
- package/Standalone/Runtime/Internal/EventSender.cs +239 -0
- package/Standalone/Runtime/Internal/EventSender.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/HttpClient.cs +211 -0
- package/Standalone/Runtime/Internal/Http/HttpClient.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/NetUtils.cs +48 -0
- package/Standalone/Runtime/Internal/Http/NetUtils.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/TimeUtil.cs +30 -0
- package/Standalone/Runtime/Internal/Http/TimeUtil.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http.meta +8 -0
- package/Standalone/Runtime/Internal/Identity.cs +43 -0
- package/Standalone/Runtime/Internal/Identity.cs.meta +11 -0
- package/Standalone/Runtime/Internal/PlayRecorder.cs +53 -0
- package/Standalone/Runtime/Internal/PlayRecorder.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Prefs.cs +85 -0
- package/Standalone/Runtime/Internal/Prefs.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Tracker.cs +318 -0
- package/Standalone/Runtime/Internal/Tracker.cs.meta +11 -0
- package/Standalone/Runtime/Internal/User.cs +51 -0
- package/Standalone/Runtime/Internal/User.cs.meta +11 -0
- package/Standalone/Runtime/Internal.meta +8 -0
- package/Standalone/Runtime/Public/EventManager.cs +41 -0
- package/Standalone/Runtime/Public/EventManager.cs.meta +11 -0
- package/Standalone/Runtime/Public/TapCoreStandalone.cs +197 -0
- package/Standalone/Runtime/Public/TapCoreStandalone.cs.meta +11 -0
- package/Standalone/Runtime/Public/TapEventStandalone.cs +281 -0
- package/Standalone/Runtime/Public/TapEventStandalone.cs.meta +11 -0
- package/Standalone/Runtime/Public.meta +8 -0
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef +21 -0
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef.meta +7 -0
- package/Standalone/Runtime.meta +8 -0
- package/Standalone.meta +8 -0
- package/package.json +8 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Runtime.InteropServices;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
using System.Collections;
|
|
5
|
+
using TapSDK.Core.Internal;
|
|
6
|
+
using TapSDK.Core;
|
|
7
|
+
|
|
8
|
+
namespace TapSDK.Core.Mobile {
|
|
9
|
+
public class IOSNativeWrapper
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
#if UNITY_IOS
|
|
13
|
+
// 导入 C 函数
|
|
14
|
+
[DllImport("__Internal")]
|
|
15
|
+
private static extern void _TapTapSDKInitWithCoreAndOtherOptions(
|
|
16
|
+
string initOptionsJson,
|
|
17
|
+
string otherOptionsJson
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
[DllImport("__Internal")]
|
|
21
|
+
private static extern void _TapTapSDKInit(
|
|
22
|
+
string initOptionsJson
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
[DllImport("__Internal")]
|
|
26
|
+
private static extern void _TapTapEventSetUserID(string userID);
|
|
27
|
+
|
|
28
|
+
[DllImport("__Internal")]
|
|
29
|
+
private static extern void _TapTapEventSetUserIDWithProperties(string userID, string propertiesJson);
|
|
30
|
+
|
|
31
|
+
[DllImport("__Internal")]
|
|
32
|
+
private static extern void _TapTapEventClearUser();
|
|
33
|
+
|
|
34
|
+
[DllImport("__Internal")]
|
|
35
|
+
private static extern string _TapTapEventGetDeviceId();
|
|
36
|
+
|
|
37
|
+
[DllImport("__Internal")]
|
|
38
|
+
private static extern void _TapTapEventLogEvent(string name, string propertiesJson);
|
|
39
|
+
|
|
40
|
+
[DllImport("__Internal")]
|
|
41
|
+
private static extern void _TapTapEventLogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string propertiesJson);
|
|
42
|
+
|
|
43
|
+
[DllImport("__Internal")]
|
|
44
|
+
private static extern void _TapTapEventDeviceInitialize(string propertiesJson);
|
|
45
|
+
|
|
46
|
+
[DllImport("__Internal")]
|
|
47
|
+
private static extern void _TapTapEventDeviceUpdate(string propertiesJson);
|
|
48
|
+
|
|
49
|
+
[DllImport("__Internal")]
|
|
50
|
+
private static extern void _TapTapEventDeviceAdd(string propertiesJson);
|
|
51
|
+
|
|
52
|
+
[DllImport("__Internal")]
|
|
53
|
+
private static extern void _TapTapEventUserInitialize(string propertiesJson);
|
|
54
|
+
|
|
55
|
+
[DllImport("__Internal")]
|
|
56
|
+
private static extern void _TapTapEventUserUpdate(string propertiesJson);
|
|
57
|
+
|
|
58
|
+
[DllImport("__Internal")]
|
|
59
|
+
private static extern void _TapTapEventUserAdd(string propertiesJson);
|
|
60
|
+
|
|
61
|
+
[DllImport("__Internal")]
|
|
62
|
+
private static extern void _TapTapEventAddCommonProperty(string key, string value);
|
|
63
|
+
|
|
64
|
+
[DllImport("__Internal")]
|
|
65
|
+
private static extern void _TapTapEventAddCommon(string propertiesJson);
|
|
66
|
+
|
|
67
|
+
[DllImport("__Internal")]
|
|
68
|
+
private static extern void _TapTapEventClearCommonProperty(string key);
|
|
69
|
+
|
|
70
|
+
[DllImport("__Internal")]
|
|
71
|
+
private static extern void _TapTapEventClearCommonProperties(string[] keys, int count);
|
|
72
|
+
|
|
73
|
+
[DllImport("__Internal")]
|
|
74
|
+
private static extern void _TapTapEventClearAllCommonProperties();
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
// 定义一个委托类型,匹配 Objective-C 中的 block 参数
|
|
78
|
+
public delegate string DynamicPropertiesCalculatorDelegate();
|
|
79
|
+
|
|
80
|
+
// 注意:这个方法的封装比较特殊,因为它需要一个返回 NSDictionary 的回调。
|
|
81
|
+
[DllImport("__Internal")]
|
|
82
|
+
private static extern void _TapTapEventRegisterDynamicProperties(DynamicPropertiesCalculatorDelegate callback);
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// 插入 UA
|
|
86
|
+
[DllImport("__Internal")]
|
|
87
|
+
private static extern void _TapTapSDKCoreAppendUA(string platform, string version);
|
|
88
|
+
|
|
89
|
+
[DllImport("__Internal")]
|
|
90
|
+
private static extern void _TapTapSDKCoreSetSDKArtifact(string artifact);
|
|
91
|
+
|
|
92
|
+
[DllImport("__Internal")]
|
|
93
|
+
private static extern void _TapTapSDKCoreSwitchToRND();
|
|
94
|
+
|
|
95
|
+
// 提供给 Unity 调用的 C# 方法
|
|
96
|
+
public static void Init(TapTapSDKCoreOptions coreOption, TapTapSDKBaseOption[] otherOptions)
|
|
97
|
+
{
|
|
98
|
+
// 将其他选项转换为JSON字符串
|
|
99
|
+
string otherOptionsJson = ConvertOtherOptionsToJson(otherOptions);
|
|
100
|
+
// 调用C方法
|
|
101
|
+
_TapTapSDKInitWithCoreAndOtherOptions(
|
|
102
|
+
JsonUtility.ToJson(coreOption),
|
|
103
|
+
otherOptionsJson
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 提供给 Unity 调用的 C# 方法
|
|
108
|
+
public static void Init(TapTapSDKCoreOptions coreOption)
|
|
109
|
+
{
|
|
110
|
+
// 调用C方法
|
|
111
|
+
_TapTapSDKInit(
|
|
112
|
+
JsonUtility.ToJson(coreOption)
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public static void SetUserID(string userID)
|
|
117
|
+
{
|
|
118
|
+
_TapTapEventSetUserID(userID);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public static void SetUserID(string userID, string properties)
|
|
122
|
+
{
|
|
123
|
+
_TapTapEventSetUserIDWithProperties(userID, properties);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
public static void ClearUser()
|
|
127
|
+
{
|
|
128
|
+
_TapTapEventClearUser();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public static string GetDeviceId()
|
|
132
|
+
{
|
|
133
|
+
return _TapTapEventGetDeviceId();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public static void LogEvent(string name, string properties)
|
|
137
|
+
{
|
|
138
|
+
_TapTapEventLogEvent(name, properties);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
public static void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties)
|
|
142
|
+
{
|
|
143
|
+
_TapTapEventLogChargeEvent(orderID, productName, amount, currencyType, paymentMethod, properties);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
public static void DeviceInitialize(string properties)
|
|
147
|
+
{
|
|
148
|
+
_TapTapEventDeviceInitialize(properties);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
public static void DeviceUpdate(string properties)
|
|
152
|
+
{
|
|
153
|
+
_TapTapEventDeviceUpdate(properties);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
public static void DeviceAdd(string properties)
|
|
157
|
+
{
|
|
158
|
+
_TapTapEventDeviceAdd(properties);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public static void UserInitialize(string properties)
|
|
162
|
+
{
|
|
163
|
+
_TapTapEventUserInitialize(properties);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
public static void UserUpdate(string properties)
|
|
167
|
+
{
|
|
168
|
+
_TapTapEventUserUpdate(properties);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
public static void UserAdd(string properties)
|
|
172
|
+
{
|
|
173
|
+
_TapTapEventUserAdd(properties);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
public static void AddCommonProperty(string key, string value)
|
|
177
|
+
{
|
|
178
|
+
_TapTapEventAddCommonProperty(key, value);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
public static void AddCommon(string properties)
|
|
182
|
+
{
|
|
183
|
+
_TapTapEventAddCommon(properties);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
public static void ClearCommonProperty(string key)
|
|
187
|
+
{
|
|
188
|
+
_TapTapEventClearCommonProperty(key);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
public static void ClearCommonProperties(string[] keys)
|
|
192
|
+
{
|
|
193
|
+
_TapTapEventClearCommonProperties(keys, keys.Length);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
public static void ClearAllCommonProperties()
|
|
197
|
+
{
|
|
198
|
+
_TapTapEventClearAllCommonProperties();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
public static void SetRND(){
|
|
202
|
+
_TapTapSDKCoreSwitchToRND();
|
|
203
|
+
}
|
|
204
|
+
// 定义一个 Func<string> 委托,用于从 Unity 使用者那里获取动态属性
|
|
205
|
+
private static Func<string> dynamicPropertiesCallback;
|
|
206
|
+
public static void RegisterDynamicProperties(Func<string> callback)
|
|
207
|
+
{
|
|
208
|
+
dynamicPropertiesCallback = callback;
|
|
209
|
+
_TapTapEventRegisterDynamicProperties(DynamicPropertiesCalculator);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Unity 端的回调方法,返回一个 JSON 字符串
|
|
213
|
+
[AOT.MonoPInvokeCallback(typeof(DynamicPropertiesCalculatorDelegate))]
|
|
214
|
+
private static string DynamicPropertiesCalculator()
|
|
215
|
+
{
|
|
216
|
+
if (dynamicPropertiesCallback != null)
|
|
217
|
+
{
|
|
218
|
+
string properties = dynamicPropertiesCallback();
|
|
219
|
+
return properties;
|
|
220
|
+
}
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private static string ConvertOtherOptionsToJson(TapTapSDKBaseOption[] otherOptions)
|
|
225
|
+
{
|
|
226
|
+
if (otherOptions == null || otherOptions.Length == 0)
|
|
227
|
+
{
|
|
228
|
+
return "[]"; // 如果没有其他选项,则返回空数组的JSON表示
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// 创建一个数组来存储每个选项的JSON字符串
|
|
232
|
+
string[] jsonOptions = new string[otherOptions.Length];
|
|
233
|
+
|
|
234
|
+
for (int i = 0; i < otherOptions.Length; i++)
|
|
235
|
+
{
|
|
236
|
+
// 获取moduleName
|
|
237
|
+
string moduleName = otherOptions[i].moduleName;
|
|
238
|
+
|
|
239
|
+
// 使用JsonUtility将每个选项对象转换为JSON字符串
|
|
240
|
+
string optionJson = JsonUtility.ToJson(otherOptions[i]);
|
|
241
|
+
|
|
242
|
+
// 将moduleName添加到JSON字符串中
|
|
243
|
+
optionJson = AddModuleNameToJson(optionJson, moduleName);
|
|
244
|
+
|
|
245
|
+
jsonOptions[i] = optionJson;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// 将所有JSON字符串连接成一个JSON数组
|
|
249
|
+
string jsonArray = "[" + string.Join(",", jsonOptions) + "]";
|
|
250
|
+
|
|
251
|
+
return jsonArray;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// 辅助方法,用于将moduleName添加到JSON字符串中
|
|
255
|
+
private static string AddModuleNameToJson(string json, string moduleName)
|
|
256
|
+
{
|
|
257
|
+
// 在JSON字符串的开头添加moduleName字段
|
|
258
|
+
return "{\"moduleName\":\"" + moduleName + "\"," + json.TrimStart('{');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// 调用此方法来设置 xuaMap
|
|
262
|
+
public static void SetPlatformAndVersion(string platform, string version)
|
|
263
|
+
{
|
|
264
|
+
_TapTapSDKCoreAppendUA(platform, version);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
public static void SetSDKArtifact(string artifact)
|
|
268
|
+
{
|
|
269
|
+
_TapTapSDKCoreSetSDKArtifact(artifact);
|
|
270
|
+
}
|
|
271
|
+
#endif
|
|
272
|
+
}
|
|
273
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.Core
|
|
5
|
+
{
|
|
6
|
+
[Serializable]
|
|
7
|
+
public class Result
|
|
8
|
+
{
|
|
9
|
+
public static int RESULT_SUCCESS = 0;
|
|
10
|
+
|
|
11
|
+
public static int RESULT_ERROR = -1;
|
|
12
|
+
|
|
13
|
+
[SerializeField] public int code;
|
|
14
|
+
|
|
15
|
+
[SerializeField] public string message;
|
|
16
|
+
|
|
17
|
+
[SerializeField] public string content;
|
|
18
|
+
|
|
19
|
+
[SerializeField] public string callbackId;
|
|
20
|
+
|
|
21
|
+
[SerializeField] public bool onceTime;
|
|
22
|
+
|
|
23
|
+
public Result()
|
|
24
|
+
{
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public Result(string json)
|
|
28
|
+
{
|
|
29
|
+
JsonUtility.FromJsonOverwrite(json, this);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public string ToJSON()
|
|
33
|
+
{
|
|
34
|
+
return JsonUtility.ToJson(this);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Threading.Tasks;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using System.Runtime.InteropServices;
|
|
5
|
+
using TapSDK.Core.Internal;
|
|
6
|
+
using TapSDK.Core.Internal.Utils;
|
|
7
|
+
using System.Collections.Generic;
|
|
8
|
+
using UnityEngine;
|
|
9
|
+
using Newtonsoft.Json;
|
|
10
|
+
|
|
11
|
+
namespace TapSDK.Core.Mobile
|
|
12
|
+
{
|
|
13
|
+
public class TapCoreMobile : ITapCorePlatform
|
|
14
|
+
{
|
|
15
|
+
private EngineBridge Bridge = EngineBridge.GetInstance();
|
|
16
|
+
|
|
17
|
+
public TapCoreMobile()
|
|
18
|
+
{
|
|
19
|
+
Debug.Log("TapCoreMobile constructor");
|
|
20
|
+
TapLoom.Initialize();
|
|
21
|
+
EngineBridgeInitializer.Initialize();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public void Init(TapTapSDKCoreOptions coreOption, TapTapSDKBaseOption[] otherOptions)
|
|
25
|
+
{
|
|
26
|
+
Debug.Log("TapCoreMobile SDK inited");
|
|
27
|
+
SetPlatformAndVersion(TapTapSDK.SDKPlatform, TapTapSDK.SDKVersion);
|
|
28
|
+
string coreOptionsJson = JsonUtility.ToJson(coreOption);
|
|
29
|
+
string[] otherOptionsJson = otherOptions.Select(option => JsonConvert.SerializeObject(option)).ToArray();
|
|
30
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
31
|
+
.Method("init")
|
|
32
|
+
.Args("coreOption", coreOptionsJson)
|
|
33
|
+
.Args("otherOptions", otherOptionsJson)
|
|
34
|
+
.CommandBuilder());
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private void SetPlatformAndVersion(string platform, string version)
|
|
38
|
+
{
|
|
39
|
+
Debug.Log("TapCoreMobile SetPlatformAndVersion called with platform: " + platform + " and version: " + version);
|
|
40
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
41
|
+
.Method("setPlatformAndVersion")
|
|
42
|
+
.Args("platform", TapTapSDK.SDKPlatform)
|
|
43
|
+
.Args("version", TapTapSDK.SDKVersion)
|
|
44
|
+
.CommandBuilder());
|
|
45
|
+
SetSDKArtifact("Unity");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private void SetSDKArtifact(string value)
|
|
49
|
+
{
|
|
50
|
+
Debug.Log("TapCoreMobile SetSDKArtifact called with value: " + value);
|
|
51
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
52
|
+
.Method("setSDKArtifact")
|
|
53
|
+
.Args("artifact", "Unity")
|
|
54
|
+
.CommandBuilder());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public void Init(TapTapSDKCoreOptions coreOption)
|
|
58
|
+
{
|
|
59
|
+
Init(coreOption, new TapTapSDKBaseOption[0]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public void UpdateLanguage(TapTapLanguageType language)
|
|
63
|
+
{
|
|
64
|
+
Debug.Log("TapCoreMobile UpdateLanguage language: " + language);
|
|
65
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
66
|
+
.Method("updateLanguage")
|
|
67
|
+
.Args("language", (int)language)
|
|
68
|
+
.CommandBuilder());
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Threading.Tasks;
|
|
3
|
+
using System.Runtime.InteropServices;
|
|
4
|
+
using TapSDK.Core.Internal;
|
|
5
|
+
using System.Collections.Generic;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace TapSDK.Core.Mobile
|
|
9
|
+
{
|
|
10
|
+
public class TapEventMobile : ITapEventPlatform
|
|
11
|
+
{
|
|
12
|
+
private EngineBridge Bridge = EngineBridge.GetInstance();
|
|
13
|
+
|
|
14
|
+
public TapEventMobile()
|
|
15
|
+
{
|
|
16
|
+
Debug.Log("TapEventMobile constructor");
|
|
17
|
+
EngineBridgeInitializer.Initialize();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public void SetUserID(string userID)
|
|
21
|
+
{
|
|
22
|
+
Debug.Log("TapEventMobile SetUserID = " + userID);
|
|
23
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
24
|
+
.Method("setUserID")
|
|
25
|
+
.Args("userID", userID)
|
|
26
|
+
.CommandBuilder());
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public void SetUserID(string userID, string properties)
|
|
30
|
+
{
|
|
31
|
+
Debug.Log("TapEventMobile SetUserID" + userID + properties);
|
|
32
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
33
|
+
.Method("setUserID")
|
|
34
|
+
.Args("userID", userID)
|
|
35
|
+
.Args("properties", properties)
|
|
36
|
+
.CommandBuilder());
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public void ClearUser()
|
|
40
|
+
{
|
|
41
|
+
Debug.Log("TapEventMobile ClearUser");
|
|
42
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
43
|
+
.Method("clearUser")
|
|
44
|
+
.CommandBuilder());
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public string GetDeviceId()
|
|
48
|
+
{
|
|
49
|
+
string deviceId = Bridge.CallWithReturnValue(EngineBridgeInitializer.GetBridgeServer()
|
|
50
|
+
.Method("getDeviceId")
|
|
51
|
+
.CommandBuilder());
|
|
52
|
+
Debug.Log("TapEventMobile GetDeviceId = " + deviceId);
|
|
53
|
+
return deviceId;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public void LogEvent(string name, string properties)
|
|
57
|
+
{
|
|
58
|
+
Debug.Log("TapEventMobile LogEvent" + name + properties);
|
|
59
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
60
|
+
.Method("logEvent")
|
|
61
|
+
.Args("name", name)
|
|
62
|
+
.Args("properties", properties)
|
|
63
|
+
.CommandBuilder());
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public void DeviceInitialize(string properties)
|
|
67
|
+
{
|
|
68
|
+
Debug.Log("TapEventMobile DeviceInitialize" + properties);
|
|
69
|
+
#if UNITY_IOS
|
|
70
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
71
|
+
.Method("deviceInitialize")
|
|
72
|
+
.Args("deviceInitialize", properties)
|
|
73
|
+
.CommandBuilder());
|
|
74
|
+
#else
|
|
75
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
76
|
+
.Method("deviceInitialize")
|
|
77
|
+
.Args("properties", properties)
|
|
78
|
+
.CommandBuilder());
|
|
79
|
+
#endif
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public void DeviceUpdate(string properties)
|
|
83
|
+
{
|
|
84
|
+
Debug.Log("TapEventMobile DeviceUpdate" + properties);
|
|
85
|
+
#if UNITY_IOS
|
|
86
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
87
|
+
.Method("deviceUpdate")
|
|
88
|
+
.Args("deviceUpdate", properties)
|
|
89
|
+
.CommandBuilder());
|
|
90
|
+
IOSNativeWrapper.DeviceUpdate(properties);
|
|
91
|
+
#else
|
|
92
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
93
|
+
.Method("deviceUpdate")
|
|
94
|
+
.Args("properties", properties)
|
|
95
|
+
.CommandBuilder());
|
|
96
|
+
#endif
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public void DeviceAdd(string properties)
|
|
100
|
+
{
|
|
101
|
+
Debug.Log("TapEventMobile DeviceAdd" + properties);
|
|
102
|
+
#if UNITY_IOS
|
|
103
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
104
|
+
.Method("deviceAdd")
|
|
105
|
+
.Args("deviceAdd", properties)
|
|
106
|
+
.CommandBuilder());
|
|
107
|
+
#else
|
|
108
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
109
|
+
.Method("deviceAdd")
|
|
110
|
+
.Args("properties", properties)
|
|
111
|
+
.CommandBuilder());
|
|
112
|
+
#endif
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public void UserInitialize(string properties)
|
|
116
|
+
{
|
|
117
|
+
Debug.Log("TapEventMobile UserInitialize" + properties);
|
|
118
|
+
#if UNITY_IOS
|
|
119
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
120
|
+
.Method("userInitialize")
|
|
121
|
+
.Args("userInitialize", properties)
|
|
122
|
+
.CommandBuilder());
|
|
123
|
+
#else
|
|
124
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
125
|
+
.Method("userInitialize")
|
|
126
|
+
.Args("properties", properties)
|
|
127
|
+
.CommandBuilder());
|
|
128
|
+
#endif
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public void UserUpdate(string properties)
|
|
132
|
+
{
|
|
133
|
+
Debug.Log("TapEventMobile UserUpdate" + properties);
|
|
134
|
+
#if UNITY_IOS
|
|
135
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
136
|
+
.Method("userUpdate")
|
|
137
|
+
.Args("userUpdate", properties)
|
|
138
|
+
.CommandBuilder());
|
|
139
|
+
#else
|
|
140
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
141
|
+
.Method("userUpdate")
|
|
142
|
+
.Args("properties", properties)
|
|
143
|
+
.CommandBuilder());
|
|
144
|
+
#endif
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
public void UserAdd(string properties)
|
|
148
|
+
{
|
|
149
|
+
Debug.Log("TapEventMobile UserAdd" + properties);
|
|
150
|
+
#if UNITY_IOS
|
|
151
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
152
|
+
.Method("userAdd")
|
|
153
|
+
.Args("userAdd", properties)
|
|
154
|
+
.CommandBuilder());
|
|
155
|
+
#else
|
|
156
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
157
|
+
.Method("userAdd")
|
|
158
|
+
.Args("properties", properties)
|
|
159
|
+
.CommandBuilder());
|
|
160
|
+
#endif
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public void AddCommonProperty(string key, string value)
|
|
164
|
+
{
|
|
165
|
+
Debug.Log("TapEventMobile AddCommonProperty" + key + value);
|
|
166
|
+
#if UNITY_IOS
|
|
167
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
168
|
+
.Method("addCommonProperty")
|
|
169
|
+
.Args("addCommonProperty", key)
|
|
170
|
+
.Args("value", value)
|
|
171
|
+
.CommandBuilder());
|
|
172
|
+
#else
|
|
173
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
174
|
+
.Method("addCommonProperty")
|
|
175
|
+
.Args("key", key)
|
|
176
|
+
.Args("value", value)
|
|
177
|
+
.CommandBuilder());
|
|
178
|
+
#endif
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
public void AddCommon(string properties)
|
|
182
|
+
{
|
|
183
|
+
Debug.Log("TapEventMobile AddCommon" + properties);
|
|
184
|
+
#if UNITY_IOS
|
|
185
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
186
|
+
.Method("addCommon")
|
|
187
|
+
.Args("addCommon", properties)
|
|
188
|
+
.CommandBuilder());
|
|
189
|
+
#else
|
|
190
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
191
|
+
.Method("addCommonProperties")
|
|
192
|
+
.Args("properties", properties)
|
|
193
|
+
.CommandBuilder());
|
|
194
|
+
#endif
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
public void ClearCommonProperty(string key)
|
|
198
|
+
{
|
|
199
|
+
Debug.Log("TapEventMobile ClearCommonProperty");
|
|
200
|
+
|
|
201
|
+
#if UNITY_IOS
|
|
202
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
203
|
+
.Method("clearCommonProperty")
|
|
204
|
+
.Args("clearCommonProperty", key)
|
|
205
|
+
.CommandBuilder());
|
|
206
|
+
#else
|
|
207
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
208
|
+
.Method("clearCommonProperty")
|
|
209
|
+
.Args("key", key)
|
|
210
|
+
.CommandBuilder());
|
|
211
|
+
#endif
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
public void ClearCommonProperties(string[] keys)
|
|
215
|
+
{
|
|
216
|
+
Debug.Log("TapEventMobile ClearCommonProperties");
|
|
217
|
+
|
|
218
|
+
#if UNITY_IOS
|
|
219
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
220
|
+
.Method("clearCommonProperties")
|
|
221
|
+
.Args("clearCommonProperties", keys)
|
|
222
|
+
.CommandBuilder());
|
|
223
|
+
#else
|
|
224
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
225
|
+
.Method("clearCommonProperties")
|
|
226
|
+
.Args("keys", keys)
|
|
227
|
+
.CommandBuilder());
|
|
228
|
+
#endif
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
public void ClearAllCommonProperties()
|
|
232
|
+
{
|
|
233
|
+
Debug.Log("TapEventMobile ClearAllCommonProperties");
|
|
234
|
+
|
|
235
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
236
|
+
.Method("clearAllCommonProperties")
|
|
237
|
+
.CommandBuilder());
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
public void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties)
|
|
241
|
+
{
|
|
242
|
+
Debug.Log("TapEventMobile LogChargeEvent" + orderID);
|
|
243
|
+
|
|
244
|
+
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
|
245
|
+
.Method("logPurchasedEvent")
|
|
246
|
+
.Args("orderID", orderID)
|
|
247
|
+
.Args("productName", productName)
|
|
248
|
+
.Args("amount", amount)
|
|
249
|
+
.Args("currencyType", currencyType)
|
|
250
|
+
.Args("paymentMethod", paymentMethod)
|
|
251
|
+
.Args("properties", properties)
|
|
252
|
+
.CommandBuilder());
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
public void RegisterDynamicProperties(Func<string> callback)
|
|
256
|
+
{
|
|
257
|
+
Debug.Log("RegisterDynamicProperties called" + callback);
|
|
258
|
+
#if UNITY_IOS
|
|
259
|
+
IOSNativeWrapper.RegisterDynamicProperties(callback);
|
|
260
|
+
#else
|
|
261
|
+
AndroidNativeWrapper.RegisterDynamicProperties(callback);
|
|
262
|
+
#endif
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|