react-native-iap 14.4.47 → 14.5.1-rc.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.
Files changed (101) hide show
  1. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +76 -16
  2. package/ios/HybridRnIap.swift +17 -5
  3. package/ios/RnIapHelper.swift +8 -0
  4. package/ios/reactnativeiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  5. package/ios/reactnativeiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  6. package/lib/module/index.js +6 -5
  7. package/lib/module/index.js.map +1 -1
  8. package/lib/module/types.js +35 -0
  9. package/lib/module/types.js.map +1 -1
  10. package/lib/module/utils/type-bridge.js +21 -1
  11. package/lib/module/utils/type-bridge.js.map +1 -1
  12. package/lib/typescript/src/index.d.ts.map +1 -1
  13. package/lib/typescript/src/specs/RnIap.nitro.d.ts +71 -4
  14. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  15. package/lib/typescript/src/types.d.ts +155 -10
  16. package/lib/typescript/src/types.d.ts.map +1 -1
  17. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  18. package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +13 -0
  19. package/nitrogen/generated/android/c++/JFunc_void_NitroPurchase.hpp +2 -0
  20. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +32 -4
  21. package/nitrogen/generated/android/c++/{JIapkitStore.hpp → JIapStore.hpp} +19 -13
  22. package/nitrogen/generated/android/c++/JNitroDiscountAmountAndroid.hpp +61 -0
  23. package/nitrogen/generated/android/c++/JNitroDiscountDisplayInfoAndroid.hpp +64 -0
  24. package/nitrogen/generated/android/c++/JNitroLimitedQuantityInfoAndroid.hpp +61 -0
  25. package/nitrogen/generated/android/c++/JNitroOneTimePurchaseOfferDetail.hpp +70 -3
  26. package/nitrogen/generated/android/c++/JNitroPreorderDetailsAndroid.hpp +61 -0
  27. package/nitrogen/generated/android/c++/JNitroProduct.hpp +35 -5
  28. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +13 -3
  29. package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +11 -3
  30. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +2 -0
  31. package/nitrogen/generated/android/c++/JNitroRentalDetailsAndroid.hpp +62 -0
  32. package/nitrogen/generated/android/c++/JNitroValidTimeWindowAndroid.hpp +61 -0
  33. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithIapkitResult.hpp +6 -6
  34. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderError.hpp +62 -0
  35. package/nitrogen/generated/android/c++/JNitroVerifyPurchaseWithProviderResult.hpp +24 -16
  36. package/nitrogen/generated/android/c++/JPurchase.hpp +2 -0
  37. package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +11 -1
  38. package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +7 -1
  39. package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +2 -0
  40. package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.hpp +2 -0
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/{IapkitStore.kt → IapStore.kt} +7 -5
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroDiscountAmountAndroid.kt +39 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroDiscountDisplayInfoAndroid.kt +39 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroLimitedQuantityInfoAndroid.kt +39 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroOneTimePurchaseOfferDetail.kt +30 -3
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPreorderDetailsAndroid.kt +39 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +2 -2
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +9 -3
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +9 -3
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRentalDetailsAndroid.kt +39 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroValidTimeWindowAndroid.kt +39 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithIapkitResult.kt +2 -2
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderError.kt +39 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroVerifyPurchaseWithProviderResult.kt +6 -3
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +8 -2
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +5 -2
  57. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +178 -26
  58. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +24 -3
  59. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +24 -3
  60. package/nitrogen/generated/ios/swift/{IapkitStore.swift → IapStore.swift} +14 -6
  61. package/nitrogen/generated/ios/swift/NitroDiscountAmountAndroid.swift +46 -0
  62. package/nitrogen/generated/ios/swift/NitroDiscountDisplayInfoAndroid.swift +70 -0
  63. package/nitrogen/generated/ios/swift/NitroLimitedQuantityInfoAndroid.swift +46 -0
  64. package/nitrogen/generated/ios/swift/NitroOneTimePurchaseOfferDetail.swift +211 -2
  65. package/nitrogen/generated/ios/swift/NitroPreorderDetailsAndroid.swift +46 -0
  66. package/nitrogen/generated/ios/swift/NitroProduct.swift +26 -7
  67. package/nitrogen/generated/ios/swift/NitroPurchase.swift +43 -2
  68. package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +47 -1
  69. package/nitrogen/generated/ios/swift/NitroRentalDetailsAndroid.swift +65 -0
  70. package/nitrogen/generated/ios/swift/NitroValidTimeWindowAndroid.swift +46 -0
  71. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithIapkitResult.swift +2 -2
  72. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderError.swift +65 -0
  73. package/nitrogen/generated/ios/swift/NitroVerifyPurchaseWithProviderResult.swift +55 -13
  74. package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +44 -3
  75. package/nitrogen/generated/ios/swift/PurchaseIOS.swift +13 -2
  76. package/nitrogen/generated/shared/c++/{IapkitStore.hpp → IapStore.hpp} +23 -15
  77. package/nitrogen/generated/shared/c++/NitroDiscountAmountAndroid.hpp +79 -0
  78. package/nitrogen/generated/shared/c++/NitroDiscountDisplayInfoAndroid.hpp +81 -0
  79. package/nitrogen/generated/shared/c++/NitroLimitedQuantityInfoAndroid.hpp +79 -0
  80. package/nitrogen/generated/shared/c++/NitroOneTimePurchaseOfferDetail.hpp +55 -3
  81. package/nitrogen/generated/shared/c++/NitroPreorderDetailsAndroid.hpp +79 -0
  82. package/nitrogen/generated/shared/c++/NitroProduct.hpp +6 -5
  83. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +13 -2
  84. package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +10 -2
  85. package/nitrogen/generated/shared/c++/NitroRentalDetailsAndroid.hpp +80 -0
  86. package/nitrogen/generated/shared/c++/NitroValidTimeWindowAndroid.hpp +79 -0
  87. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithIapkitResult.hpp +8 -8
  88. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderError.hpp +80 -0
  89. package/nitrogen/generated/shared/c++/NitroVerifyPurchaseWithProviderResult.hpp +13 -5
  90. package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +12 -1
  91. package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +8 -1
  92. package/openiap-versions.json +3 -3
  93. package/package.json +1 -1
  94. package/plugin/build/src/withIAP.d.ts +3 -0
  95. package/plugin/build/src/withIAP.js +81 -0
  96. package/plugin/build/tsconfig.tsbuildinfo +1 -0
  97. package/plugin/tsconfig.tsbuildinfo +1 -1
  98. package/src/index.ts +8 -5
  99. package/src/specs/RnIap.nitro.ts +79 -4
  100. package/src/types.ts +163 -11
  101. package/src/utils/type-bridge.ts +23 -0
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// NitroVerifyPurchaseWithProviderError.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+
27
+
28
+ #include <string>
29
+ #include <optional>
30
+
31
+ namespace margelo::nitro::iap {
32
+
33
+ /**
34
+ * A struct which can be represented as a JavaScript object (NitroVerifyPurchaseWithProviderError).
35
+ */
36
+ struct NitroVerifyPurchaseWithProviderError {
37
+ public:
38
+ std::optional<std::string> code SWIFT_PRIVATE;
39
+ std::string message SWIFT_PRIVATE;
40
+
41
+ public:
42
+ NitroVerifyPurchaseWithProviderError() = default;
43
+ explicit NitroVerifyPurchaseWithProviderError(std::optional<std::string> code, std::string message): code(code), message(message) {}
44
+ };
45
+
46
+ } // namespace margelo::nitro::iap
47
+
48
+ namespace margelo::nitro {
49
+
50
+ // C++ NitroVerifyPurchaseWithProviderError <> JS NitroVerifyPurchaseWithProviderError (object)
51
+ template <>
52
+ struct JSIConverter<margelo::nitro::iap::NitroVerifyPurchaseWithProviderError> final {
53
+ static inline margelo::nitro::iap::NitroVerifyPurchaseWithProviderError fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ jsi::Object obj = arg.asObject(runtime);
55
+ return margelo::nitro::iap::NitroVerifyPurchaseWithProviderError(
56
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "code")),
57
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "message"))
58
+ );
59
+ }
60
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroVerifyPurchaseWithProviderError& arg) {
61
+ jsi::Object obj(runtime);
62
+ obj.setProperty(runtime, "code", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.code));
63
+ obj.setProperty(runtime, "message", JSIConverter<std::string>::toJSI(runtime, arg.message));
64
+ return obj;
65
+ }
66
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
67
+ if (!value.isObject()) {
68
+ return false;
69
+ }
70
+ jsi::Object obj = value.getObject(runtime);
71
+ if (!nitro::isPlainObject(runtime, obj)) {
72
+ return false;
73
+ }
74
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "code"))) return false;
75
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "message"))) return false;
76
+ return true;
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -25,10 +25,14 @@
25
25
 
26
26
  // Forward declaration of `NitroVerifyPurchaseWithIapkitResult` to properly resolve imports.
27
27
  namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitResult; }
28
+ // Forward declaration of `NitroVerifyPurchaseWithProviderError` to properly resolve imports.
29
+ namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderError; }
28
30
  // Forward declaration of `PurchaseVerificationProvider` to properly resolve imports.
29
31
  namespace margelo::nitro::iap { enum class PurchaseVerificationProvider; }
30
32
 
31
33
  #include "NitroVerifyPurchaseWithIapkitResult.hpp"
34
+ #include <optional>
35
+ #include "NitroVerifyPurchaseWithProviderError.hpp"
32
36
  #include <vector>
33
37
  #include "PurchaseVerificationProvider.hpp"
34
38
 
@@ -39,12 +43,13 @@ namespace margelo::nitro::iap {
39
43
  */
40
44
  struct NitroVerifyPurchaseWithProviderResult {
41
45
  public:
42
- std::vector<NitroVerifyPurchaseWithIapkitResult> iapkit SWIFT_PRIVATE;
46
+ std::optional<NitroVerifyPurchaseWithIapkitResult> iapkit SWIFT_PRIVATE;
47
+ std::optional<std::vector<NitroVerifyPurchaseWithProviderError>> errors SWIFT_PRIVATE;
43
48
  PurchaseVerificationProvider provider SWIFT_PRIVATE;
44
49
 
45
50
  public:
46
51
  NitroVerifyPurchaseWithProviderResult() = default;
47
- explicit NitroVerifyPurchaseWithProviderResult(std::vector<NitroVerifyPurchaseWithIapkitResult> iapkit, PurchaseVerificationProvider provider): iapkit(iapkit), provider(provider) {}
52
+ explicit NitroVerifyPurchaseWithProviderResult(std::optional<NitroVerifyPurchaseWithIapkitResult> iapkit, std::optional<std::vector<NitroVerifyPurchaseWithProviderError>> errors, PurchaseVerificationProvider provider): iapkit(iapkit), errors(errors), provider(provider) {}
48
53
  };
49
54
 
50
55
  } // namespace margelo::nitro::iap
@@ -57,13 +62,15 @@ namespace margelo::nitro {
57
62
  static inline margelo::nitro::iap::NitroVerifyPurchaseWithProviderResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
63
  jsi::Object obj = arg.asObject(runtime);
59
64
  return margelo::nitro::iap::NitroVerifyPurchaseWithProviderResult(
60
- JSIConverter<std::vector<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult>>::fromJSI(runtime, obj.getProperty(runtime, "iapkit")),
65
+ JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult>>::fromJSI(runtime, obj.getProperty(runtime, "iapkit")),
66
+ JSIConverter<std::optional<std::vector<margelo::nitro::iap::NitroVerifyPurchaseWithProviderError>>>::fromJSI(runtime, obj.getProperty(runtime, "errors")),
61
67
  JSIConverter<margelo::nitro::iap::PurchaseVerificationProvider>::fromJSI(runtime, obj.getProperty(runtime, "provider"))
62
68
  );
63
69
  }
64
70
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::NitroVerifyPurchaseWithProviderResult& arg) {
65
71
  jsi::Object obj(runtime);
66
- obj.setProperty(runtime, "iapkit", JSIConverter<std::vector<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult>>::toJSI(runtime, arg.iapkit));
72
+ obj.setProperty(runtime, "iapkit", JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult>>::toJSI(runtime, arg.iapkit));
73
+ obj.setProperty(runtime, "errors", JSIConverter<std::optional<std::vector<margelo::nitro::iap::NitroVerifyPurchaseWithProviderError>>>::toJSI(runtime, arg.errors));
67
74
  obj.setProperty(runtime, "provider", JSIConverter<margelo::nitro::iap::PurchaseVerificationProvider>::toJSI(runtime, arg.provider));
68
75
  return obj;
69
76
  }
@@ -75,7 +82,8 @@ namespace margelo::nitro {
75
82
  if (!nitro::isPlainObject(runtime, obj)) {
76
83
  return false;
77
84
  }
78
- if (!JSIConverter<std::vector<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult>>::canConvert(runtime, obj.getProperty(runtime, "iapkit"))) return false;
85
+ if (!JSIConverter<std::optional<margelo::nitro::iap::NitroVerifyPurchaseWithIapkitResult>>::canConvert(runtime, obj.getProperty(runtime, "iapkit"))) return false;
86
+ if (!JSIConverter<std::optional<std::vector<margelo::nitro::iap::NitroVerifyPurchaseWithProviderError>>>::canConvert(runtime, obj.getProperty(runtime, "errors"))) return false;
79
87
  if (!JSIConverter<margelo::nitro::iap::PurchaseVerificationProvider>::canConvert(runtime, obj.getProperty(runtime, "provider"))) return false;
80
88
  return true;
81
89
  }
@@ -27,12 +27,15 @@
27
27
  namespace margelo::nitro::iap { enum class IapPlatform; }
28
28
  // Forward declaration of `PurchaseState` to properly resolve imports.
29
29
  namespace margelo::nitro::iap { enum class PurchaseState; }
30
+ // Forward declaration of `IapStore` to properly resolve imports.
31
+ namespace margelo::nitro::iap { enum class IapStore; }
30
32
 
31
33
  #include <optional>
32
34
  #include <string>
33
35
  #include <vector>
34
36
  #include "IapPlatform.hpp"
35
37
  #include "PurchaseState.hpp"
38
+ #include "IapStore.hpp"
36
39
 
37
40
  namespace margelo::nitro::iap {
38
41
 
@@ -49,6 +52,7 @@ namespace margelo::nitro::iap {
49
52
  std::optional<std::vector<std::string>> ids SWIFT_PRIVATE;
50
53
  std::optional<bool> isAcknowledgedAndroid SWIFT_PRIVATE;
51
54
  bool isAutoRenewing SWIFT_PRIVATE;
55
+ std::optional<bool> isSuspendedAndroid SWIFT_PRIVATE;
52
56
  std::optional<std::string> obfuscatedAccountIdAndroid SWIFT_PRIVATE;
53
57
  std::optional<std::string> obfuscatedProfileIdAndroid SWIFT_PRIVATE;
54
58
  std::optional<std::string> packageNameAndroid SWIFT_PRIVATE;
@@ -58,12 +62,13 @@ namespace margelo::nitro::iap {
58
62
  std::optional<std::string> purchaseToken SWIFT_PRIVATE;
59
63
  double quantity SWIFT_PRIVATE;
60
64
  std::optional<std::string> signatureAndroid SWIFT_PRIVATE;
65
+ IapStore store SWIFT_PRIVATE;
61
66
  double transactionDate SWIFT_PRIVATE;
62
67
  std::optional<std::string> transactionId SWIFT_PRIVATE;
63
68
 
64
69
  public:
65
70
  PurchaseAndroid() = default;
66
- explicit PurchaseAndroid(std::optional<bool> autoRenewingAndroid, std::optional<std::string> currentPlanId, std::optional<std::string> dataAndroid, std::optional<std::string> developerPayloadAndroid, std::string id, std::optional<std::vector<std::string>> ids, std::optional<bool> isAcknowledgedAndroid, bool isAutoRenewing, std::optional<std::string> obfuscatedAccountIdAndroid, std::optional<std::string> obfuscatedProfileIdAndroid, std::optional<std::string> packageNameAndroid, IapPlatform platform, std::string productId, PurchaseState purchaseState, std::optional<std::string> purchaseToken, double quantity, std::optional<std::string> signatureAndroid, double transactionDate, std::optional<std::string> transactionId): autoRenewingAndroid(autoRenewingAndroid), currentPlanId(currentPlanId), dataAndroid(dataAndroid), developerPayloadAndroid(developerPayloadAndroid), id(id), ids(ids), isAcknowledgedAndroid(isAcknowledgedAndroid), isAutoRenewing(isAutoRenewing), obfuscatedAccountIdAndroid(obfuscatedAccountIdAndroid), obfuscatedProfileIdAndroid(obfuscatedProfileIdAndroid), packageNameAndroid(packageNameAndroid), platform(platform), productId(productId), purchaseState(purchaseState), purchaseToken(purchaseToken), quantity(quantity), signatureAndroid(signatureAndroid), transactionDate(transactionDate), transactionId(transactionId) {}
71
+ explicit PurchaseAndroid(std::optional<bool> autoRenewingAndroid, std::optional<std::string> currentPlanId, std::optional<std::string> dataAndroid, std::optional<std::string> developerPayloadAndroid, std::string id, std::optional<std::vector<std::string>> ids, std::optional<bool> isAcknowledgedAndroid, bool isAutoRenewing, std::optional<bool> isSuspendedAndroid, std::optional<std::string> obfuscatedAccountIdAndroid, std::optional<std::string> obfuscatedProfileIdAndroid, std::optional<std::string> packageNameAndroid, IapPlatform platform, std::string productId, PurchaseState purchaseState, std::optional<std::string> purchaseToken, double quantity, std::optional<std::string> signatureAndroid, IapStore store, double transactionDate, std::optional<std::string> transactionId): autoRenewingAndroid(autoRenewingAndroid), currentPlanId(currentPlanId), dataAndroid(dataAndroid), developerPayloadAndroid(developerPayloadAndroid), id(id), ids(ids), isAcknowledgedAndroid(isAcknowledgedAndroid), isAutoRenewing(isAutoRenewing), isSuspendedAndroid(isSuspendedAndroid), obfuscatedAccountIdAndroid(obfuscatedAccountIdAndroid), obfuscatedProfileIdAndroid(obfuscatedProfileIdAndroid), packageNameAndroid(packageNameAndroid), platform(platform), productId(productId), purchaseState(purchaseState), purchaseToken(purchaseToken), quantity(quantity), signatureAndroid(signatureAndroid), store(store), transactionDate(transactionDate), transactionId(transactionId) {}
67
72
  };
68
73
 
69
74
  } // namespace margelo::nitro::iap
@@ -84,6 +89,7 @@ namespace margelo::nitro {
84
89
  JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "ids")),
85
90
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isAcknowledgedAndroid")),
86
91
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isAutoRenewing")),
92
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isSuspendedAndroid")),
87
93
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "obfuscatedAccountIdAndroid")),
88
94
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "obfuscatedProfileIdAndroid")),
89
95
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "packageNameAndroid")),
@@ -93,6 +99,7 @@ namespace margelo::nitro {
93
99
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "purchaseToken")),
94
100
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "quantity")),
95
101
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "signatureAndroid")),
102
+ JSIConverter<margelo::nitro::iap::IapStore>::fromJSI(runtime, obj.getProperty(runtime, "store")),
96
103
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "transactionDate")),
97
104
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "transactionId"))
98
105
  );
@@ -107,6 +114,7 @@ namespace margelo::nitro {
107
114
  obj.setProperty(runtime, "ids", JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.ids));
108
115
  obj.setProperty(runtime, "isAcknowledgedAndroid", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isAcknowledgedAndroid));
109
116
  obj.setProperty(runtime, "isAutoRenewing", JSIConverter<bool>::toJSI(runtime, arg.isAutoRenewing));
117
+ obj.setProperty(runtime, "isSuspendedAndroid", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isSuspendedAndroid));
110
118
  obj.setProperty(runtime, "obfuscatedAccountIdAndroid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.obfuscatedAccountIdAndroid));
111
119
  obj.setProperty(runtime, "obfuscatedProfileIdAndroid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.obfuscatedProfileIdAndroid));
112
120
  obj.setProperty(runtime, "packageNameAndroid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.packageNameAndroid));
@@ -116,6 +124,7 @@ namespace margelo::nitro {
116
124
  obj.setProperty(runtime, "purchaseToken", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.purchaseToken));
117
125
  obj.setProperty(runtime, "quantity", JSIConverter<double>::toJSI(runtime, arg.quantity));
118
126
  obj.setProperty(runtime, "signatureAndroid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.signatureAndroid));
127
+ obj.setProperty(runtime, "store", JSIConverter<margelo::nitro::iap::IapStore>::toJSI(runtime, arg.store));
119
128
  obj.setProperty(runtime, "transactionDate", JSIConverter<double>::toJSI(runtime, arg.transactionDate));
120
129
  obj.setProperty(runtime, "transactionId", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.transactionId));
121
130
  return obj;
@@ -136,6 +145,7 @@ namespace margelo::nitro {
136
145
  if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, "ids"))) return false;
137
146
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isAcknowledgedAndroid"))) return false;
138
147
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isAutoRenewing"))) return false;
148
+ if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isSuspendedAndroid"))) return false;
139
149
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "obfuscatedAccountIdAndroid"))) return false;
140
150
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "obfuscatedProfileIdAndroid"))) return false;
141
151
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "packageNameAndroid"))) return false;
@@ -145,6 +155,7 @@ namespace margelo::nitro {
145
155
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "purchaseToken"))) return false;
146
156
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "quantity"))) return false;
147
157
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "signatureAndroid"))) return false;
158
+ if (!JSIConverter<margelo::nitro::iap::IapStore>::canConvert(runtime, obj.getProperty(runtime, "store"))) return false;
148
159
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "transactionDate"))) return false;
149
160
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "transactionId"))) return false;
150
161
  return true;
@@ -31,6 +31,8 @@ namespace margelo::nitro::iap { enum class IapPlatform; }
31
31
  namespace margelo::nitro::iap { enum class PurchaseState; }
32
32
  // Forward declaration of `RenewalInfoIOS` to properly resolve imports.
33
33
  namespace margelo::nitro::iap { struct RenewalInfoIOS; }
34
+ // Forward declaration of `IapStore` to properly resolve imports.
35
+ namespace margelo::nitro::iap { enum class IapStore; }
34
36
 
35
37
  #include <string>
36
38
  #include <optional>
@@ -39,6 +41,7 @@ namespace margelo::nitro::iap { struct RenewalInfoIOS; }
39
41
  #include "IapPlatform.hpp"
40
42
  #include "PurchaseState.hpp"
41
43
  #include "RenewalInfoIOS.hpp"
44
+ #include "IapStore.hpp"
42
45
 
43
46
  namespace margelo::nitro::iap {
44
47
 
@@ -74,6 +77,7 @@ namespace margelo::nitro::iap {
74
77
  std::optional<RenewalInfoIOS> renewalInfoIOS SWIFT_PRIVATE;
75
78
  std::optional<double> revocationDateIOS SWIFT_PRIVATE;
76
79
  std::optional<std::string> revocationReasonIOS SWIFT_PRIVATE;
80
+ IapStore store SWIFT_PRIVATE;
77
81
  std::optional<std::string> storefrontCountryCodeIOS SWIFT_PRIVATE;
78
82
  std::optional<std::string> subscriptionGroupIdIOS SWIFT_PRIVATE;
79
83
  double transactionDate SWIFT_PRIVATE;
@@ -83,7 +87,7 @@ namespace margelo::nitro::iap {
83
87
 
84
88
  public:
85
89
  PurchaseIOS() = default;
86
- explicit PurchaseIOS(std::optional<std::string> appAccountToken, std::optional<std::string> appBundleIdIOS, std::optional<std::string> countryCodeIOS, std::optional<std::string> currencyCodeIOS, std::optional<std::string> currencySymbolIOS, std::optional<std::string> currentPlanId, std::optional<std::string> environmentIOS, std::optional<double> expirationDateIOS, std::string id, std::optional<std::vector<std::string>> ids, bool isAutoRenewing, std::optional<bool> isUpgradedIOS, std::optional<PurchaseOfferIOS> offerIOS, std::optional<double> originalTransactionDateIOS, std::optional<std::string> originalTransactionIdentifierIOS, std::optional<std::string> ownershipTypeIOS, IapPlatform platform, std::string productId, PurchaseState purchaseState, std::optional<std::string> purchaseToken, double quantity, std::optional<double> quantityIOS, std::optional<std::string> reasonIOS, std::optional<std::string> reasonStringRepresentationIOS, std::optional<RenewalInfoIOS> renewalInfoIOS, std::optional<double> revocationDateIOS, std::optional<std::string> revocationReasonIOS, std::optional<std::string> storefrontCountryCodeIOS, std::optional<std::string> subscriptionGroupIdIOS, double transactionDate, std::string transactionId, std::optional<std::string> transactionReasonIOS, std::optional<std::string> webOrderLineItemIdIOS): appAccountToken(appAccountToken), appBundleIdIOS(appBundleIdIOS), countryCodeIOS(countryCodeIOS), currencyCodeIOS(currencyCodeIOS), currencySymbolIOS(currencySymbolIOS), currentPlanId(currentPlanId), environmentIOS(environmentIOS), expirationDateIOS(expirationDateIOS), id(id), ids(ids), isAutoRenewing(isAutoRenewing), isUpgradedIOS(isUpgradedIOS), offerIOS(offerIOS), originalTransactionDateIOS(originalTransactionDateIOS), originalTransactionIdentifierIOS(originalTransactionIdentifierIOS), ownershipTypeIOS(ownershipTypeIOS), platform(platform), productId(productId), purchaseState(purchaseState), purchaseToken(purchaseToken), quantity(quantity), quantityIOS(quantityIOS), reasonIOS(reasonIOS), reasonStringRepresentationIOS(reasonStringRepresentationIOS), renewalInfoIOS(renewalInfoIOS), revocationDateIOS(revocationDateIOS), revocationReasonIOS(revocationReasonIOS), storefrontCountryCodeIOS(storefrontCountryCodeIOS), subscriptionGroupIdIOS(subscriptionGroupIdIOS), transactionDate(transactionDate), transactionId(transactionId), transactionReasonIOS(transactionReasonIOS), webOrderLineItemIdIOS(webOrderLineItemIdIOS) {}
90
+ explicit PurchaseIOS(std::optional<std::string> appAccountToken, std::optional<std::string> appBundleIdIOS, std::optional<std::string> countryCodeIOS, std::optional<std::string> currencyCodeIOS, std::optional<std::string> currencySymbolIOS, std::optional<std::string> currentPlanId, std::optional<std::string> environmentIOS, std::optional<double> expirationDateIOS, std::string id, std::optional<std::vector<std::string>> ids, bool isAutoRenewing, std::optional<bool> isUpgradedIOS, std::optional<PurchaseOfferIOS> offerIOS, std::optional<double> originalTransactionDateIOS, std::optional<std::string> originalTransactionIdentifierIOS, std::optional<std::string> ownershipTypeIOS, IapPlatform platform, std::string productId, PurchaseState purchaseState, std::optional<std::string> purchaseToken, double quantity, std::optional<double> quantityIOS, std::optional<std::string> reasonIOS, std::optional<std::string> reasonStringRepresentationIOS, std::optional<RenewalInfoIOS> renewalInfoIOS, std::optional<double> revocationDateIOS, std::optional<std::string> revocationReasonIOS, IapStore store, std::optional<std::string> storefrontCountryCodeIOS, std::optional<std::string> subscriptionGroupIdIOS, double transactionDate, std::string transactionId, std::optional<std::string> transactionReasonIOS, std::optional<std::string> webOrderLineItemIdIOS): appAccountToken(appAccountToken), appBundleIdIOS(appBundleIdIOS), countryCodeIOS(countryCodeIOS), currencyCodeIOS(currencyCodeIOS), currencySymbolIOS(currencySymbolIOS), currentPlanId(currentPlanId), environmentIOS(environmentIOS), expirationDateIOS(expirationDateIOS), id(id), ids(ids), isAutoRenewing(isAutoRenewing), isUpgradedIOS(isUpgradedIOS), offerIOS(offerIOS), originalTransactionDateIOS(originalTransactionDateIOS), originalTransactionIdentifierIOS(originalTransactionIdentifierIOS), ownershipTypeIOS(ownershipTypeIOS), platform(platform), productId(productId), purchaseState(purchaseState), purchaseToken(purchaseToken), quantity(quantity), quantityIOS(quantityIOS), reasonIOS(reasonIOS), reasonStringRepresentationIOS(reasonStringRepresentationIOS), renewalInfoIOS(renewalInfoIOS), revocationDateIOS(revocationDateIOS), revocationReasonIOS(revocationReasonIOS), store(store), storefrontCountryCodeIOS(storefrontCountryCodeIOS), subscriptionGroupIdIOS(subscriptionGroupIdIOS), transactionDate(transactionDate), transactionId(transactionId), transactionReasonIOS(transactionReasonIOS), webOrderLineItemIdIOS(webOrderLineItemIdIOS) {}
87
91
  };
88
92
 
89
93
  } // namespace margelo::nitro::iap
@@ -123,6 +127,7 @@ namespace margelo::nitro {
123
127
  JSIConverter<std::optional<margelo::nitro::iap::RenewalInfoIOS>>::fromJSI(runtime, obj.getProperty(runtime, "renewalInfoIOS")),
124
128
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "revocationDateIOS")),
125
129
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "revocationReasonIOS")),
130
+ JSIConverter<margelo::nitro::iap::IapStore>::fromJSI(runtime, obj.getProperty(runtime, "store")),
126
131
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "storefrontCountryCodeIOS")),
127
132
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "subscriptionGroupIdIOS")),
128
133
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "transactionDate")),
@@ -160,6 +165,7 @@ namespace margelo::nitro {
160
165
  obj.setProperty(runtime, "renewalInfoIOS", JSIConverter<std::optional<margelo::nitro::iap::RenewalInfoIOS>>::toJSI(runtime, arg.renewalInfoIOS));
161
166
  obj.setProperty(runtime, "revocationDateIOS", JSIConverter<std::optional<double>>::toJSI(runtime, arg.revocationDateIOS));
162
167
  obj.setProperty(runtime, "revocationReasonIOS", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.revocationReasonIOS));
168
+ obj.setProperty(runtime, "store", JSIConverter<margelo::nitro::iap::IapStore>::toJSI(runtime, arg.store));
163
169
  obj.setProperty(runtime, "storefrontCountryCodeIOS", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.storefrontCountryCodeIOS));
164
170
  obj.setProperty(runtime, "subscriptionGroupIdIOS", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.subscriptionGroupIdIOS));
165
171
  obj.setProperty(runtime, "transactionDate", JSIConverter<double>::toJSI(runtime, arg.transactionDate));
@@ -203,6 +209,7 @@ namespace margelo::nitro {
203
209
  if (!JSIConverter<std::optional<margelo::nitro::iap::RenewalInfoIOS>>::canConvert(runtime, obj.getProperty(runtime, "renewalInfoIOS"))) return false;
204
210
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "revocationDateIOS"))) return false;
205
211
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "revocationReasonIOS"))) return false;
212
+ if (!JSIConverter<margelo::nitro::iap::IapStore>::canConvert(runtime, obj.getProperty(runtime, "store"))) return false;
206
213
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "storefrontCountryCodeIOS"))) return false;
207
214
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "subscriptionGroupIdIOS"))) return false;
208
215
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "transactionDate"))) return false;
@@ -1,5 +1,5 @@
1
1
  {
2
- "apple": "1.2.42",
3
- "google": "1.3.8",
4
- "gql": "1.2.7"
2
+ "apple": "1.3.0",
3
+ "google": "1.3.11",
4
+ "gql": "1.3.1"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-iap",
3
- "version": "14.4.47",
3
+ "version": "14.5.1-rc.1",
4
4
  "description": "React Native In-App Purchases module for iOS and Android using Nitro",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -0,0 +1,3 @@
1
+ import type { ConfigPlugin } from 'expo/config-plugins';
2
+ declare const _default: ConfigPlugin<void>;
3
+ export default _default;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_plugins_1 = require("expo/config-plugins");
4
+ const pkg = require('../../package.json');
5
+ // Global flag to prevent duplicate logs
6
+ let hasLoggedPluginExecution = false;
7
+ const addLineToGradle = (content, anchor, lineToAdd, offset = 1) => {
8
+ const lines = content.split('\n');
9
+ const index = lines.findIndex((line) => line.match(anchor));
10
+ if (index === -1) {
11
+ console.warn(`Anchor "${anchor}" not found in build.gradle. Appending to end.`);
12
+ lines.push(lineToAdd);
13
+ }
14
+ else {
15
+ lines.splice(index + offset, 0, lineToAdd);
16
+ }
17
+ return lines.join('\n');
18
+ };
19
+ const modifyAppBuildGradle = (gradle) => {
20
+ let modified = gradle;
21
+ // Add billing library dependencies to app-level build.gradle
22
+ const billingDep = ` implementation "com.android.billingclient:billing-ktx:8.0.0"`;
23
+ const gmsDep = ` implementation "com.google.android.gms:play-services-base:18.1.0"`;
24
+ let hasAddedDependency = false;
25
+ if (!modified.includes(billingDep)) {
26
+ modified = addLineToGradle(modified, /dependencies\s*{/, billingDep);
27
+ hasAddedDependency = true;
28
+ }
29
+ if (!modified.includes(gmsDep)) {
30
+ modified = addLineToGradle(modified, /dependencies\s*{/, gmsDep, 1);
31
+ hasAddedDependency = true;
32
+ }
33
+ // Log only once and only if we actually added dependencies
34
+ if (hasAddedDependency && !hasLoggedPluginExecution) {
35
+ console.log('🛠️ react-native-iap: Added billing dependencies to build.gradle');
36
+ }
37
+ return modified;
38
+ };
39
+ const withIapAndroid = (config) => {
40
+ // Add IAP dependencies to app build.gradle
41
+ config = (0, config_plugins_1.withAppBuildGradle)(config, (config) => {
42
+ config.modResults.contents = modifyAppBuildGradle(config.modResults.contents);
43
+ return config;
44
+ });
45
+ config = (0, config_plugins_1.withAndroidManifest)(config, (config) => {
46
+ const manifest = config.modResults;
47
+ if (!manifest.manifest['uses-permission']) {
48
+ manifest.manifest['uses-permission'] = [];
49
+ }
50
+ const permissions = manifest.manifest['uses-permission'];
51
+ const billingPerm = { $: { 'android:name': 'com.android.vending.BILLING' } };
52
+ const alreadyExists = permissions.some((p) => p.$['android:name'] === 'com.android.vending.BILLING');
53
+ if (!alreadyExists) {
54
+ permissions.push(billingPerm);
55
+ if (!hasLoggedPluginExecution) {
56
+ console.log('✅ Added com.android.vending.BILLING to AndroidManifest.xml');
57
+ }
58
+ }
59
+ else {
60
+ if (!hasLoggedPluginExecution) {
61
+ console.log('ℹ️ com.android.vending.BILLING already exists in AndroidManifest.xml');
62
+ }
63
+ }
64
+ return config;
65
+ });
66
+ return config;
67
+ };
68
+ const withIAP = (config, _props) => {
69
+ try {
70
+ const result = withIapAndroid(config);
71
+ // Set flag after first execution to prevent duplicate logs
72
+ hasLoggedPluginExecution = true;
73
+ return result;
74
+ }
75
+ catch (error) {
76
+ config_plugins_1.WarningAggregator.addWarningAndroid('react-native-iap', `react-native-iap plugin encountered an error: ${error}`);
77
+ console.error('react-native-iap plugin error:', error);
78
+ return config;
79
+ }
80
+ };
81
+ exports.default = (0, config_plugins_1.createRunOncePlugin)(withIAP, pkg.name, pkg.version);
@@ -0,0 +1 @@
1
+ {"root":["../src/withiap.ts"],"version":"5.9.2"}
@@ -1 +1 @@
1
- {"root":["./src/withIAP.ts"],"version":"5.9.2"}
1
+ {"root":["./src/withiap.ts"],"version":"5.9.2"}
package/src/index.ts CHANGED
@@ -1461,11 +1461,14 @@ export const verifyPurchaseWithProvider: MutationField<
1461
1461
  }
1462
1462
  return {
1463
1463
  provider: result.provider,
1464
- iapkit: result.iapkit.map((item) => ({
1465
- isValid: item.isValid,
1466
- state: item.state,
1467
- store: item.store,
1468
- })),
1464
+ iapkit: result.iapkit
1465
+ ? {
1466
+ isValid: result.iapkit.isValid,
1467
+ state: result.iapkit.state,
1468
+ store: result.iapkit.store,
1469
+ }
1470
+ : null,
1471
+ errors: result.errors ?? null,
1469
1472
  };
1470
1473
  } catch (error) {
1471
1474
  RnIapConsole.error('[verifyPurchaseWithProvider] Failed:', error);
@@ -38,7 +38,8 @@ export type IapkitPurchaseState =
38
38
  | 'unknown'
39
39
  | 'inauthentic';
40
40
 
41
- export type IapkitStore = 'apple' | 'google';
41
+ // IapStore enum for purchase store identification
42
+ export type IapStore = 'unknown' | 'apple' | 'google' | 'horizon';
42
43
 
43
44
  // Note: Nitro requires at least 2 values for union types
44
45
  export type PurchaseVerificationProvider = 'iapkit' | 'none';
@@ -85,8 +86,14 @@ export interface NitroRequestPurchaseAndroid {
85
86
  }
86
87
 
87
88
  export interface NitroPurchaseRequest {
89
+ /** @deprecated Use apple instead */
88
90
  ios?: NitroRequestPurchaseIos | null;
91
+ /** @deprecated Use google instead */
89
92
  android?: NitroRequestPurchaseAndroid | null;
93
+ /** Apple-specific purchase parameters */
94
+ apple?: NitroRequestPurchaseIos | null;
95
+ /** Google-specific purchase parameters */
96
+ google?: NitroRequestPurchaseAndroid | null;
90
97
  }
91
98
 
92
99
  // Available purchases parameters
@@ -230,21 +237,85 @@ export interface NitroVerifyPurchaseWithProviderProps {
230
237
  export interface NitroVerifyPurchaseWithIapkitResult {
231
238
  isValid: boolean;
232
239
  state: IapkitPurchaseState;
233
- store: IapkitStore;
240
+ store: IapStore;
241
+ }
242
+
243
+ export interface NitroVerifyPurchaseWithProviderError {
244
+ code?: string | null;
245
+ message: string;
234
246
  }
235
247
 
236
248
  export interface NitroVerifyPurchaseWithProviderResult {
237
- iapkit: NitroVerifyPurchaseWithIapkitResult[];
249
+ iapkit?: NitroVerifyPurchaseWithIapkitResult | null;
250
+ errors?: NitroVerifyPurchaseWithProviderError[] | null;
238
251
  provider: PurchaseVerificationProvider;
239
252
  }
240
253
 
254
+ /**
255
+ * Discount amount details for one-time purchase offers (Android)
256
+ */
257
+ export interface NitroDiscountAmountAndroid {
258
+ discountAmountMicros: string;
259
+ formattedDiscountAmount: string;
260
+ }
261
+
262
+ /**
263
+ * Discount display information for one-time purchase offers (Android)
264
+ */
265
+ export interface NitroDiscountDisplayInfoAndroid {
266
+ discountAmount?: NitroDiscountAmountAndroid | null;
267
+ percentageDiscount?: number | null;
268
+ }
269
+
270
+ /**
271
+ * Limited quantity information for one-time purchase offers (Android)
272
+ */
273
+ export interface NitroLimitedQuantityInfoAndroid {
274
+ maximumQuantity: number;
275
+ remainingQuantity: number;
276
+ }
277
+
278
+ /**
279
+ * Pre-order details for one-time purchase products (Android)
280
+ */
281
+ export interface NitroPreorderDetailsAndroid {
282
+ preorderPresaleEndTimeMillis: string;
283
+ preorderReleaseTimeMillis: string;
284
+ }
285
+
286
+ /**
287
+ * Rental details for one-time purchase products (Android)
288
+ */
289
+ export interface NitroRentalDetailsAndroid {
290
+ rentalExpirationPeriod?: string | null;
291
+ rentalPeriod: string;
292
+ }
293
+
294
+ /**
295
+ * Valid time window for when an offer is available (Android)
296
+ */
297
+ export interface NitroValidTimeWindowAndroid {
298
+ endTimeMillis: string;
299
+ startTimeMillis: string;
300
+ }
301
+
241
302
  /**
242
303
  * Android one-time purchase offer details
304
+ * Available in Google Play Billing Library 7.0+
243
305
  */
244
306
  export interface NitroOneTimePurchaseOfferDetail {
307
+ discountDisplayInfo?: NitroDiscountDisplayInfoAndroid | null;
245
308
  formattedPrice: string;
309
+ fullPriceMicros?: string | null;
310
+ limitedQuantityInfo?: NitroLimitedQuantityInfoAndroid | null;
311
+ offerId?: string | null;
312
+ offerTags: string[];
313
+ offerToken: string;
314
+ preorderDetailsAndroid?: NitroPreorderDetailsAndroid | null;
246
315
  priceAmountMicros: string;
247
316
  priceCurrencyCode: string;
317
+ rentalDetailsAndroid?: NitroRentalDetailsAndroid | null;
318
+ validTimeWindow?: NitroValidTimeWindowAndroid | null;
248
319
  }
249
320
 
250
321
  export interface NitroPurchase {
@@ -252,7 +323,10 @@ export interface NitroPurchase {
252
323
  productId: PurchaseCommon['productId'];
253
324
  transactionDate: PurchaseCommon['transactionDate'];
254
325
  purchaseToken?: PurchaseCommon['purchaseToken'];
326
+ /** @deprecated Use store instead */
255
327
  platform: IapPlatform;
328
+ /** Store where purchase was made */
329
+ store: IapStore;
256
330
  quantity: PurchaseCommon['quantity'];
257
331
  purchaseState: PurchaseCommon['purchaseState'];
258
332
  isAutoRenewing: PurchaseCommon['isAutoRenewing'];
@@ -290,6 +364,7 @@ export interface NitroPurchase {
290
364
  obfuscatedAccountIdAndroid?: string | null;
291
365
  obfuscatedProfileIdAndroid?: string | null;
292
366
  developerPayloadAndroid?: string | null;
367
+ isSuspendedAndroid?: boolean | null;
293
368
  }
294
369
 
295
370
  /**
@@ -364,7 +439,7 @@ export interface NitroProduct {
364
439
  subscriptionPeriodAndroid?: string | null;
365
440
  freeTrialPeriodAndroid?: string | null;
366
441
  subscriptionOfferDetailsAndroid?: string | null;
367
- oneTimePurchaseOfferDetailsAndroid?: NitroOneTimePurchaseOfferDetail | null;
442
+ oneTimePurchaseOfferDetailsAndroid?: NitroOneTimePurchaseOfferDetail[] | null;
368
443
  }
369
444
 
370
445
  // ╔══════════════════════════════════════════════════════════════════════════╗