com.amanotes.gdk 0.2.79 → 0.2.80-f2

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/Editor/Extra/SDKVersionTracking.cs +29 -1
  3. package/Extra/AmaGDKInstaller.unitypackage +0 -0
  4. package/Extra/AutoEventQC.unitypackage +0 -0
  5. package/Extra/CheckDiskSpace.unitypackage +0 -0
  6. package/Extra/Consent.unitypackage +0 -0
  7. package/Extra/CrashlyticHook.unitypackage +0 -0
  8. package/Extra/{SDKVersionTracking.unitypackage.meta → CrashlyticHook.unitypackage.meta} +1 -1
  9. package/Extra/ForceUpdate.unitypackage +0 -0
  10. package/Extra/LegacyGDKUpdateHelper.unitypackage +0 -0
  11. package/Extra/PostProcessor.unitypackage +0 -0
  12. package/Packages/AmaGDKConfig.unitypackage +0 -0
  13. package/Packages/AmaGDKExample.unitypackage +0 -0
  14. package/Packages/AmaGDKTest.unitypackage +0 -0
  15. package/Packages/AppsFlyerAdapter.PurchaseConnector.unitypackage +0 -0
  16. package/Packages/AppsFlyerAdapter.unitypackage +0 -0
  17. package/Packages/FirebaseAnalyticsAdapter.unitypackage +0 -0
  18. package/Packages/FirebaseRemoteConfigAdapter.unitypackage +0 -0
  19. package/Packages/IronSourceAdapter.AdQuality.unitypackage +0 -0
  20. package/Packages/IronSourceAdapter.unitypackage +0 -0
  21. package/Packages/MaxAdNetworkAdapter.unitypackage +0 -0
  22. package/Packages/RevenueCatAdapter.unitypackage +0 -0
  23. package/Packages/SqliteAnalyticsAdapter.unitypackage +0 -0
  24. package/Runtime/Ad/AmaGDK.Ads.cs +1 -0
  25. package/Runtime/AmaGDK.cs +1 -1
  26. package/Runtime/Core/GDKDebug.cs +33 -19
  27. package/Runtime/GDKAudio/Plugins.meta +8 -0
  28. package/Runtime/GDKAudio.meta +8 -0
  29. package/package.json +4 -4
  30. package/Extra/SDKVersionTracking.unitypackage +0 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,14 @@
1
- # Changelog
1
+ ## [0.2.80-f2] - 2025-02-04
2
+ - [Fix] Send GDKVersionTracking only for Android/iOS
3
+
4
+ ## [0.2.80-f1] - 2024-12-17
5
+ - [Dev] Add Release Script
6
+ - [Fix] GetStackTrace only works on main thread
7
+ - [Fix] Missing userData parameters in AdEventTracking
8
+
9
+ ## [0.2.80] - 2024-11-13
10
+ - [Dev] Don't use obsolete functions
11
+ - [Dev] Add CrashlyticHook
2
12
 
3
13
  ## [0.2.79] - 2024-11-13
4
14
  - [Dev] Add callbacks for IAP module
@@ -10,7 +20,6 @@
10
20
  - [Dev] Track Adapters and Third-party packages used in games
11
21
 
12
22
  ## [0.2.77] - 2024-11-07
13
- - [Release] 0.2.76
14
23
  - [Dev] Remove GDKAudio
15
24
  - [Dev] Handle format exception in RemoteConfig
16
25
  - [Dev] Handle exception of FetchConfig
@@ -2,6 +2,7 @@ using System;
2
2
  using System.Collections.Generic;
3
3
  using System.IO;
4
4
  using System.Linq;
5
+ using System.Net;
5
6
  using System.Net.Http;
6
7
  using System.Text;
7
8
  using System.Xml;
@@ -269,6 +270,28 @@ namespace Amanotes.Editor
269
270
  [PostProcessBuild(999)]
270
271
  public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
271
272
  {
273
+ if (target != BuildTarget.Android && target != BuildTarget.iOS) return;
274
+
275
+ if (string.IsNullOrWhiteSpace(Application.productName) || Application.productName.ToLower() == "my project")
276
+ {
277
+ Debug.LogWarning("AmaGDK | [SDKVersionTracking] Please correct Application.productName");
278
+ return;
279
+ }
280
+
281
+ if (string.IsNullOrWhiteSpace(PlayerSettings.applicationIdentifier)
282
+ || PlayerSettings.applicationIdentifier.ToLower().StartsWith("com.defaultcompany")
283
+ || PlayerSettings.applicationIdentifier.ToLower().StartsWith("com.unity-technologies"))
284
+ {
285
+ Debug.LogWarning("AmaGDK | [SDKVersionTracking] Please correct PlayerSettings.applicationIdentifier");
286
+ return;
287
+ }
288
+
289
+ if (string.IsNullOrWhiteSpace(PlayerSettings.bundleVersion) || PlayerSettings.bundleVersion == "0")
290
+ {
291
+ Debug.LogWarning("AmaGDK | [SDKVersionTracking] Please correct PlayerSettings.bundleVersion");
292
+ return;
293
+ }
294
+
272
295
  var rawData = _dicThirdPartyVersion
273
296
  .Concat(_dicImportedGDKAdapter)
274
297
  .Concat(_dicExtraVersion)
@@ -317,7 +340,12 @@ namespace Amanotes.Editor
317
340
  else
318
341
  {
319
342
  string errorData = await response.Content.ReadAsStringAsync();
320
- Debug.LogError($"AmaGDK | [SDKVersionTracking] Status code {response.StatusCode} Error Response: {errorData}");
343
+ string errorMessage = $"AmaGDK | [SDKVersionTracking] Status code {response.StatusCode} Error Response: {errorData}";
344
+ if ((int)response.StatusCode == 409)
345
+ {
346
+ throw new Exception(errorMessage);
347
+ }
348
+ Debug.LogError(errorMessage);
321
349
  }
322
350
  }
323
351
  catch (HttpRequestException e)
Binary file
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: cbf5a5557d9ac40ab83b6587b81640cb
2
+ guid: f1f8828296a16440f8aab012f540cebd
3
3
  DefaultImporter:
4
4
  externalObjects: {}
5
5
  userData:
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -345,6 +345,7 @@ namespace Amanotes.Core.Internal
345
345
  {
346
346
  protected AdShowContext context => Ads.context;
347
347
  protected AdModuleConfig moduleConfig => Config.ad;
348
+ public Dictionary<string, object> userData => context?.userData;
348
349
 
349
350
  // APIs
350
351
  internal protected abstract AdLogic interstitial { get; }
package/Runtime/AmaGDK.cs CHANGED
@@ -27,7 +27,7 @@ namespace Amanotes.Core
27
27
  {
28
28
  public partial class AmaGDK : MonoBehaviour
29
29
  {
30
- public const string VERSION = "0.2.79";
30
+ public const string VERSION = "v0.2.80-f2";
31
31
 
32
32
  internal static Status _status = Status.None;
33
33
  private static ConfigAsset _config = null;
@@ -12,10 +12,10 @@ namespace Amanotes.Core
12
12
  Verbose
13
13
  }
14
14
 
15
- internal struct NoStackTrace : IDisposable
15
+ internal readonly struct NoStackTrace : IDisposable
16
16
  {
17
- internal LogType logType;
18
- internal StackTraceLogType stackTraceType;
17
+ internal readonly LogType logType;
18
+ internal readonly StackTraceLogType stackTraceType;
19
19
 
20
20
  internal NoStackTrace(LogType logType)
21
21
  {
@@ -34,19 +34,32 @@ namespace Amanotes.Core
34
34
  public static NoStackTrace Log => new NoStackTrace(LogType.Log);
35
35
  }
36
36
 
37
+ internal readonly struct NoStackTraceNull: IDisposable
38
+ {
39
+ public void Dispose()
40
+ {
41
+
42
+ }
43
+ }
44
+
37
45
  public class GDKDebug
38
46
  {
47
+ internal static readonly IDisposable NoStackTraceNull = new NoStackTraceNull();
48
+
39
49
  public static Action<string> logNonfatalErrorHook = null;
40
50
  private static readonly HashSet<string> nonFatalDict = new HashSet<string>();
41
- public static readonly HashSet<string> logWarningDict = new HashSet<string>();
51
+ private static readonly HashSet<string> logWarningDict = new HashSet<string>();
42
52
 
43
53
  public static void LogWarningOnce(string message, string key = null)
44
54
  {
45
55
  if (AmaGDK.logLevel < LogLevel.Warning) return;
46
56
  if (string.IsNullOrEmpty(key)) key = message;
47
- if (!logWarningDict.Add(key)) return;
57
+ lock (logWarningDict)
58
+ {
59
+ if (!logWarningDict.Add(key)) return;
60
+ }
48
61
 
49
- using (NoStackTrace.Warning)
62
+ using (GDKUtils.isOnMainThread ? NoStackTrace.Warning: NoStackTraceNull)
50
63
  {
51
64
  Debug.LogWarning($"AmaGDK {message}");
52
65
  }
@@ -54,39 +67,40 @@ namespace Amanotes.Core
54
67
  public static void LogWarning(string message)
55
68
  {
56
69
  if (AmaGDK.logLevel < LogLevel.Warning) return;
57
- using (NoStackTrace.Warning)
70
+ using (GDKUtils.isOnMainThread ? NoStackTrace.Warning: NoStackTraceNull)
58
71
  {
59
- Debug.LogWarning($"AmaGDK {message}");
72
+ Debug.LogWarning($"AmaGDK {message}");
60
73
  }
61
74
  }
62
75
  public static void LogError(string message)
63
76
  {
64
77
  if (AmaGDK.logLevel < LogLevel.Error) return;
65
- using (NoStackTrace.Error)
78
+ using (GDKUtils.isOnMainThread ? NoStackTrace.Error: NoStackTraceNull)
66
79
  {
67
- Debug.LogError($"AmaGDK {message}");
80
+ Debug.LogError($"AmaGDK {message}");
68
81
  }
69
82
 
70
83
  if (logNonfatalErrorHook == null) return;
71
84
 
72
85
  if (GDKUtils.isOnMainThread) // Most of the time
73
86
  {
74
- if (!nonFatalDict.Add(message)) return;
75
- logNonfatalErrorHook(message);
87
+ LogNonFatalOnMainThread(message);
76
88
  return;
77
89
  }
78
90
 
79
- GDKUtils.DoOnMainThread(() =>
80
- {
81
- if (!nonFatalDict.Add(message)) return; // LogOnce
82
- logNonfatalErrorHook(message);
83
- });
91
+ GDKUtils.DoOnMainThread(() => { LogNonFatalOnMainThread(message); });
92
+ }
93
+
94
+ private static void LogNonFatalOnMainThread(string message)
95
+ {
96
+ if (!nonFatalDict.Add(message)) return;
97
+ logNonfatalErrorHook(message);
84
98
  }
85
99
 
86
100
  public static void Log(string message)
87
101
  {
88
102
  if (AmaGDK.logLevel < LogLevel.Verbose) return;
89
- using (NoStackTrace.Log)
103
+ using (GDKUtils.isOnMainThread ? NoStackTrace.Log: NoStackTraceNull)
90
104
  {
91
105
  Debug.Log($"AmaGDK {message}");
92
106
  }
@@ -94,7 +108,7 @@ namespace Amanotes.Core
94
108
 
95
109
  public static void ForceLog(string message)
96
110
  {
97
- using (NoStackTrace.Log)
111
+ using (GDKUtils.isOnMainThread ? NoStackTrace.Log: NoStackTraceNull)
98
112
  {
99
113
  Debug.Log($"AmaGDK {message}");
100
114
  }
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 556517e393f149748cf9890d5d436491
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 19f1c4b4ece54d438bb89c63b87846bf
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.79",
3
+ "version": "0.2.80-f2",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",
@@ -8,7 +8,7 @@
8
8
  "Amanotes",
9
9
  "Amanotes GDK",
10
10
  "vh-name:AmaGDK"
11
- ],
11
+ ],
12
12
  "author": {
13
13
  "name": "Amanotes",
14
14
  "email": "tech.support@amanotes.com",
@@ -16,5 +16,5 @@
16
16
  },
17
17
  "changelogUrl": "https://amagdk.notion.site/Change-Log-6dfd4b67d64f496bbd9eb04ccb4ef95a",
18
18
  "documentationUrl": "https://amagdk.notion.site/amagdk/Ama-GDK-a73596617ab247b6a43c8f12a1581415",
19
- "license": "MIT"
20
- }
19
+ "license": "MIT"
20
+ }