com.amanotes.gdk 0.2.59 → 0.2.61

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.61 - 2024-04-25]
4
+ - Add immediate event logging logic
5
+ - [Feature] Improve handling of locked parameters in Klavar
6
+
7
+ ## [0.2.60 - 2024-04-23]
8
+ - [Feature] Ensured container's context values remain unchanged
9
+ - [Feature] Check sent funnel event
10
+ - [Feature] IRS test suite option
11
+ - [Dev] Format Notion ChangeLog
12
+ - [Dev] Remove too short method AppendExtraSDKVersion
13
+ - [Dev] Auto get tag and push change log to Notion
14
+ - [Dev] Warning missing adapter when using .OnlyTo()
15
+
3
16
  ## [0.2.59 - 2024-04-12]
4
17
  - [Dev] Improve code coverage
5
18
 
@@ -12,7 +25,6 @@
12
25
  - [Fix] Various warnings fixes due to invalid examples
13
26
  - [Fix] Warning on AdContext destroyed caused by invalid editor ad callback
14
27
 
15
-
16
28
  ## [0.2.57 - 2024-04-08]
17
29
  - [Dev] Fix bug in value conversion within KlavarEvent
18
30
  - [Dev] Auto get change log
@@ -22,7 +34,6 @@
22
34
  - [Dev] Clean up and add tooltip for options
23
35
  - [Fix] Null exception in LocalBuild Version
24
36
 
25
-
26
37
  ## [0.2.56 - 2024-04-03]
27
38
  - Release AmaGDK v0.2.56
28
39
 
@@ -1,4 +1,5 @@
1
1
  using System.Collections.Generic;
2
+ using Amanotes.Core;
2
3
 
3
4
  namespace Amanotes.Editor
4
5
  {
@@ -13,12 +14,9 @@ namespace Amanotes.Editor
13
14
  VersionHelper.UpdateListVersions(module);
14
15
  dicThirdParty.Add(module.id, ExtractVersion.ThirdParty(module.id));
15
16
  }
16
-
17
- foreach (IronSourceSDKAdapter adapter in ExtractVersion.IronSourceAdapter())
18
- {
19
- dicThirdParty.Add(adapter.name, adapter.version);
20
- }
21
17
 
18
+ dicThirdParty["Firebase"] = AmaGDKExtra.FirebaseVersion();
19
+ dicThirdParty["AmaGDK"] = AmaGDK.VERSION;
22
20
  dicThirdParty["AdQuality"] = ExtractVersion.IronSourceAdQuality();
23
21
  dicThirdParty["AdRevenue"] = ExtractVersion.AppsFlyerAdRevenue();
24
22
  dicThirdParty["ACM"] = ExtractVersion.Acm();
@@ -27,6 +25,16 @@ namespace Amanotes.Editor
27
25
  return dicThirdParty;
28
26
  }
29
27
 
28
+ public static Dictionary<string, object> GetIronSourceAdapterVersions()
29
+ {
30
+ Dictionary<string, object> dicAdapters = new Dictionary<string, object>();
31
+ foreach (IronSourceSDKAdapter adapter in ExtractVersion.IronSourceAdapter())
32
+ {
33
+ dicAdapters.Add(adapter.name, adapter.version);
34
+ }
35
+ return dicAdapters;
36
+ }
37
+
30
38
  public static string FirebaseVersion()
31
39
  {
32
40
  string version = ExtractVersion.FirebaseAnalytics();
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -92,6 +92,7 @@ namespace Amanotes.Core
92
92
 
93
93
  public static IEventParamsBuilder LogEvent(string eventName)
94
94
  {
95
+ ThrowExceptionIfImmediateEvent(eventName);
95
96
  var result = PrepareEvent(eventName);
96
97
  eventQueue.Enqueue(result);
97
98
  return result;
@@ -99,6 +100,7 @@ namespace Amanotes.Core
99
100
 
100
101
  public static IEventParamsBuilder LogEvent(string eventName, Dictionary<string, object> parameters)
101
102
  {
103
+ ThrowExceptionIfImmediateEvent(eventName);
102
104
  var result = PrepareEvent(eventName, parameters);
103
105
  eventQueue.Enqueue(result);
104
106
  return result;
@@ -106,6 +108,7 @@ namespace Amanotes.Core
106
108
 
107
109
  public static IEventParamsBuilder LogEvent(string eventName, params (string, object)[] parameters)
108
110
  {
111
+ ThrowExceptionIfImmediateEvent(eventName);
109
112
  var result = PrepareEvent(eventName, parameters);
110
113
  eventQueue.Enqueue(result);
111
114
  return result;
@@ -171,6 +174,12 @@ namespace Amanotes.Core
171
174
  s.SetUserProperty(key, value);
172
175
  }
173
176
  }
177
+
178
+ private static void ThrowExceptionIfImmediateEvent(string eventName)
179
+ {
180
+ if (Config.analytics.immediatelyLoggedEvents.Contains(eventName))
181
+ throw new GDKException($"This event '{eventName}' must be sent immediately by AmaGDK.Analytics.LogEventImmediately(eventName, params)");
182
+ }
174
183
 
175
184
  private static IntegrityFlag MergeData(List<string> funnelEvents, Dictionary<string, int> eventCountMap, bool sumEventCount)
176
185
  {
@@ -261,6 +270,17 @@ namespace Amanotes.Core
261
270
  adapter.NeverSend = eventNames;
262
271
  }
263
272
  }
273
+
274
+ public static bool HasSent(string eventName)
275
+ {
276
+ if (string.IsNullOrWhiteSpace(eventName)) return false;
277
+ return localData.eventDetails.Exists(e => e.eventName == eventName);
278
+ }
279
+
280
+ public static bool HasSentSignature(string signature)
281
+ {
282
+ return localData.funnelSignatures.Contains(signature);
283
+ }
264
284
  }
265
285
 
266
286
  //INTERNAL
@@ -618,6 +638,13 @@ namespace Amanotes.Core
618
638
  {
619
639
  return localData.AddFunnelSignature(eventData.funnelSignature);
620
640
  }
641
+
642
+ //No valid adapter
643
+ if (eventData.overrideConfig && eventData.allowAdapterIds?.Count == 0)
644
+ {
645
+ LogWarning($"Event <{eventData.eventName}> is skipped because no adapter is valid.");
646
+ return false;
647
+ }
621
648
 
622
649
  //Check predefined event count config
623
650
  if (eventData.IsSkippedBySendAtCountConfig())
@@ -848,11 +875,15 @@ namespace Amanotes.Core
848
875
  {
849
876
  //Clear() is supported from .Net Standard 2.1
850
877
  #if UNITY_2021_3_OR_NEWER
851
- sessionStat?.savedEventStatsInLastFrame.Clear();
878
+ savedEventStatsInLastFrame.Clear();
879
+ lastFrameEventStats.Clear();
852
880
  #else
853
881
  while (savedEventStatsInLastFrame.TryDequeue(out var stat))
854
882
  {
855
883
  }
884
+ while (lastFrameEventStats.TryDequeue(out var stat))
885
+ {
886
+ }
856
887
  #endif
857
888
  }
858
889
  }
@@ -936,8 +967,14 @@ namespace Amanotes.Core
936
967
 
937
968
  foreach (string mId in analyticIds)
938
969
  {
970
+ if (!listAdapters.Exists(a => a.adapterId == mId))
971
+ {
972
+ LogError($"Cannot send event <{eventData.eventName}> to <{mId}>. Analytics adapter for <{mId}> is not available.");
973
+ continue;
974
+ }
939
975
  eventData.allowAdapterIds.Add(mId);
940
976
  }
977
+
941
978
  return ap;
942
979
  }
943
980
 
@@ -1053,6 +1090,7 @@ namespace Amanotes.Core.Internal
1053
1090
  [HideInInspector] public bool checkMigrationIntegrity = true;
1054
1091
  [HideInInspector] public bool migrateAccumulatedCount = true;
1055
1092
  [HideInInspector] public bool enableEventStat;
1093
+ [HideInInspector] public List<string> immediatelyLoggedEvents = new List<string>(){"ad_impression", "ad_impression_ama"};
1056
1094
  public AnalyticQualityConfig quality;
1057
1095
  }
1058
1096
 
package/Runtime/AmaGDK.cs CHANGED
@@ -17,7 +17,7 @@ namespace Amanotes.Core
17
17
  {
18
18
  public partial class AmaGDK : MonoBehaviour
19
19
  {
20
- public const string VERSION = "0.2.59";
20
+ public const string VERSION = "0.2.61";
21
21
 
22
22
  internal static AmaGDK _instance;
23
23
  internal static Status _status = Status.None;
@@ -175,6 +175,12 @@ namespace Amanotes.Core.Internal
175
175
  analyticsData.cachedEventDetails.Clear();
176
176
  analyticsData.migrationLog = new MigrationLog();
177
177
  analyticsData.SaveIfDirty();
178
+ sessionStat.Clear();
179
+ #if UNITY_2021_3_OR_NEWER
180
+ eventQueue.Clear();
181
+ #else
182
+ while (eventQueue.TryDequeue(out var stat)){}
183
+ #endif
178
184
  }
179
185
  }
180
186
 
@@ -8,6 +8,7 @@ namespace Amanotes.Core
8
8
  public class KlavarContainer
9
9
  {
10
10
  public readonly string ctnUUID = GUID.NewGuid().ToString();
11
+ public readonly DateTime createTime = new DateTime();
11
12
  public string lastEventName;
12
13
 
13
14
  public static void LogEventError(string message)
@@ -33,7 +33,15 @@ namespace Amanotes.Core
33
33
  @params[kvp.Key] = kvp.Value;
34
34
  }
35
35
 
36
- AmaGDK.Analytics.LogEvent(eventName, @params);
36
+ if (AmaGDK.Config.analytics.immediatelyLoggedEvents.Contains(eventName))
37
+ {
38
+ AmaGDK.Analytics.LogEventImmediately(eventName, @params);
39
+ }
40
+ else
41
+ {
42
+ AmaGDK.Analytics.LogEvent(eventName, @params);
43
+ }
44
+
37
45
  }
38
46
 
39
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.59",
3
+ "version": "0.2.61",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",
@@ -14,6 +14,7 @@
14
14
  "email": "tech.support@amanotes.com",
15
15
  "url": "https://amanotes.com"
16
16
  },
17
+ "changelogUrl": "https://amagdk.notion.site/Change-Log-6dfd4b67d64f496bbd9eb04ccb4ef95a",
17
18
  "documentationUrl": "https://amagdk.notion.site/amagdk/Ama-GDK-a73596617ab247b6a43c8f12a1581415",
18
19
  "license": "MIT"
19
20
  }