com.amanotes.gdk 0.1.4 → 0.1.5
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 +3 -0
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AppsflyerAdapter_v6.5.4.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage +0 -0
- package/Runtime/AmaGDK.Analytics.cs +27 -1
- package/Runtime/AmaGDK.cs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -385,6 +385,7 @@ namespace Amanotes.Core
|
|
|
385
385
|
public static IEventParamsBuilder Except(this IEventParamsBuilder ap, params string[] analyticIds)
|
|
386
386
|
{
|
|
387
387
|
if (ap == null) return null;
|
|
388
|
+
if (analyticIds.Length == 0) return ap;
|
|
388
389
|
|
|
389
390
|
EventParams eventData = ap as EventParams;
|
|
390
391
|
foreach (var mId in analyticIds)
|
|
@@ -397,6 +398,7 @@ namespace Amanotes.Core
|
|
|
397
398
|
public static IEventParamsBuilder OnlyTo(this IEventParamsBuilder ap, params string[] analyticIds)
|
|
398
399
|
{
|
|
399
400
|
if (ap == null) return null;
|
|
401
|
+
if (analyticIds.Length == 0) return ap;
|
|
400
402
|
|
|
401
403
|
EventParams eventData = ap as EventParams;
|
|
402
404
|
foreach (var mId in analyticIds)
|
|
@@ -409,6 +411,7 @@ namespace Amanotes.Core
|
|
|
409
411
|
public static IEventParamsBuilder AddParam(this IEventParamsBuilder ap, string key, object value)
|
|
410
412
|
{
|
|
411
413
|
if (ap == null) return null;
|
|
414
|
+
if (!IsValidKeyValue(ap, key, value)) return ap;
|
|
412
415
|
|
|
413
416
|
var parameters = (ap as EventParams).parameters;
|
|
414
417
|
if (parameters.ContainsKey(key))
|
|
@@ -424,14 +427,37 @@ namespace Amanotes.Core
|
|
|
424
427
|
public static IEventParamsBuilder AddParam(this IEventParamsBuilder ap, Dictionary<string, object> dictParams)
|
|
425
428
|
{
|
|
426
429
|
if (ap == null) return null;
|
|
430
|
+
if (dictParams == null)
|
|
431
|
+
{
|
|
432
|
+
LogWarning($"Param dictionary is null. Event name: {(ap as EventParams).eventName}!");
|
|
433
|
+
return ap;
|
|
434
|
+
}
|
|
427
435
|
|
|
428
436
|
foreach (var kvp in dictParams)
|
|
429
437
|
{
|
|
430
|
-
ap
|
|
438
|
+
if (IsValidKeyValue(ap, kvp.Key, kvp.Value))
|
|
439
|
+
ap.AddParam(kvp.Key, kvp.Value);
|
|
431
440
|
}
|
|
432
441
|
return ap;
|
|
433
442
|
}
|
|
434
443
|
|
|
444
|
+
static bool IsValidKeyValue(IEventParamsBuilder ap, string key, object value)
|
|
445
|
+
{
|
|
446
|
+
string eventName = (ap as EventParams).eventName;
|
|
447
|
+
if (string.IsNullOrWhiteSpace(key))
|
|
448
|
+
{
|
|
449
|
+
LogWarning($"Param key is empty. Event name: {eventName}!");
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
if (value == null)
|
|
453
|
+
{
|
|
454
|
+
LogWarning($"Param value is null. Event name: {eventName}!");
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
return true;
|
|
459
|
+
}
|
|
460
|
+
|
|
435
461
|
}
|
|
436
462
|
}
|
|
437
463
|
|
package/Runtime/AmaGDK.cs
CHANGED