com.amanotes.gdk 0.2.41 → 0.2.43

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.43 - 2023-12-06]
4
+ - [Fix] Support AmaDeviceId on Standalone
5
+
6
+ ## [0.2.42 - 2023-11-28]
7
+ - [Fix] AdShowNotReady only trigger for 3 type of status
8
+ - [Fix] WaitForSeconds can not be shared between different routines
9
+
3
10
  ## [0.2.41 - 2023-11-28]
4
11
  - Add more state callbacks for AdShowReadyStatus
5
12
  - Fix not wait for RewardCancel event (not exist any more)
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -452,8 +452,6 @@ namespace Amanotes.Core.Internal
452
452
 
453
453
  public abstract class AdLogic
454
454
  {
455
- private static readonly WaitForSecondsRealtime wait1Sec = new WaitForSecondsRealtime(1f);
456
-
457
455
  internal LoadAdsState _loadState = LoadAdsState.None;
458
456
  internal bool hasAd
459
457
  {
@@ -506,6 +504,7 @@ namespace Amanotes.Core.Internal
506
504
  yield break;
507
505
  }
508
506
 
507
+ var wait1Sec = new WaitForSecondsRealtime(1f);
509
508
  Log("[Ad] LoadAdRoutine start(): isAdReady = " + isAdReady);
510
509
  while (true)
511
510
  {
@@ -654,6 +653,7 @@ namespace Amanotes.Core.Internal
654
653
  bool? hasInternet = null;
655
654
  _instance.StartCoroutine(WebUtils.CheckInternet(result => hasInternet = result));
656
655
 
656
+ var wait1Sec = new WaitForSecondsRealtime(1f);
657
657
  while (counter < timeout || timeout == -1)
658
658
  {
659
659
  yield return wait1Sec;
@@ -875,22 +875,21 @@ namespace Amanotes.Core.Internal
875
875
 
876
876
  protected void OnAdShowReadyStatus(bool isReady, AdShowReadyStatus status)
877
877
  {
878
- if (Ads.context != null)
878
+ if (Ads.context == null)
879
879
  {
880
+ LogWarning("[Ad] OnAdOpen() Something wrong - No AdContext");
881
+ return;
882
+ }
883
+
880
884
  Ads.context.adCallback |= AdCallback.ShowReadyStatus;
881
- if (!isReady)
882
- {
883
885
  Ads.context.onAdShowReadyStatus?.Invoke(status);
884
- OnAdShowNotReady(status);
885
- } else
886
+ if (status == AdShowReadyStatus.Ready)
886
887
  {
887
- Ads.context.onAdShowReadyStatus?.Invoke(AdShowReadyStatus.Ready);
888
888
  OnAdShowReady();
889
889
  }
890
- }
891
- else
890
+ else if (status == AdShowReadyStatus.NoInternet || status == AdShowReadyStatus.TimeOut || status == AdShowReadyStatus.Wifi3GDisabled)
892
891
  {
893
- LogWarning("[Ad] OnAdOpen() Something wrong - No AdContext");
892
+ OnAdShowNotReady(status);
894
893
  }
895
894
  }
896
895
 
@@ -33,7 +33,11 @@ namespace Amanotes.Core
33
33
  {
34
34
  public string UserId
35
35
  {
36
- get => _userId;
36
+ get
37
+ {
38
+ if (string.IsNullOrWhiteSpace(_userId)) UpdateUserId();
39
+ return _userId;
40
+ }
37
41
  private set
38
42
  {
39
43
  _userId = value;
@@ -72,24 +76,20 @@ namespace Amanotes.Core
72
76
  set => _pseudoId = ValidateId(value, ALPHANUMERIC_PATTERN);
73
77
  }
74
78
 
75
- #if UNITY_IOS
79
+ #if UNITY_ANDROID
76
80
  public string AmaDeviceId
77
81
  {
78
82
  get => _amaDeviceId;
79
- set => _amaDeviceId = ValidateId(value, ALPHANUMERIC_HYPHEN_PATTERN);
83
+ set => _amaDeviceId = ValidateId(value, ALPHANUMERIC_PATTERN);
80
84
  }
81
- #endif
82
-
83
- #if UNITY_ANDROID
85
+ #else
84
86
  public string AmaDeviceId
85
87
  {
86
88
  get => _amaDeviceId;
87
- set => _amaDeviceId = ValidateId(value, ALPHANUMERIC_PATTERN);
89
+ set => _amaDeviceId = ValidateId(value, ALPHANUMERIC_HYPHEN_PATTERN);
88
90
  }
89
91
  #endif
90
-
91
-
92
-
92
+
93
93
  public string AppsFlyerId
94
94
  {
95
95
  get => _appsFlyerId;
package/Runtime/AmaGDK.cs CHANGED
@@ -15,7 +15,7 @@ namespace Amanotes.Core
15
15
  {
16
16
  public partial class AmaGDK : MonoBehaviour
17
17
  {
18
- public const string VERSION = "0.2.41";
18
+ public const string VERSION = "0.2.43";
19
19
 
20
20
  internal static AmaGDK _instance;
21
21
  internal static Status _status = Status.None;
@@ -120,12 +120,11 @@ namespace Amanotes.Core
120
120
  adapterAnnounce.AppendLine(string.Format("[{0}] {1} (adapter v{2})", adapter.IsReady ? "OK" : "FAIL",
121
121
  adapter.adapterId, adapter.adapterVersion));
122
122
 
123
- if (adapter.adapterId == AdapterID.FIREBASE_ANALYTICS) User.UpdateUserId();
124
-
125
123
  // Wait for postprocessing of each adapter
126
124
  yield return null;
127
125
  }
128
126
  _onAdapterReadyCallback = null;
127
+ User.UpdateUserId();
129
128
 
130
129
  // Init modules (Adapter managers)
131
130
  Analytics.Init();
@@ -212,6 +211,13 @@ namespace Amanotes.Core
212
211
  LogWarning("Cannot add a null callback!");
213
212
  return;
214
213
  }
214
+
215
+ if (isReady)
216
+ {
217
+ onReady.Invoke();
218
+ return;
219
+ }
220
+
215
221
  _onReadyCallback -= onReady;
216
222
  _onReadyCallback += onReady;
217
223
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.41",
3
+ "version": "0.2.43",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",
@@ -1,7 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 86143bf1eeccc4df3832a37f7548e2ff
3
- DefaultImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant: