Skip to content

Commit 8a5e5ec

Browse files
committed
feat:update upm
1 parent bc7f9ef commit 8a5e5ec

34 files changed

+238
-196
lines changed

Mobile/Editor/NativeDependencies.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<repositories>
55
<repository>https://repo.maven.apache.org/maven2</repository>
66
</repositories>
7-
<androidPackage spec="com.taptap.sdk:tap-core-unity:4.7.0"/>
7+
<androidPackage spec="com.taptap.sdk:tap-core-unity:4.8.1-beta.1"/>
88
</androidPackages>
99
<iosPods>
1010
<sources>
1111
<source>https://github.com/CocoaPods/Specs.git</source>
1212
</sources>
13-
<iosPod name="TapTapCoreSDK" version="~> 4.7.1" bitcodeEnabled="false" addToAllTargets="false"/>
13+
<iosPod name="TapTapCoreSDK" version="~> 4.8.1-beta.1" bitcodeEnabled="false" addToAllTargets="false"/>
1414
</iosPods>
1515
</dependencies>

Mobile/Runtime/AndroidNativeWrapper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using TapSDK.Core;
66
using TapSDK.Core.Internal;
77
using System.Collections.Generic;
8+
using TapSDK.Core.Internal.Log;
89

910
namespace TapSDK.Core.Mobile{
1011
internal class AndroidNativeWrapper
@@ -40,7 +41,7 @@ public AndroidJavaObject getDynamicProperties()
4041
}
4142
catch (Exception e)
4243
{
43-
Debug.LogError("Failed to get dynamic properties: " + e.Message);
44+
TapLog.Error("Failed to get dynamic properties: " + e.Message);
4445
}
4546
return null;
4647
}

Mobile/Runtime/BridgeAndroid.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using UnityEngine;
3+
using TapSDK.Core.Internal.Log;
34

45
namespace TapSDK.Core
56
{
@@ -51,7 +52,7 @@ public void Register(string serviceClzName, string serviceImplName)
5152
}
5253
catch (Exception e)
5354
{
54-
Debug.Log("register Failed:" + e);
55+
TapLog.Log("register Failed:" + e);
5556
//
5657
}
5758
}

Mobile/Runtime/BridgeIOS.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Concurrent;
33
using System.Runtime.InteropServices;
44
using UnityEngine;
5+
using TapSDK.Core.Internal.Log;
56

67
namespace TapSDK.Core
78
{
@@ -48,11 +49,9 @@ static void engineBridgeDelegate(string resultJson)
4849
if (result.onceTime && BridgeIOS.GetInstance().GetConcurrentDictionary()
4950
.TryRemove(result.callbackId, out Action<Result> outAction))
5051
{
51-
Debug.Log($"TapSDK resolved current Action:{result.callbackId}");
52+
TapLog.Log($"TapSDK resolved current Action:{result.callbackId}");
5253
}
5354
}
54-
55-
Debug.Log($"TapSDK iOS BridgeAction last Count:{BridgeIOS.GetInstance().GetConcurrentDictionary().Count}");
5655
}
5756

5857

Mobile/Runtime/EngineBridgeInitializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using UnityEngine;
22
using TapSDK.Core.Internal;
3+
using TapSDK.Core.Internal.Log;
34

45
namespace TapSDK.Core.Mobile
56
{
@@ -12,7 +13,7 @@ public static void Initialize()
1213
{
1314
if (!isInitialized)
1415
{
15-
Debug.Log("Initializing EngineBridge");
16+
TapLog.Log("Initializing EngineBridge");
1617

1718
// TODO: android 注册桥接
1819
// #if UNITY_ANDROID

Mobile/Runtime/TapCoreMobile.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Collections.Generic;
88
using UnityEngine;
99
using Newtonsoft.Json;
10+
using TapSDK.Core.Internal.Log;
1011

1112
namespace TapSDK.Core.Mobile
1213
{
@@ -16,14 +17,14 @@ public class TapCoreMobile : ITapCorePlatform
1617

1718
public TapCoreMobile()
1819
{
19-
Debug.Log("TapCoreMobile constructor");
20+
TapLog.Log("TapCoreMobile constructor");
2021
TapLoom.Initialize();
2122
EngineBridgeInitializer.Initialize();
2223
}
2324

2425
public void Init(TapTapSdkOptions coreOption, TapTapSdkBaseOptions[] otherOptions)
2526
{
26-
Debug.Log("TapCoreMobile SDK inited");
27+
TapLog.Log("TapCoreMobile SDK inited");
2728
SetPlatformAndVersion(TapTapSDK.SDKPlatform, TapTapSDK.Version);
2829
string coreOptionsJson = JsonUtility.ToJson(coreOption);
2930
string[] otherOptionsJson = otherOptions.Select(option => JsonConvert.SerializeObject(option)).ToArray();
@@ -36,7 +37,7 @@ public void Init(TapTapSdkOptions coreOption, TapTapSdkBaseOptions[] otherOption
3637

3738
private void SetPlatformAndVersion(string platform, string version)
3839
{
39-
Debug.Log("TapCoreMobile SetPlatformAndVersion called with platform: " + platform + " and version: " + version);
40+
TapLog.Log("TapCoreMobile SetPlatformAndVersion called with platform: " + platform + " and version: " + version);
4041
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
4142
.Method("setPlatformAndVersion")
4243
.Args("platform", TapTapSDK.SDKPlatform)
@@ -47,7 +48,7 @@ private void SetPlatformAndVersion(string platform, string version)
4748

4849
private void SetSDKArtifact(string value)
4950
{
50-
Debug.Log("TapCoreMobile SetSDKArtifact called with value: " + value);
51+
TapLog.Log("TapCoreMobile SetSDKArtifact called with value: " + value);
5152
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
5253
.Method("setSDKArtifact")
5354
.Args("artifact", "Unity")
@@ -61,7 +62,7 @@ public void Init(TapTapSdkOptions coreOption)
6162

6263
public void UpdateLanguage(TapTapLanguageType language)
6364
{
64-
Debug.Log("TapCoreMobile UpdateLanguage language: " + language);
65+
TapLog.Log("TapCoreMobile UpdateLanguage language: " + language);
6566
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
6667
.Method("updateLanguage")
6768
.Args("language", (int)language)

Mobile/Runtime/TapEventMobile.cs

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Runtime.InteropServices;
44
using TapSDK.Core.Internal;
55
using System.Collections.Generic;
6+
using TapSDK.Core.Internal.Log;
67
using UnityEngine;
78

89
namespace TapSDK.Core.Mobile
@@ -13,7 +14,7 @@ public class TapEventMobile : ITapEventPlatform
1314

1415
public TapEventMobile()
1516
{
16-
Debug.Log("TapEventMobile constructor");
17+
TapLog.Log("TapEventMobile constructor");
1718
EngineBridgeInitializer.Initialize();
1819
}
1920

@@ -24,7 +25,7 @@ public void Init(TapTapEventOptions eventOptions)
2425

2526
public void SetUserID(string userID)
2627
{
27-
Debug.Log("TapEventMobile SetUserID = " + userID);
28+
TapLog.Log("TapEventMobile SetUserID = " + userID);
2829
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
2930
.Method("setUserID")
3031
.Args("userID", userID)
@@ -33,7 +34,7 @@ public void SetUserID(string userID)
3334

3435
public void SetUserID(string userID, string properties)
3536
{
36-
Debug.Log("TapEventMobile SetUserID" + userID + properties);
37+
TapLog.Log("TapEventMobile SetUserID" + userID + properties);
3738
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
3839
.Method("setUserID")
3940
.Args("userID", userID)
@@ -43,7 +44,7 @@ public void SetUserID(string userID, string properties)
4344

4445
public void ClearUser()
4546
{
46-
Debug.Log("TapEventMobile ClearUser");
47+
TapLog.Log("TapEventMobile ClearUser");
4748
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
4849
.Method("clearUser")
4950
.CommandBuilder());
@@ -54,13 +55,13 @@ public string GetDeviceId()
5455
string deviceId = Bridge.CallWithReturnValue(EngineBridgeInitializer.GetBridgeServer()
5556
.Method("getDeviceId")
5657
.CommandBuilder());
57-
Debug.Log("TapEventMobile GetDeviceId = " + deviceId);
58+
TapLog.Log("TapEventMobile GetDeviceId = " + deviceId);
5859
return deviceId;
5960
}
6061

6162
public void LogEvent(string name, string properties)
6263
{
63-
Debug.Log("TapEventMobile LogEvent" + name + properties);
64+
TapLog.Log("TapEventMobile LogEvent" + name + properties);
6465
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
6566
.Method("logEvent")
6667
.Args("name", name)
@@ -70,7 +71,7 @@ public void LogEvent(string name, string properties)
7071

7172
public void DeviceInitialize(string properties)
7273
{
73-
Debug.Log("TapEventMobile DeviceInitialize" + properties);
74+
TapLog.Log("TapEventMobile DeviceInitialize" + properties);
7475
#if UNITY_IOS
7576
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
7677
.Method("deviceInitialize")
@@ -86,7 +87,7 @@ public void DeviceInitialize(string properties)
8687

8788
public void DeviceUpdate(string properties)
8889
{
89-
Debug.Log("TapEventMobile DeviceUpdate" + properties);
90+
TapLog.Log("TapEventMobile DeviceUpdate" + properties);
9091
#if UNITY_IOS
9192
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
9293
.Method("deviceUpdate")
@@ -102,7 +103,7 @@ public void DeviceUpdate(string properties)
102103

103104
public void DeviceAdd(string properties)
104105
{
105-
Debug.Log("TapEventMobile DeviceAdd" + properties);
106+
TapLog.Log("TapEventMobile DeviceAdd" + properties);
106107
#if UNITY_IOS
107108
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
108109
.Method("deviceAdd")
@@ -118,7 +119,7 @@ public void DeviceAdd(string properties)
118119

119120
public void UserInitialize(string properties)
120121
{
121-
Debug.Log("TapEventMobile UserInitialize" + properties);
122+
TapLog.Log("TapEventMobile UserInitialize" + properties);
122123
#if UNITY_IOS
123124
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
124125
.Method("userInitialize")
@@ -134,7 +135,7 @@ public void UserInitialize(string properties)
134135

135136
public void UserUpdate(string properties)
136137
{
137-
Debug.Log("TapEventMobile UserUpdate" + properties);
138+
TapLog.Log("TapEventMobile UserUpdate" + properties);
138139
#if UNITY_IOS
139140
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
140141
.Method("userUpdate")
@@ -150,7 +151,7 @@ public void UserUpdate(string properties)
150151

151152
public void UserAdd(string properties)
152153
{
153-
Debug.Log("TapEventMobile UserAdd" + properties);
154+
TapLog.Log("TapEventMobile UserAdd" + properties);
154155
#if UNITY_IOS
155156
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
156157
.Method("userAdd")
@@ -166,7 +167,7 @@ public void UserAdd(string properties)
166167

167168
public void AddCommonProperty(string key, string value)
168169
{
169-
Debug.Log("TapEventMobile AddCommonProperty" + key + value);
170+
TapLog.Log("TapEventMobile AddCommonProperty" + key + value);
170171
#if UNITY_IOS
171172
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
172173
.Method("addCommonProperty")
@@ -184,7 +185,7 @@ public void AddCommonProperty(string key, string value)
184185

185186
public void AddCommon(string properties)
186187
{
187-
Debug.Log("TapEventMobile AddCommon" + properties);
188+
TapLog.Log("TapEventMobile AddCommon" + properties);
188189
#if UNITY_IOS
189190
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
190191
.Method("addCommon")
@@ -200,7 +201,7 @@ public void AddCommon(string properties)
200201

201202
public void ClearCommonProperty(string key)
202203
{
203-
Debug.Log("TapEventMobile ClearCommonProperty");
204+
TapLog.Log("TapEventMobile ClearCommonProperty");
204205

205206
#if UNITY_IOS
206207
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
@@ -217,7 +218,7 @@ public void ClearCommonProperty(string key)
217218

218219
public void ClearCommonProperties(string[] keys)
219220
{
220-
Debug.Log("TapEventMobile ClearCommonProperties");
221+
TapLog.Log("TapEventMobile ClearCommonProperties");
221222

222223
#if UNITY_IOS
223224
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
@@ -234,7 +235,7 @@ public void ClearCommonProperties(string[] keys)
234235

235236
public void ClearAllCommonProperties()
236237
{
237-
Debug.Log("TapEventMobile ClearAllCommonProperties");
238+
TapLog.Log("TapEventMobile ClearAllCommonProperties");
238239

239240
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
240241
.Method("clearAllCommonProperties")
@@ -243,7 +244,7 @@ public void ClearAllCommonProperties()
243244

244245
public void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties)
245246
{
246-
Debug.Log("TapEventMobile LogChargeEvent" + orderID);
247+
TapLog.Log("TapEventMobile LogChargeEvent" + orderID);
247248

248249
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
249250
.Method("logPurchasedEvent")
@@ -258,7 +259,7 @@ public void LogChargeEvent(string orderID, string productName, long amount, stri
258259

259260
public void RegisterDynamicProperties(Func<string> callback)
260261
{
261-
Debug.Log("RegisterDynamicProperties called" + callback);
262+
TapLog.Log("RegisterDynamicProperties called" + callback);
262263
#if UNITY_IOS
263264
IOSNativeWrapper.RegisterDynamicProperties(callback);
264265
#else
@@ -268,7 +269,7 @@ public void RegisterDynamicProperties(Func<string> callback)
268269

269270
public void SetOAID(string value)
270271
{
271-
Debug.Log("TapEventMobile SetOAID" + value);
272+
TapLog.Log("TapEventMobile SetOAID" + value);
272273
#if UNITY_ANDROID
273274
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
274275
.Method("setOAID")
@@ -279,7 +280,7 @@ public void SetOAID(string value)
279280

280281
public void LogDeviceLoginEvent()
281282
{
282-
Debug.Log("TapEventMobile LogDeviceLoginEvent");
283+
TapLog.Log("TapEventMobile LogDeviceLoginEvent");
283284
#if UNITY_ANDROID
284285
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
285286
.Method("logDeviceLoginEvent")

Runtime/Internal/Http/TapHttpClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Text;
99
using Newtonsoft.Json;
1010
using TapSDK.Core.Internal.Json;
11+
using TapSDK.Core.Internal.Log;
1112

1213
namespace TapSDK.Core.Internal.Http {
1314
public class TapHttpClient {
@@ -130,7 +131,7 @@ TapException HandleErrorResponse(HttpStatusCode statusCode, string responseConte
130131
code = (int)error["code"];
131132
message = error["error"].ToString();
132133
} catch (Exception e) {
133-
TapLogger.Error(e);
134+
TapLog.Error(e.Message ?? "");
134135
}
135136
return new TapException(code, message);
136137
}

Runtime/Internal/Http/TapHttpUtils.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.Specialized;
44
using System.Net.Http;
55
using UnityEngine;
6+
using TapSDK.Core.Internal.Log;
67

78
namespace TapSDK.Core.Internal.Http {
89
public class TapHttpUtils {
@@ -36,7 +37,7 @@ public static void PrintRequest(HttpClient client, HttpRequestMessage request, s
3637
sb.AppendLine($"Content: {content}");
3738
}
3839
sb.AppendLine("=== HTTP Request End ===");
39-
Debug.Log(sb.ToString());
40+
TapLog.Log(sb.ToString());
4041
}
4142

4243
public static void PrintResponse(HttpResponseMessage response, string content = null) {
@@ -51,7 +52,7 @@ public static void PrintResponse(HttpResponseMessage response, string content =
5152
sb.AppendLine($"Content: {content}");
5253
}
5354
sb.AppendLine("=== HTTP Response End ===");
54-
Debug.Log(sb.ToString());
55+
TapLog.Log(sb.ToString());
5556
}
5657

5758
public static NameValueCollection ParseQueryString(string queryString)

0 commit comments

Comments
 (0)