com.amanotes.gdk 0.1.4 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.8 - 2023-02-15]
4
+ ### Release AmaGDK v0.1.8
5
+ ### Add AdapterID
6
+
7
+ ## [0.1.5 - 2023-02-13]
8
+ ### Release AmaSDK v0.1.5
9
+ ### Validate EventParams
10
+
3
11
  ## [0.1.4 - 2023-02-13]
4
12
  ### Release AmaSDK v0.1.4
5
13
 
Binary file
@@ -20,7 +20,7 @@ namespace Amanotes.Core.Internal
20
20
  protected static T _instance;
21
21
  protected static Status _status = Status.None;
22
22
  public bool IsReady => _status == Status.Ready;
23
- public string Id => typeof(T).ToString();
23
+ public string Id => typeof(T).Name.Replace("Adapter", string.Empty);
24
24
 
25
25
  public void Init()
26
26
  {
@@ -170,6 +170,7 @@ namespace Amanotes.Core
170
170
  internal static void ProcessEventQueue()
171
171
  {
172
172
  if (eventQueue.Count <= 0) return;
173
+ bool showAnalyticsLog = Config.common.showAnalyticsLog;
173
174
 
174
175
  while (eventQueue.Count > 0)
175
176
  {
@@ -188,12 +189,14 @@ namespace Amanotes.Core
188
189
  eventData.AddParam("accumulated_count", counter);
189
190
  }
190
191
 
191
- Log($"Send {eventData.eventName}, count {counter}");
192
192
  foreach (var m in listAdapters)
193
193
  {
194
- if (eventData.ignoreAnalyticIds.Contains(((IAdapter)m).Id))
194
+ var id = ((IAdapter)m).Id;
195
+ if (eventData.ignoreAnalyticIds.Contains(id))
195
196
  continue;
197
+
196
198
  m.LogEvent(eventData);
199
+ if (showAnalyticsLog) Debug.Log($"[{id}] Sent event <{eventData.eventName}> ({counter})");
197
200
  }
198
201
  }
199
202
 
@@ -385,6 +388,7 @@ namespace Amanotes.Core
385
388
  public static IEventParamsBuilder Except(this IEventParamsBuilder ap, params string[] analyticIds)
386
389
  {
387
390
  if (ap == null) return null;
391
+ if (analyticIds.Length == 0) return ap;
388
392
 
389
393
  EventParams eventData = ap as EventParams;
390
394
  foreach (var mId in analyticIds)
@@ -397,6 +401,7 @@ namespace Amanotes.Core
397
401
  public static IEventParamsBuilder OnlyTo(this IEventParamsBuilder ap, params string[] analyticIds)
398
402
  {
399
403
  if (ap == null) return null;
404
+ if (analyticIds.Length == 0) return ap;
400
405
 
401
406
  EventParams eventData = ap as EventParams;
402
407
  foreach (var mId in analyticIds)
@@ -409,6 +414,7 @@ namespace Amanotes.Core
409
414
  public static IEventParamsBuilder AddParam(this IEventParamsBuilder ap, string key, object value)
410
415
  {
411
416
  if (ap == null) return null;
417
+ if (!IsValidKeyValue(ap, key, value)) return ap;
412
418
 
413
419
  var parameters = (ap as EventParams).parameters;
414
420
  if (parameters.ContainsKey(key))
@@ -424,14 +430,37 @@ namespace Amanotes.Core
424
430
  public static IEventParamsBuilder AddParam(this IEventParamsBuilder ap, Dictionary<string, object> dictParams)
425
431
  {
426
432
  if (ap == null) return null;
433
+ if (dictParams == null)
434
+ {
435
+ LogWarning($"Param dictionary is null. Event name: {(ap as EventParams).eventName}!");
436
+ return ap;
437
+ }
427
438
 
428
439
  foreach (var kvp in dictParams)
429
440
  {
430
- ap.AddParam(kvp.Key, kvp.Value);
441
+ if (IsValidKeyValue(ap, kvp.Key, kvp.Value))
442
+ ap.AddParam(kvp.Key, kvp.Value);
431
443
  }
432
444
  return ap;
433
445
  }
434
446
 
447
+ static bool IsValidKeyValue(IEventParamsBuilder ap, string key, object value)
448
+ {
449
+ string eventName = (ap as EventParams).eventName;
450
+ if (string.IsNullOrWhiteSpace(key))
451
+ {
452
+ LogWarning($"Param key is empty. Event name: {eventName}!");
453
+ return false;
454
+ }
455
+ if (value == null)
456
+ {
457
+ LogWarning($"Param value is null. Event name: {eventName}!");
458
+ return false;
459
+ }
460
+
461
+ return true;
462
+ }
463
+
435
464
  }
436
465
  }
437
466
 
@@ -439,8 +468,9 @@ namespace Amanotes.Core.Internal
439
468
  {
440
469
  partial class SDKConfig
441
470
  {
442
- public bool normalizeEventName;
443
- public bool checkMigrationIntegrity;
471
+ public bool showAnalyticsLog = true;
472
+ public bool normalizeEventName = true;
473
+ public bool checkMigrationIntegrity = true;
444
474
  }
445
475
 
446
476
  public interface IAnalyticAdapter
@@ -38,7 +38,7 @@ namespace Amanotes.Core.Internal
38
38
  public static readonly string[] AMAGDK_ADAPTERS = new string[]
39
39
  {
40
40
  "FirebaseAnalyticsAdapter_v9.1.0",
41
- "AppsflyerAdapter_v6.5.4",
41
+ //"AppsflyerAdapter_v6.5.4",
42
42
  };
43
43
  }
44
44
 
@@ -65,7 +65,7 @@ namespace Amanotes.Core.Internal
65
65
  }
66
66
  public static void Log(string message)
67
67
  {
68
- Debug.Log("[AmaGDK] " + message);
68
+ if (AmaGDK.Config.common.verboseLog) Debug.Log("[AmaGDK] " + message);
69
69
  }
70
70
  }
71
71
 
package/Runtime/AmaGDK.cs CHANGED
@@ -12,7 +12,7 @@ namespace Amanotes.Core
12
12
  {
13
13
  public partial class AmaGDK : MonoBehaviour
14
14
  {
15
- public const string VERSION = "0.1.4";
15
+ public const string VERSION = "0.1.8";
16
16
 
17
17
  internal static AmaGDK _instance;
18
18
  private static ConfigAsset _config = null;
@@ -102,7 +102,7 @@ namespace Amanotes.Core
102
102
  _status = Status.Ready;
103
103
  _onReadyCallback?.Invoke();
104
104
  _onReadyCallback = null;
105
- Log(READY);
105
+ Debug.Log($"[AmaGDK] {READY}");
106
106
  }
107
107
 
108
108
  private void Update()
@@ -156,4 +156,16 @@ namespace Amanotes.Core
156
156
  }
157
157
 
158
158
  }
159
+
160
+ public partial class AmaGDK
161
+ {
162
+ public static class AdapterID
163
+ {
164
+ public const string FIREBASE_ANALYTICS = "FirebaseAnalytics";
165
+ public const string FIREBASE_REMOTE_CONFIG = "FirebaseRemoteConfig";
166
+ public const string APPSFLYER = "Appsflyer";
167
+ public const string IRONSOURCE = "ironSource";
168
+ public const string REVENUECAT = "RevenueCat";
169
+ }
170
+ }
159
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.8",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2020.3",
@@ -1,7 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: e116b2ceddfdc42a7a01d4ce86de20de
3
- DefaultImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant: