com.taptap.sdk.core 4.5.6 → 4.5.8

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.
@@ -4,7 +4,7 @@
4
4
  <repositories>
5
5
  <repository>https://repo.maven.apache.org/maven2</repository>
6
6
  </repositories>
7
- <androidPackage spec="com.taptap.sdk:tap-core-unity:4.5.5"/>
7
+ <androidPackage spec="com.taptap.sdk:tap-core-unity:4.5.8"/>
8
8
  </androidPackages>
9
9
  <iosPods>
10
10
  <sources>
@@ -258,6 +258,27 @@ namespace TapSDK.Core.Mobile
258
258
  IOSNativeWrapper.RegisterDynamicProperties(callback);
259
259
  #else
260
260
  AndroidNativeWrapper.RegisterDynamicProperties(callback);
261
+ #endif
262
+ }
263
+
264
+ public void SetOAID(string value)
265
+ {
266
+ Debug.Log("TapEventMobile SetOAID" + value);
267
+ #if UNITY_ANDROID
268
+ Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
269
+ .Method("setOAID")
270
+ .Args("oaid", value)
271
+ .CommandBuilder());
272
+ #endif
273
+ }
274
+
275
+ public void LogDeviceLoginEvent()
276
+ {
277
+ Debug.Log("TapEventMobile LogDeviceLoginEvent");
278
+ #if UNITY_ANDROID
279
+ Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
280
+ .Method("logDeviceLoginEvent")
281
+ .CommandBuilder());
261
282
  #endif
262
283
  }
263
284
  }
@@ -33,5 +33,9 @@ namespace TapSDK.Core.Internal {
33
33
  void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties);
34
34
 
35
35
  void RegisterDynamicProperties(Func<string> callback);
36
+
37
+ void SetOAID(string value);
38
+
39
+ void LogDeviceLoginEvent();
36
40
  }
37
41
  }
@@ -89,5 +89,12 @@ namespace TapSDK.Core {
89
89
  platformWrapper?.RegisterDynamicProperties(callback);
90
90
  }
91
91
 
92
+ public static void SetOAID(string value){
93
+ platformWrapper?.SetOAID(value);
94
+ }
95
+
96
+ public static void LogDeviceLoginEvent(){
97
+ platformWrapper?.LogDeviceLoginEvent();
98
+ }
92
99
  }
93
100
  }
@@ -12,7 +12,7 @@ using System.ComponentModel;
12
12
 
13
13
  namespace TapSDK.Core {
14
14
  public class TapTapSDK {
15
- public static readonly string Version = "4.5.6";
15
+ public static readonly string Version = "4.5.8";
16
16
 
17
17
  public static string SDKPlatform = "TapSDK-Unity";
18
18
 
@@ -93,6 +93,20 @@ namespace TapSDK.Core
93
93
  /// </summary>
94
94
  public bool enableLog = false;
95
95
 
96
+ /// <summary>
97
+ /// 是否禁用 OAID 反射
98
+ /// </summary>
99
+ public bool disableReflectionOAID = true;
100
+
101
+ /// <summary>
102
+ /// 是否即用禁用自动上报设备登录事件
103
+ /// </summary>
104
+ public bool disableAutoLogDeviceLogin = false;
105
+
106
+ /// <summary>
107
+ /// 屏幕方向:0-竖屏 1-横屏
108
+ /// </summary>
109
+ public int screenOrientation = 0;
96
110
 
97
111
  [JsonProperty("moduleName")]
98
112
  private string _moduleName = "TapTapSDKCore";
@@ -21,6 +21,11 @@ namespace TapSDK.Core.Standalone.Internal
21
21
  kTapSDKInitResult_NoPlatform = 2,
22
22
  // 已安装 TapTap,游戏未通过 TapTap 启动
23
23
  kTapSDKInitResult_NotLaunchedByPlatform = 3,
24
+
25
+ // SDK 本地执行时未知错误
26
+ kTapSDKInitResult_Unknown = -1,
27
+ // SDK 本地执行时超时
28
+ kTapSDKInitResult_Timeout = -2,
24
29
  };
25
30
 
26
31
  internal enum TapCallbackID
@@ -34,9 +34,13 @@ namespace TapSDK.Core.Standalone.Internal {
34
34
  if (errorType == TapSDKInitResult.kTapSDKInitResult_NoPlatform){
35
35
  tipText.text = "获取游戏信息失败,请下载 TapTap 客户端后重新启动游戏";
36
36
  }else if (errorType == TapSDKInitResult.kTapSDKInitResult_NotLaunchedByPlatform){
37
- tipText.text = "获取游戏信息失败,请从 TapTap 客户端重新启动游戏";
37
+ tipText.text = "获取游戏信息失败,请从 TapTap 客户端重新启动游戏";
38
+ }else if (errorType == TapSDKInitResult.kTapSDKInitResult_Unknown){
39
+ tipText.text = "本地发生未知错误,请从 TapTap 客户端重新启动游戏";
40
+ }else if (errorType == TapSDKInitResult.kTapSDKInitResult_Timeout){
41
+ tipText.text = "获取游戏信息超时,请从 TapTap 客户端重新启动游戏";
38
42
  }else {
39
- tipText.text = "发生未知错误,请从 TapTap 客户端重新启动游戏";
43
+ tipText.text = "发生未知错误,请从 TapTap 客户端重新启动游戏";
40
44
  }
41
45
  }
42
46
 
@@ -398,17 +398,31 @@ namespace TapSDK.Core.Standalone
398
398
  }
399
399
  }
400
400
  }
401
+ catch(TimeoutException e)
402
+ {
403
+ lastIsLaunchedFromTapTapPCResult = 0;
404
+ TapCoreTracker.Instance.TrackFailure(TapCoreTracker.METHOD_LAUNCHER, sessionId, (int)TapSDKInitResult.kTapSDKInitResult_Timeout, e.Message ?? "");
405
+
406
+ TapLogger.Debug("IsLaunchedFromTapTapPC check timeout");
407
+ string tipPannelPath = "Prefabs/TapClient/TapClientConnectTipPanel";
408
+ if (Resources.Load<GameObject>(tipPannelPath) != null)
409
+ {
410
+ var pannel = UIManager.Instance.OpenUI<TapClientConnectTipController>(tipPannelPath);
411
+ pannel.Show(TapSDKInitResult.kTapSDKInitResult_Timeout);
412
+ }
413
+ return false;
414
+ }
401
415
  catch (Exception e)
402
416
  {
403
417
  lastIsLaunchedFromTapTapPCResult = 0;
404
- TapCoreTracker.Instance.TrackFailure(TapCoreTracker.METHOD_LAUNCHER, sessionId, -1, e.Message ?? "");
418
+ TapCoreTracker.Instance.TrackFailure(TapCoreTracker.METHOD_LAUNCHER, sessionId, (int)TapSDKInitResult.kTapSDKInitResult_Unknown, e.Message ?? "");
405
419
 
406
420
  TapLogger.Debug("IsLaunchedFromTapTapPC check exception = " + e.StackTrace);
407
421
  string tipPannelPath = "Prefabs/TapClient/TapClientConnectTipPanel";
408
422
  if (Resources.Load<GameObject>(tipPannelPath) != null)
409
423
  {
410
424
  var pannel = UIManager.Instance.OpenUI<TapClientConnectTipController>(tipPannelPath);
411
- pannel.Show(TapSDKInitResult.kTapSDKInitResult_FailedGeneric);
425
+ pannel.Show(TapSDKInitResult.kTapSDKInitResult_Unknown);
412
426
  }
413
427
  return false;
414
428
  }
@@ -446,10 +460,10 @@ namespace TapSDK.Core.Standalone
446
460
  task.TrySetResult(tapInitResult);
447
461
 
448
462
  }
449
- catch (TimeoutException)
463
+ catch (TimeoutException ex)
450
464
  {
451
465
  TapLogger.Debug("RunClientBridgeMethodWithTimeout invoke CheckInitState 方法执行超时!");
452
- task.TrySetException(new Exception("init TapClient Bridge Timeout"));
466
+ task.TrySetException(ex);
453
467
  }
454
468
  catch (Exception ex)
455
469
  {
@@ -292,6 +292,33 @@ namespace TapSDK.Core.Standalone
292
292
  Tracker.RegisterDynamicPropsDelegate(dynamicProperties);
293
293
  }
294
294
 
295
+ /// <summary>
296
+ /// set custom oaid value
297
+ /// </summary>
298
+ /// <param name="value">oaid</param>
299
+ public void SetOAID(string value)
300
+ {
301
+ if (!TapCoreStandalone.CheckInitState())
302
+ {
303
+ return;
304
+ }
305
+
306
+ }
307
+
308
+ /// <summary>
309
+ /// Logs a device login event.
310
+ /// </summary>
311
+ public void LogDeviceLoginEvent()
312
+ {
313
+ // PC端空实现
314
+ if (!TapCoreStandalone.CheckInitState())
315
+ {
316
+ return;
317
+ }
318
+
319
+ Debug.Log("LogDeviceLoginEvent called in PC platform (empty implementation)");
320
+ }
321
+
295
322
  /// <summary>
296
323
  /// Represents the implementation of dynamic properties for the Tap event platform.
297
324
  /// </summary>
package/link.xml.meta CHANGED
@@ -1,5 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: 5777dc227a00a4ed9a0fb312ee3630e7
2
+ guid: 7d7e2e649fb2f4ac5b70cd53274802c4
3
3
  TextScriptImporter:
4
4
  externalObjects: {}
5
5
  userData:
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "com.taptap.sdk.core",
3
3
  "displayName": "TapTapSDK Core",
4
4
  "description": "TapTapSDK Core",
5
- "version": "4.5.6",
5
+ "version": "4.5.8",
6
6
  "unity": "2019.4",
7
7
  "license": "MIT",
8
8
  "dependencies": {