com.amanotes.gdk 0.2.44 → 0.2.45-1

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.45-1 - 2024-01-16]
4
+ - [Fix] Purchase product in Editor
5
+
6
+ ## [0.2.45 - 2023-12-13]
7
+ - [Fix] Able to assign ama_device_id in Editor
8
+
3
9
  ## [0.2.44 - 2023-12-08]
4
10
  - [Fix] Auto log Ad events
5
11
 
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -38,13 +38,30 @@ namespace Amanotes.Core
38
38
  public static IPurchaseBuilder Purchase(string productId)
39
39
  {
40
40
  var result = new PurchaseContext();
41
- if (!dicProducts.ContainsKey(productId))
41
+ ExecuteInNextFrame(() =>
42
42
  {
43
- LogWarning($"[IAP] Product {productId} is not found");
44
- result.onFail?.Invoke(new PurchaseError($"Product {productId} is not found"));
45
- return result;
46
- }
47
- ExecuteInNextFrame(() => result.Purchase(dicProducts[productId]));
43
+ #if UNITY_EDITOR
44
+ if (AdapterConfig.allPurchaseSuccessInEditor)
45
+ {
46
+ PurchaseSuccess s = new PurchaseSuccess
47
+ {
48
+ productIds = new[] { productId },
49
+ isSandbox = true
50
+ };
51
+ result.onSuccess?.Invoke(s);
52
+ return;
53
+ }
54
+ #endif
55
+
56
+ if (!dicProducts.ContainsKey(productId))
57
+ {
58
+ LogWarning($"[IAP] Product {productId} is not found");
59
+ result.onFail?.Invoke(new PurchaseError($"Product {productId} is not found"));
60
+ return;
61
+ }
62
+
63
+ result.Purchase(dicProducts[productId]);
64
+ });
48
65
  return result;
49
66
  }
50
67
 
@@ -516,18 +533,6 @@ namespace Amanotes.Core.Internal
516
533
 
517
534
  public void Purchase(ProductInfo productInfo)
518
535
  {
519
- #if UNITY_EDITOR
520
- if (AdapterConfig.allPurchaseSuccessInEditor)
521
- {
522
- DoOnSuccess(new PurchaseSuccess
523
- {
524
- productIds = new[] { productInfo.id },
525
- isSandbox = true
526
- });
527
- return;
528
- }
529
- #endif
530
-
531
536
  if (!string.IsNullOrWhiteSpace(discountId))
532
537
  {
533
538
  AmaGDK.IAP.Adapter?.PurchaseDiscount(productInfo, discountId, DoOnSuccess, DoOnFail);
@@ -76,7 +76,7 @@ namespace Amanotes.Core
76
76
  set => _pseudoId = ValidateId(value, ALPHANUMERIC_PATTERN);
77
77
  }
78
78
 
79
- #if UNITY_ANDROID
79
+ #if UNITY_ANDROID && !UNITY_EDITOR
80
80
  public string AmaDeviceId
81
81
  {
82
82
  get => _amaDeviceId;
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.44";
18
+ public const string VERSION = "0.2.45-1";
19
19
 
20
20
  internal static AmaGDK _instance;
21
21
  internal static Status _status = Status.None;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.44",
3
+ "version": "0.2.45-1",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",