com.amanotes.gdk 0.2.40 → 0.2.41

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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.41 - 2023-11-28]
4
+ - Add more state callbacks for AdShowReadyStatus
5
+ - Fix not wait for RewardCancel event (not exist any more)
6
+ - Timeout for Adapter init should be 1s
7
+
3
8
  ## [0.2.40 - 2023-11-27]
4
9
  - Fix ShowAdTimeout = 0 should not wait for Ad
5
10
 
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -407,7 +407,9 @@ namespace Amanotes.Core.Internal
407
407
  None,
408
408
  Wifi3GDisabled,
409
409
  NoInternet,
410
- TimeOut
410
+ WaitForAd,
411
+ TimeOut,
412
+ Ready,
411
413
  }
412
414
 
413
415
  public class ShowAdContext : IAdCallback
@@ -645,8 +647,9 @@ namespace Amanotes.Core.Internal
645
647
  }
646
648
 
647
649
  _showState = ShowAdsState.WaitForAd;
648
- if (_loadState != LoadAdsState.Requesting) StartLoadAd();
650
+ OnAdShowReadyStatus(false, AdShowReadyStatus.WaitForAd);
649
651
 
652
+ if (_loadState != LoadAdsState.Requesting) StartLoadAd();
650
653
  var counter = 0;
651
654
  bool? hasInternet = null;
652
655
  _instance.StartCoroutine(WebUtils.CheckInternet(result => hasInternet = result));
@@ -681,7 +684,7 @@ namespace Amanotes.Core.Internal
681
684
  }
682
685
 
683
686
  _showState = ShowAdsState.Showing;
684
- OnAdShowReadyStatus(true, AdShowReadyStatus.None);
687
+ OnAdShowReadyStatus(true, AdShowReadyStatus.Ready);
685
688
  HandleBeforeAdShow();
686
689
  ShowAd();
687
690
 
@@ -707,13 +710,9 @@ namespace Amanotes.Core.Internal
707
710
 
708
711
  if (context.hasClosed)
709
712
  {
710
- while (!context.hasFailedOrCancelled && !context.hasReward)
711
- {
712
- Log($"[Ad] {adType} Waiting for [cancel] or [reward]");
713
- yield return null;
714
- }
715
-
716
- ShowAdRoutineCompleted(!context.hasFailedOrCancelled);
713
+ // wait 1 frame in case hasReward callback after onClose
714
+ if (!context.hasReward) yield return null;
715
+ ShowAdRoutineCompleted(context.hasReward);
717
716
  yield break;
718
717
  }
719
718
 
@@ -885,6 +884,7 @@ namespace Amanotes.Core.Internal
885
884
  OnAdShowNotReady(status);
886
885
  } else
887
886
  {
887
+ Ads.context.onAdShowReadyStatus?.Invoke(AdShowReadyStatus.Ready);
888
888
  OnAdShowReady();
889
889
  }
890
890
  }
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.40";
18
+ public const string VERSION = "0.2.41";
19
19
 
20
20
  internal static AmaGDK _instance;
21
21
  internal static Status _status = Status.None;
@@ -69,7 +69,7 @@ namespace Amanotes.Core
69
69
  yield return StartCoroutine(User.Init());
70
70
 
71
71
  float time = 0;
72
- float timeout = 10;
72
+ float timeout = 1;
73
73
 
74
74
  var counter = 0;
75
75
  const int INIT_TOLERANCE = 10 * 60;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.40",
3
+ "version": "0.2.41",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",