com.amanotes.gdk 0.2.62 → 0.2.63

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.63 - 2024-06-01]
4
+ - [Fix] Do not include default GDK config asset
5
+ - [Fix] Support compare SemVer with an invalid value
6
+ - [Dev] Add ShowBanner/ HideBanner buttons to AmaGDKExample
7
+ - [Fix] Silent null exception when embedRemoteConfig == null (in Editor)
8
+ - [Dev] Improve banner loading with load failed handler (retry or skip)
9
+ - [Fix] Wrong condition flag for Banner enabled check
10
+ - [Dev] Upgrade Firebase 11.8.0, IronSource 7.9.1, GoogleMobileAds 9.0.0
11
+ - - Fix AppsFlyer error in iOS: Type specifier missing, defaults to ???int???
12
+ - - Min iOS 13.0
13
+ - [Klavar] Parse Klavar structure v0.3
14
+
3
15
  ## [0.2.62 - 2024-05-27]
4
16
  - [Dev] Remove pipeline for unity 2020
5
17
  - [Dev] Dispatch changes / support callback for when UserId updated
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -321,23 +321,37 @@ namespace Amanotes.Core
321
321
  public static bool IsRewardedVideoShowing => (context != null) && (context.adType == AdType.VideoReward);
322
322
 
323
323
 
324
- private static bool _isBannerShowing;
324
+ [NonSerialized] private static bool _isBannerShowing = false;
325
325
 
326
326
  public static void ShowBanner()
327
327
  {
328
- if (_config.ad.enableBanner) return;
328
+ if (!_config.ad.enableBanner)
329
+ {
330
+ LogWarning($"Banner not enabled! {_config.ad.enableBanner}");
331
+ return;
332
+ }
333
+
334
+ if (_isBannerShowing)
335
+ {
336
+ LogWarning($"Banner is showing!");
337
+ return;
338
+ }
329
339
 
330
- if (_isBannerShowing) return;
331
340
  _isBannerShowing = true;
332
- if (_adapter == null) return;
341
+
342
+ if (_adapter == null)
343
+ {
344
+ LogWarning($"Adapter is null!");
345
+ return;
346
+ }
333
347
 
334
348
  dispatcher.Dispatch(Event.BANNER_SHOW);
335
- _adapter.ShowBanner();
349
+ _adapter.ShowBanner();
336
350
  }
337
351
 
338
352
  public static void HideBanner()
339
353
  {
340
- if (_config.ad.enableBanner) return;
354
+ if (!_config.ad.enableBanner) return;
341
355
  if (!_isBannerShowing) return;
342
356
  _isBannerShowing = false;
343
357
  if (_adapter == null) return;
@@ -402,9 +416,9 @@ namespace Amanotes.Core.Internal
402
416
  [Tooltip("When an ad is not ready to show, verify that there is an internet connection by ping the internet check URL .\nIf there is no internet connection, we will not need to wait for adShowTimeout secs")]
403
417
  public bool checkInternet = true;
404
418
 
405
- [HideInInspector] public bool enableInterstitial = true;
406
- [HideInInspector] public bool enableRewarded = true;
407
- [HideInInspector] public bool enableBanner = true;
419
+ [NonSerialized] public bool enableInterstitial = true;
420
+ [NonSerialized] public bool enableRewarded = true;
421
+ [NonSerialized] public bool enableBanner = true;
408
422
 
409
423
  [Tooltip("Before showing an ad: set AudioListener.volume to 0\nAfter the ad is closed: restore the previously saved AudioListener.volume")]
410
424
  public bool autoMute = true;
@@ -929,7 +943,15 @@ namespace Amanotes.Core.Internal
929
943
  protected void OnAdShowFailed()
930
944
  {
931
945
  Log($"[Ad] {adType} OnAdShowFailed");
932
-
946
+
947
+ // 509 Show Fail: No ads to show
948
+ // 520 Show Fail: No internet connection; ShouldTrackNetworkState is enabled
949
+ // 524 Show Fail: Placement %@ has reached its limit as defined per pace
950
+ // 526 Show Fail: Ad unit has reached its daily cap per session
951
+ // 1022 Show Fail: Cannot show an RV while another RV is showing
952
+ // 1023 Show Fail: Show RV called when there are no available ads to show
953
+ // 1036 Show Fail: Cannot show an while another is showing
954
+
933
955
  if (Ads.context != null)
934
956
  {
935
957
  Ads.context.adCallback |= AdCallback.Fail;
@@ -1014,10 +1036,12 @@ namespace Amanotes.Core.Internal
1014
1036
  {
1015
1037
  LogWarning("[Ad] Something wrong? OnAdReady called when no ad is loading! AdType=" + adType);
1016
1038
  }
1017
-
1039
+
1018
1040
  _isRequesting = false;
1019
1041
  }
1020
-
1042
+
1043
+
1044
+
1021
1045
  protected void OnAdLoadFailed(string error)
1022
1046
  {
1023
1047
  Log($"[Ad] {adType} OnAdLoadFailed: {error}");
@@ -69,11 +69,12 @@ namespace Amanotes.Core
69
69
 
70
70
  public static T Get<T>(string key, T defaultValue = default(T))
71
71
  {
72
+ var embed = Config.remoteConfig.embedRemoteConfig;
72
73
  #if UNITY_EDITOR
73
74
  //Override value in editor environment
74
- if (Config.remoteConfig.embedRemoteConfig.overrideInEditor)
75
+ if (embed != null && embed.overrideInEditor)
75
76
  {
76
- foreach (var c in Config.remoteConfig.embedRemoteConfig.overrideConfig)
77
+ foreach (var c in embed.overrideConfig)
77
78
  if (c.key == key)
78
79
  return (T)Convert.ChangeType(c.value, typeof(T));
79
80
  }
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.62";
20
+ public const string VERSION = "0.2.63";
21
21
 
22
22
  internal static AmaGDK _instance;
23
23
  internal static bool _allowInit = false;
@@ -1,6 +1,7 @@
1
1
  using System;
2
2
  using System.Collections.Generic;
3
3
  using System.Text.RegularExpressions;
4
+ using UnityEngine;
4
5
  using UnityEngine.Profiling;
5
6
  using static Amanotes.Core.Internal.Logging;
6
7
 
@@ -9,7 +10,7 @@ namespace Amanotes.Core.Internal
9
10
  public struct SemVer : IComparable<SemVer>, IComparer<SemVer>
10
11
  {
11
12
  public static readonly SemVer ZERO = new SemVer(0, 0, 0);
12
- private static readonly Regex VERSION_PATTERN = new Regex(@"^(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?$");
13
+ private static readonly Regex VERSION_PATTERN = new Regex(@"^(\d+)\.(\d+)(?:\.(\d+))?(?:\.(\d+))?$");
13
14
 
14
15
  public int major;
15
16
  public int minor;
@@ -45,13 +46,21 @@ namespace Amanotes.Core.Internal
45
46
  }
46
47
  major = int.Parse(match.Groups[1].Value);
47
48
  minor = int.Parse(match.Groups[2].Value);
48
- patch = int.Parse(match.Groups[3].Value);
49
+ if (match.Groups.Count > 2)
50
+ {
51
+ if (!int.TryParse(match.Groups[3].Value, out patch))
52
+ {
53
+ patch = 0;
54
+ }
55
+ }
49
56
  if (match.Groups.Count > 3)
50
57
  {
51
58
  if (!int.TryParse(match.Groups[4].Value, out extra))
59
+ {
52
60
  extra = -1;
53
61
  }
54
62
  }
63
+ }
55
64
  Profiler.EndSample();
56
65
  }
57
66
 
@@ -66,6 +75,21 @@ namespace Amanotes.Core.Internal
66
75
 
67
76
  public int CompareTo(SemVer other)
68
77
  {
78
+ if (!isValid)
79
+ {
80
+ if (!other.isValid)
81
+ {
82
+ return 0;
83
+ }
84
+ return -1;
85
+ }
86
+
87
+ if (!other.isValid)
88
+ {
89
+ return 1;
90
+ }
91
+
92
+
69
93
  if (major != other.major) return major.CompareTo(other.major);
70
94
  if (minor != other.minor) return minor.CompareTo(other.minor);
71
95
  if (patch != other.patch) return patch.CompareTo(other.patch);
@@ -175,7 +175,7 @@ namespace Amanotes.Core.Internal
175
175
  analyticsData.cachedEventDetails.Clear();
176
176
  analyticsData.migrationLog = new MigrationLog();
177
177
  analyticsData.SaveIfDirty();
178
- sessionStat.Clear();
178
+ sessionStat?.Clear();
179
179
  #if UNITY_2021_3_OR_NEWER
180
180
  eventQueue.Clear();
181
181
  #else
@@ -16,4 +16,5 @@ namespace Amanotes.Core
16
16
  return AmaGDK.Analytics.GetAccumulatedCount(attr.name) + 1;
17
17
  }
18
18
  }
19
+ public class LifetimeCountAttribute : AccumulatedCountAttribute { }
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.62",
3
+ "version": "0.2.63",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",