react-native-iap 14.0.1 → 14.1.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 (55) hide show
  1. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +81 -22
  2. package/app.plugin.js +1 -1
  3. package/ios/HybridRnIap.swift +167 -11
  4. package/ios/ProductStore.swift +10 -0
  5. package/ios/reactnativeiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  6. package/ios/reactnativeiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  7. package/lib/module/helpers/subscription.js +9 -1
  8. package/lib/module/helpers/subscription.js.map +1 -1
  9. package/lib/module/hooks/useIAP.js +9 -13
  10. package/lib/module/hooks/useIAP.js.map +1 -1
  11. package/lib/module/index.js +43 -28
  12. package/lib/module/index.js.map +1 -1
  13. package/lib/module/types.js +24 -16
  14. package/lib/module/types.js.map +1 -1
  15. package/lib/module/utils/error.js.map +1 -1
  16. package/lib/module/utils/type-bridge.js +64 -13
  17. package/lib/module/utils/type-bridge.js.map +1 -1
  18. package/lib/typescript/src/helpers/subscription.d.ts.map +1 -1
  19. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  20. package/lib/typescript/src/index.d.ts +12 -22
  21. package/lib/typescript/src/index.d.ts.map +1 -1
  22. package/lib/typescript/src/specs/RnIap.nitro.d.ts +15 -11
  23. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  24. package/lib/typescript/src/types.d.ts +58 -58
  25. package/lib/typescript/src/types.d.ts.map +1 -1
  26. package/lib/typescript/src/utils/error.d.ts.map +1 -1
  27. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  28. package/nitro.json +5 -1
  29. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +13 -4
  30. package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +1 -1
  31. package/nitrogen/generated/android/c++/JNitroProduct.hpp +40 -36
  32. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +12 -0
  33. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +1 -1
  34. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +12 -9
  35. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +9 -0
  36. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +1 -1
  37. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -1
  38. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +13 -7
  39. package/nitrogen/generated/ios/swift/NitroProduct.swift +73 -43
  40. package/nitrogen/generated/ios/swift/NitroPurchase.swift +35 -2
  41. package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +1 -1
  42. package/nitrogen/generated/shared/c++/NitroProduct.hpp +41 -37
  43. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +13 -1
  44. package/package.json +9 -2
  45. package/plugin/build/src/withIAP.d.ts +3 -0
  46. package/plugin/build/src/withIAP.js +81 -0
  47. package/plugin/build/tsconfig.tsbuildinfo +1 -0
  48. package/plugin/tsconfig.tsbuildinfo +1 -1
  49. package/src/helpers/subscription.ts +36 -25
  50. package/src/hooks/useIAP.ts +188 -201
  51. package/src/index.ts +377 -356
  52. package/src/specs/RnIap.nitro.ts +15 -11
  53. package/src/types.ts +66 -62
  54. package/src/utils/error.ts +19 -19
  55. package/src/utils/type-bridge.ts +138 -75
@@ -50,10 +50,12 @@ namespace margelo::nitro::iap {
50
50
  jni::local_ref<jni::JDouble> price = this->getFieldValue(fieldPrice);
51
51
  static const auto fieldPlatform = clazz->getField<jni::JString>("platform");
52
52
  jni::local_ref<jni::JString> platform = this->getFieldValue(fieldPlatform);
53
- static const auto fieldIsFamilyShareable = clazz->getField<jni::JBoolean>("isFamilyShareable");
54
- jni::local_ref<jni::JBoolean> isFamilyShareable = this->getFieldValue(fieldIsFamilyShareable);
55
- static const auto fieldJsonRepresentation = clazz->getField<jni::JString>("jsonRepresentation");
56
- jni::local_ref<jni::JString> jsonRepresentation = this->getFieldValue(fieldJsonRepresentation);
53
+ static const auto fieldTypeIOS = clazz->getField<jni::JString>("typeIOS");
54
+ jni::local_ref<jni::JString> typeIOS = this->getFieldValue(fieldTypeIOS);
55
+ static const auto fieldIsFamilyShareableIOS = clazz->getField<jni::JBoolean>("isFamilyShareableIOS");
56
+ jni::local_ref<jni::JBoolean> isFamilyShareableIOS = this->getFieldValue(fieldIsFamilyShareableIOS);
57
+ static const auto fieldJsonRepresentationIOS = clazz->getField<jni::JString>("jsonRepresentationIOS");
58
+ jni::local_ref<jni::JString> jsonRepresentationIOS = this->getFieldValue(fieldJsonRepresentationIOS);
57
59
  static const auto fieldSubscriptionPeriodUnitIOS = clazz->getField<jni::JString>("subscriptionPeriodUnitIOS");
58
60
  jni::local_ref<jni::JString> subscriptionPeriodUnitIOS = this->getFieldValue(fieldSubscriptionPeriodUnitIOS);
59
61
  static const auto fieldSubscriptionPeriodNumberIOS = clazz->getField<jni::JDouble>("subscriptionPeriodNumberIOS");
@@ -68,20 +70,20 @@ namespace margelo::nitro::iap {
68
70
  jni::local_ref<jni::JDouble> introductoryPriceNumberOfPeriodsIOS = this->getFieldValue(fieldIntroductoryPriceNumberOfPeriodsIOS);
69
71
  static const auto fieldIntroductoryPriceSubscriptionPeriodIOS = clazz->getField<jni::JString>("introductoryPriceSubscriptionPeriodIOS");
70
72
  jni::local_ref<jni::JString> introductoryPriceSubscriptionPeriodIOS = this->getFieldValue(fieldIntroductoryPriceSubscriptionPeriodIOS);
71
- static const auto fieldOriginalPrice = clazz->getField<jni::JString>("originalPrice");
72
- jni::local_ref<jni::JString> originalPrice = this->getFieldValue(fieldOriginalPrice);
73
- static const auto fieldOriginalPriceAmountMicros = clazz->getField<jni::JDouble>("originalPriceAmountMicros");
74
- jni::local_ref<jni::JDouble> originalPriceAmountMicros = this->getFieldValue(fieldOriginalPriceAmountMicros);
75
- static const auto fieldIntroductoryPriceValue = clazz->getField<jni::JDouble>("introductoryPriceValue");
76
- jni::local_ref<jni::JDouble> introductoryPriceValue = this->getFieldValue(fieldIntroductoryPriceValue);
77
- static const auto fieldIntroductoryPriceCycles = clazz->getField<jni::JDouble>("introductoryPriceCycles");
78
- jni::local_ref<jni::JDouble> introductoryPriceCycles = this->getFieldValue(fieldIntroductoryPriceCycles);
79
- static const auto fieldIntroductoryPricePeriod = clazz->getField<jni::JString>("introductoryPricePeriod");
80
- jni::local_ref<jni::JString> introductoryPricePeriod = this->getFieldValue(fieldIntroductoryPricePeriod);
81
- static const auto fieldSubscriptionPeriod = clazz->getField<jni::JString>("subscriptionPeriod");
82
- jni::local_ref<jni::JString> subscriptionPeriod = this->getFieldValue(fieldSubscriptionPeriod);
83
- static const auto fieldFreeTrialPeriod = clazz->getField<jni::JString>("freeTrialPeriod");
84
- jni::local_ref<jni::JString> freeTrialPeriod = this->getFieldValue(fieldFreeTrialPeriod);
73
+ static const auto fieldOriginalPriceAndroid = clazz->getField<jni::JString>("originalPriceAndroid");
74
+ jni::local_ref<jni::JString> originalPriceAndroid = this->getFieldValue(fieldOriginalPriceAndroid);
75
+ static const auto fieldOriginalPriceAmountMicrosAndroid = clazz->getField<jni::JDouble>("originalPriceAmountMicrosAndroid");
76
+ jni::local_ref<jni::JDouble> originalPriceAmountMicrosAndroid = this->getFieldValue(fieldOriginalPriceAmountMicrosAndroid);
77
+ static const auto fieldIntroductoryPriceValueAndroid = clazz->getField<jni::JDouble>("introductoryPriceValueAndroid");
78
+ jni::local_ref<jni::JDouble> introductoryPriceValueAndroid = this->getFieldValue(fieldIntroductoryPriceValueAndroid);
79
+ static const auto fieldIntroductoryPriceCyclesAndroid = clazz->getField<jni::JDouble>("introductoryPriceCyclesAndroid");
80
+ jni::local_ref<jni::JDouble> introductoryPriceCyclesAndroid = this->getFieldValue(fieldIntroductoryPriceCyclesAndroid);
81
+ static const auto fieldIntroductoryPricePeriodAndroid = clazz->getField<jni::JString>("introductoryPricePeriodAndroid");
82
+ jni::local_ref<jni::JString> introductoryPricePeriodAndroid = this->getFieldValue(fieldIntroductoryPricePeriodAndroid);
83
+ static const auto fieldSubscriptionPeriodAndroid = clazz->getField<jni::JString>("subscriptionPeriodAndroid");
84
+ jni::local_ref<jni::JString> subscriptionPeriodAndroid = this->getFieldValue(fieldSubscriptionPeriodAndroid);
85
+ static const auto fieldFreeTrialPeriodAndroid = clazz->getField<jni::JString>("freeTrialPeriodAndroid");
86
+ jni::local_ref<jni::JString> freeTrialPeriodAndroid = this->getFieldValue(fieldFreeTrialPeriodAndroid);
85
87
  static const auto fieldSubscriptionOfferDetailsAndroid = clazz->getField<jni::JString>("subscriptionOfferDetailsAndroid");
86
88
  jni::local_ref<jni::JString> subscriptionOfferDetailsAndroid = this->getFieldValue(fieldSubscriptionOfferDetailsAndroid);
87
89
  return NitroProduct(
@@ -94,8 +96,9 @@ namespace margelo::nitro::iap {
94
96
  currency != nullptr ? std::make_optional(currency->toStdString()) : std::nullopt,
95
97
  price != nullptr ? std::make_optional(price->value()) : std::nullopt,
96
98
  platform->toStdString(),
97
- isFamilyShareable != nullptr ? std::make_optional(static_cast<bool>(isFamilyShareable->value())) : std::nullopt,
98
- jsonRepresentation != nullptr ? std::make_optional(jsonRepresentation->toStdString()) : std::nullopt,
99
+ typeIOS != nullptr ? std::make_optional(typeIOS->toStdString()) : std::nullopt,
100
+ isFamilyShareableIOS != nullptr ? std::make_optional(static_cast<bool>(isFamilyShareableIOS->value())) : std::nullopt,
101
+ jsonRepresentationIOS != nullptr ? std::make_optional(jsonRepresentationIOS->toStdString()) : std::nullopt,
99
102
  subscriptionPeriodUnitIOS != nullptr ? std::make_optional(subscriptionPeriodUnitIOS->toStdString()) : std::nullopt,
100
103
  subscriptionPeriodNumberIOS != nullptr ? std::make_optional(subscriptionPeriodNumberIOS->value()) : std::nullopt,
101
104
  introductoryPriceIOS != nullptr ? std::make_optional(introductoryPriceIOS->toStdString()) : std::nullopt,
@@ -103,13 +106,13 @@ namespace margelo::nitro::iap {
103
106
  introductoryPricePaymentModeIOS != nullptr ? std::make_optional(introductoryPricePaymentModeIOS->toStdString()) : std::nullopt,
104
107
  introductoryPriceNumberOfPeriodsIOS != nullptr ? std::make_optional(introductoryPriceNumberOfPeriodsIOS->value()) : std::nullopt,
105
108
  introductoryPriceSubscriptionPeriodIOS != nullptr ? std::make_optional(introductoryPriceSubscriptionPeriodIOS->toStdString()) : std::nullopt,
106
- originalPrice != nullptr ? std::make_optional(originalPrice->toStdString()) : std::nullopt,
107
- originalPriceAmountMicros != nullptr ? std::make_optional(originalPriceAmountMicros->value()) : std::nullopt,
108
- introductoryPriceValue != nullptr ? std::make_optional(introductoryPriceValue->value()) : std::nullopt,
109
- introductoryPriceCycles != nullptr ? std::make_optional(introductoryPriceCycles->value()) : std::nullopt,
110
- introductoryPricePeriod != nullptr ? std::make_optional(introductoryPricePeriod->toStdString()) : std::nullopt,
111
- subscriptionPeriod != nullptr ? std::make_optional(subscriptionPeriod->toStdString()) : std::nullopt,
112
- freeTrialPeriod != nullptr ? std::make_optional(freeTrialPeriod->toStdString()) : std::nullopt,
109
+ originalPriceAndroid != nullptr ? std::make_optional(originalPriceAndroid->toStdString()) : std::nullopt,
110
+ originalPriceAmountMicrosAndroid != nullptr ? std::make_optional(originalPriceAmountMicrosAndroid->value()) : std::nullopt,
111
+ introductoryPriceValueAndroid != nullptr ? std::make_optional(introductoryPriceValueAndroid->value()) : std::nullopt,
112
+ introductoryPriceCyclesAndroid != nullptr ? std::make_optional(introductoryPriceCyclesAndroid->value()) : std::nullopt,
113
+ introductoryPricePeriodAndroid != nullptr ? std::make_optional(introductoryPricePeriodAndroid->toStdString()) : std::nullopt,
114
+ subscriptionPeriodAndroid != nullptr ? std::make_optional(subscriptionPeriodAndroid->toStdString()) : std::nullopt,
115
+ freeTrialPeriodAndroid != nullptr ? std::make_optional(freeTrialPeriodAndroid->toStdString()) : std::nullopt,
113
116
  subscriptionOfferDetailsAndroid != nullptr ? std::make_optional(subscriptionOfferDetailsAndroid->toStdString()) : std::nullopt
114
117
  );
115
118
  }
@@ -130,8 +133,9 @@ namespace margelo::nitro::iap {
130
133
  value.currency.has_value() ? jni::make_jstring(value.currency.value()) : nullptr,
131
134
  value.price.has_value() ? jni::JDouble::valueOf(value.price.value()) : nullptr,
132
135
  jni::make_jstring(value.platform),
133
- value.isFamilyShareable.has_value() ? jni::JBoolean::valueOf(value.isFamilyShareable.value()) : nullptr,
134
- value.jsonRepresentation.has_value() ? jni::make_jstring(value.jsonRepresentation.value()) : nullptr,
136
+ value.typeIOS.has_value() ? jni::make_jstring(value.typeIOS.value()) : nullptr,
137
+ value.isFamilyShareableIOS.has_value() ? jni::JBoolean::valueOf(value.isFamilyShareableIOS.value()) : nullptr,
138
+ value.jsonRepresentationIOS.has_value() ? jni::make_jstring(value.jsonRepresentationIOS.value()) : nullptr,
135
139
  value.subscriptionPeriodUnitIOS.has_value() ? jni::make_jstring(value.subscriptionPeriodUnitIOS.value()) : nullptr,
136
140
  value.subscriptionPeriodNumberIOS.has_value() ? jni::JDouble::valueOf(value.subscriptionPeriodNumberIOS.value()) : nullptr,
137
141
  value.introductoryPriceIOS.has_value() ? jni::make_jstring(value.introductoryPriceIOS.value()) : nullptr,
@@ -139,13 +143,13 @@ namespace margelo::nitro::iap {
139
143
  value.introductoryPricePaymentModeIOS.has_value() ? jni::make_jstring(value.introductoryPricePaymentModeIOS.value()) : nullptr,
140
144
  value.introductoryPriceNumberOfPeriodsIOS.has_value() ? jni::JDouble::valueOf(value.introductoryPriceNumberOfPeriodsIOS.value()) : nullptr,
141
145
  value.introductoryPriceSubscriptionPeriodIOS.has_value() ? jni::make_jstring(value.introductoryPriceSubscriptionPeriodIOS.value()) : nullptr,
142
- value.originalPrice.has_value() ? jni::make_jstring(value.originalPrice.value()) : nullptr,
143
- value.originalPriceAmountMicros.has_value() ? jni::JDouble::valueOf(value.originalPriceAmountMicros.value()) : nullptr,
144
- value.introductoryPriceValue.has_value() ? jni::JDouble::valueOf(value.introductoryPriceValue.value()) : nullptr,
145
- value.introductoryPriceCycles.has_value() ? jni::JDouble::valueOf(value.introductoryPriceCycles.value()) : nullptr,
146
- value.introductoryPricePeriod.has_value() ? jni::make_jstring(value.introductoryPricePeriod.value()) : nullptr,
147
- value.subscriptionPeriod.has_value() ? jni::make_jstring(value.subscriptionPeriod.value()) : nullptr,
148
- value.freeTrialPeriod.has_value() ? jni::make_jstring(value.freeTrialPeriod.value()) : nullptr,
146
+ value.originalPriceAndroid.has_value() ? jni::make_jstring(value.originalPriceAndroid.value()) : nullptr,
147
+ value.originalPriceAmountMicrosAndroid.has_value() ? jni::JDouble::valueOf(value.originalPriceAmountMicrosAndroid.value()) : nullptr,
148
+ value.introductoryPriceValueAndroid.has_value() ? jni::JDouble::valueOf(value.introductoryPriceValueAndroid.value()) : nullptr,
149
+ value.introductoryPriceCyclesAndroid.has_value() ? jni::JDouble::valueOf(value.introductoryPriceCyclesAndroid.value()) : nullptr,
150
+ value.introductoryPricePeriodAndroid.has_value() ? jni::make_jstring(value.introductoryPricePeriodAndroid.value()) : nullptr,
151
+ value.subscriptionPeriodAndroid.has_value() ? jni::make_jstring(value.subscriptionPeriodAndroid.value()) : nullptr,
152
+ value.freeTrialPeriodAndroid.has_value() ? jni::make_jstring(value.freeTrialPeriodAndroid.value()) : nullptr,
149
153
  value.subscriptionOfferDetailsAndroid.has_value() ? jni::make_jstring(value.subscriptionOfferDetailsAndroid.value()) : nullptr
150
154
  );
151
155
  }
@@ -42,6 +42,12 @@ namespace margelo::nitro::iap {
42
42
  jni::local_ref<jni::JString> purchaseToken = this->getFieldValue(fieldPurchaseToken);
43
43
  static const auto fieldPlatform = clazz->getField<jni::JString>("platform");
44
44
  jni::local_ref<jni::JString> platform = this->getFieldValue(fieldPlatform);
45
+ static const auto fieldQuantity = clazz->getField<double>("quantity");
46
+ double quantity = this->getFieldValue(fieldQuantity);
47
+ static const auto fieldPurchaseState = clazz->getField<jni::JString>("purchaseState");
48
+ jni::local_ref<jni::JString> purchaseState = this->getFieldValue(fieldPurchaseState);
49
+ static const auto fieldIsAutoRenewing = clazz->getField<jboolean>("isAutoRenewing");
50
+ jboolean isAutoRenewing = this->getFieldValue(fieldIsAutoRenewing);
45
51
  static const auto fieldQuantityIOS = clazz->getField<jni::JDouble>("quantityIOS");
46
52
  jni::local_ref<jni::JDouble> quantityIOS = this->getFieldValue(fieldQuantityIOS);
47
53
  static const auto fieldOriginalTransactionDateIOS = clazz->getField<jni::JDouble>("originalTransactionDateIOS");
@@ -74,6 +80,9 @@ namespace margelo::nitro::iap {
74
80
  transactionDate,
75
81
  purchaseToken != nullptr ? std::make_optional(purchaseToken->toStdString()) : std::nullopt,
76
82
  platform->toStdString(),
83
+ quantity,
84
+ purchaseState->toStdString(),
85
+ static_cast<bool>(isAutoRenewing),
77
86
  quantityIOS != nullptr ? std::make_optional(quantityIOS->value()) : std::nullopt,
78
87
  originalTransactionDateIOS != nullptr ? std::make_optional(originalTransactionDateIOS->value()) : std::nullopt,
79
88
  originalTransactionIdentifierIOS != nullptr ? std::make_optional(originalTransactionIdentifierIOS->toStdString()) : std::nullopt,
@@ -102,6 +111,9 @@ namespace margelo::nitro::iap {
102
111
  value.transactionDate,
103
112
  value.purchaseToken.has_value() ? jni::make_jstring(value.purchaseToken.value()) : nullptr,
104
113
  jni::make_jstring(value.platform),
114
+ value.quantity,
115
+ jni::make_jstring(value.purchaseState),
116
+ value.isAutoRenewing,
105
117
  value.quantityIOS.has_value() ? jni::JDouble::valueOf(value.quantityIOS.value()) : nullptr,
106
118
  value.originalTransactionDateIOS.has_value() ? jni::JDouble::valueOf(value.originalTransactionDateIOS.value()) : nullptr,
107
119
  value.originalTransactionIdentifierIOS.has_value() ? jni::make_jstring(value.originalTransactionIdentifierIOS.value()) : nullptr,
@@ -168,7 +168,7 @@ abstract class HybridRnIapSpec: HybridObject() {
168
168
 
169
169
  @DoNotStrip
170
170
  @Keep
171
- abstract fun showManageSubscriptionsIOS(): Promise<Boolean>
171
+ abstract fun showManageSubscriptionsIOS(): Promise<Array<NitroPurchase>>
172
172
 
173
173
  @DoNotStrip
174
174
  @Keep
@@ -50,10 +50,13 @@ data class NitroProduct
50
50
  val platform: String,
51
51
  @DoNotStrip
52
52
  @Keep
53
- val isFamilyShareable: Boolean?,
53
+ val typeIOS: String?,
54
54
  @DoNotStrip
55
55
  @Keep
56
- val jsonRepresentation: String?,
56
+ val isFamilyShareableIOS: Boolean?,
57
+ @DoNotStrip
58
+ @Keep
59
+ val jsonRepresentationIOS: String?,
57
60
  @DoNotStrip
58
61
  @Keep
59
62
  val subscriptionPeriodUnitIOS: String?,
@@ -77,25 +80,25 @@ data class NitroProduct
77
80
  val introductoryPriceSubscriptionPeriodIOS: String?,
78
81
  @DoNotStrip
79
82
  @Keep
80
- val originalPrice: String?,
83
+ val originalPriceAndroid: String?,
81
84
  @DoNotStrip
82
85
  @Keep
83
- val originalPriceAmountMicros: Double?,
86
+ val originalPriceAmountMicrosAndroid: Double?,
84
87
  @DoNotStrip
85
88
  @Keep
86
- val introductoryPriceValue: Double?,
89
+ val introductoryPriceValueAndroid: Double?,
87
90
  @DoNotStrip
88
91
  @Keep
89
- val introductoryPriceCycles: Double?,
92
+ val introductoryPriceCyclesAndroid: Double?,
90
93
  @DoNotStrip
91
94
  @Keep
92
- val introductoryPricePeriod: String?,
95
+ val introductoryPricePeriodAndroid: String?,
93
96
  @DoNotStrip
94
97
  @Keep
95
- val subscriptionPeriod: String?,
98
+ val subscriptionPeriodAndroid: String?,
96
99
  @DoNotStrip
97
100
  @Keep
98
- val freeTrialPeriod: String?,
101
+ val freeTrialPeriodAndroid: String?,
99
102
  @DoNotStrip
100
103
  @Keep
101
104
  val subscriptionOfferDetailsAndroid: String?
@@ -38,6 +38,15 @@ data class NitroPurchase
38
38
  val platform: String,
39
39
  @DoNotStrip
40
40
  @Keep
41
+ val quantity: Double,
42
+ @DoNotStrip
43
+ @Keep
44
+ val purchaseState: String,
45
+ @DoNotStrip
46
+ @Keep
47
+ val isAutoRenewing: Boolean,
48
+ @DoNotStrip
49
+ @Keep
41
50
  val quantityIOS: Double?,
42
51
  @DoNotStrip
43
52
  @Keep
@@ -299,7 +299,7 @@ namespace margelo::nitro::iap {
299
299
  auto __value = std::move(__result.value());
300
300
  return __value;
301
301
  }
302
- inline std::shared_ptr<Promise<bool>> showManageSubscriptionsIOS() override {
302
+ inline std::shared_ptr<Promise<std::vector<NitroPurchase>>> showManageSubscriptionsIOS() override {
303
303
  auto __result = _swiftPart.showManageSubscriptionsIOS();
304
304
  if (__result.hasError()) [[unlikely]] {
305
305
  std::rethrow_exception(__result.error());
@@ -38,7 +38,7 @@ public protocol HybridRnIapSpec_protocol: HybridObject {
38
38
  func latestTransactionIOS(sku: String) throws -> Promise<NitroPurchase?>
39
39
  func getPendingTransactionsIOS() throws -> Promise<[NitroPurchase]>
40
40
  func syncIOS() throws -> Promise<Bool>
41
- func showManageSubscriptionsIOS() throws -> Promise<Bool>
41
+ func showManageSubscriptionsIOS() throws -> Promise<[NitroPurchase]>
42
42
  func isEligibleForIntroOfferIOS(groupID: String) throws -> Promise<Bool>
43
43
  func getReceiptDataIOS() throws -> Promise<String>
44
44
  func isTransactionVerifiedIOS(sku: String) throws -> Promise<Bool>
@@ -622,21 +622,27 @@ open class HybridRnIapSpec_cxx {
622
622
  }
623
623
 
624
624
  @inline(__always)
625
- public final func showManageSubscriptionsIOS() -> bridge.Result_std__shared_ptr_Promise_bool___ {
625
+ public final func showManageSubscriptionsIOS() -> bridge.Result_std__shared_ptr_Promise_std__vector_NitroPurchase____ {
626
626
  do {
627
627
  let __result = try self.__implementation.showManageSubscriptionsIOS()
628
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
629
- let __promise = bridge.create_std__shared_ptr_Promise_bool__()
630
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
628
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_NitroPurchase___ in
629
+ let __promise = bridge.create_std__shared_ptr_Promise_std__vector_NitroPurchase___()
630
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_NitroPurchase___(__promise)
631
631
  __result
632
- .then({ __result in __promiseHolder.resolve(__result) })
632
+ .then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_NitroPurchase_ in
633
+ var __vector = bridge.create_std__vector_NitroPurchase_(__result.count)
634
+ for __item in __result {
635
+ __vector.push_back(__item)
636
+ }
637
+ return __vector
638
+ }()) })
633
639
  .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
634
640
  return __promise
635
641
  }()
636
- return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
642
+ return bridge.create_Result_std__shared_ptr_Promise_std__vector_NitroPurchase____(__resultCpp)
637
643
  } catch (let __error) {
638
644
  let __exceptionPtr = __error.toCpp()
639
- return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
645
+ return bridge.create_Result_std__shared_ptr_Promise_std__vector_NitroPurchase____(__exceptionPtr)
640
646
  }
641
647
  }
642
648
 
@@ -18,7 +18,7 @@ public extension NitroProduct {
18
18
  /**
19
19
  * Create a new instance of `NitroProduct`.
20
20
  */
21
- init(id: String, title: String, description: String, type: String, displayName: String?, displayPrice: String?, currency: String?, price: Double?, platform: String, isFamilyShareable: Bool?, jsonRepresentation: String?, subscriptionPeriodUnitIOS: String?, subscriptionPeriodNumberIOS: Double?, introductoryPriceIOS: String?, introductoryPriceAsAmountIOS: Double?, introductoryPricePaymentModeIOS: String?, introductoryPriceNumberOfPeriodsIOS: Double?, introductoryPriceSubscriptionPeriodIOS: String?, originalPrice: String?, originalPriceAmountMicros: Double?, introductoryPriceValue: Double?, introductoryPriceCycles: Double?, introductoryPricePeriod: String?, subscriptionPeriod: String?, freeTrialPeriod: String?, subscriptionOfferDetailsAndroid: String?) {
21
+ init(id: String, title: String, description: String, type: String, displayName: String?, displayPrice: String?, currency: String?, price: Double?, platform: String, typeIOS: String?, isFamilyShareableIOS: Bool?, jsonRepresentationIOS: String?, subscriptionPeriodUnitIOS: String?, subscriptionPeriodNumberIOS: Double?, introductoryPriceIOS: String?, introductoryPriceAsAmountIOS: Double?, introductoryPricePaymentModeIOS: String?, introductoryPriceNumberOfPeriodsIOS: Double?, introductoryPriceSubscriptionPeriodIOS: String?, originalPriceAndroid: String?, originalPriceAmountMicrosAndroid: Double?, introductoryPriceValueAndroid: Double?, introductoryPriceCyclesAndroid: Double?, introductoryPricePeriodAndroid: String?, subscriptionPeriodAndroid: String?, freeTrialPeriodAndroid: String?, subscriptionOfferDetailsAndroid: String?) {
22
22
  self.init(std.string(id), std.string(title), std.string(description), std.string(type), { () -> bridge.std__optional_std__string_ in
23
23
  if let __unwrappedValue = displayName {
24
24
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
@@ -43,14 +43,20 @@ public extension NitroProduct {
43
43
  } else {
44
44
  return .init()
45
45
  }
46
- }(), std.string(platform), { () -> bridge.std__optional_bool_ in
47
- if let __unwrappedValue = isFamilyShareable {
46
+ }(), std.string(platform), { () -> bridge.std__optional_std__string_ in
47
+ if let __unwrappedValue = typeIOS {
48
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
49
+ } else {
50
+ return .init()
51
+ }
52
+ }(), { () -> bridge.std__optional_bool_ in
53
+ if let __unwrappedValue = isFamilyShareableIOS {
48
54
  return bridge.create_std__optional_bool_(__unwrappedValue)
49
55
  } else {
50
56
  return .init()
51
57
  }
52
58
  }(), { () -> bridge.std__optional_std__string_ in
53
- if let __unwrappedValue = jsonRepresentation {
59
+ if let __unwrappedValue = jsonRepresentationIOS {
54
60
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
55
61
  } else {
56
62
  return .init()
@@ -98,43 +104,43 @@ public extension NitroProduct {
98
104
  return .init()
99
105
  }
100
106
  }(), { () -> bridge.std__optional_std__string_ in
101
- if let __unwrappedValue = originalPrice {
107
+ if let __unwrappedValue = originalPriceAndroid {
102
108
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
103
109
  } else {
104
110
  return .init()
105
111
  }
106
112
  }(), { () -> bridge.std__optional_double_ in
107
- if let __unwrappedValue = originalPriceAmountMicros {
113
+ if let __unwrappedValue = originalPriceAmountMicrosAndroid {
108
114
  return bridge.create_std__optional_double_(__unwrappedValue)
109
115
  } else {
110
116
  return .init()
111
117
  }
112
118
  }(), { () -> bridge.std__optional_double_ in
113
- if let __unwrappedValue = introductoryPriceValue {
119
+ if let __unwrappedValue = introductoryPriceValueAndroid {
114
120
  return bridge.create_std__optional_double_(__unwrappedValue)
115
121
  } else {
116
122
  return .init()
117
123
  }
118
124
  }(), { () -> bridge.std__optional_double_ in
119
- if let __unwrappedValue = introductoryPriceCycles {
125
+ if let __unwrappedValue = introductoryPriceCyclesAndroid {
120
126
  return bridge.create_std__optional_double_(__unwrappedValue)
121
127
  } else {
122
128
  return .init()
123
129
  }
124
130
  }(), { () -> bridge.std__optional_std__string_ in
125
- if let __unwrappedValue = introductoryPricePeriod {
131
+ if let __unwrappedValue = introductoryPricePeriodAndroid {
126
132
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
127
133
  } else {
128
134
  return .init()
129
135
  }
130
136
  }(), { () -> bridge.std__optional_std__string_ in
131
- if let __unwrappedValue = subscriptionPeriod {
137
+ if let __unwrappedValue = subscriptionPeriodAndroid {
132
138
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
133
139
  } else {
134
140
  return .init()
135
141
  }
136
142
  }(), { () -> bridge.std__optional_std__string_ in
137
- if let __unwrappedValue = freeTrialPeriod {
143
+ if let __unwrappedValue = freeTrialPeriodAndroid {
138
144
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
139
145
  } else {
140
146
  return .init()
@@ -292,14 +298,38 @@ public extension NitroProduct {
292
298
  }
293
299
  }
294
300
 
295
- var isFamilyShareable: Bool? {
301
+ var typeIOS: String? {
302
+ @inline(__always)
303
+ get {
304
+ return { () -> String? in
305
+ if bridge.has_value_std__optional_std__string_(self.__typeIOS) {
306
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__typeIOS)
307
+ return String(__unwrapped)
308
+ } else {
309
+ return nil
310
+ }
311
+ }()
312
+ }
313
+ @inline(__always)
314
+ set {
315
+ self.__typeIOS = { () -> bridge.std__optional_std__string_ in
316
+ if let __unwrappedValue = newValue {
317
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
318
+ } else {
319
+ return .init()
320
+ }
321
+ }()
322
+ }
323
+ }
324
+
325
+ var isFamilyShareableIOS: Bool? {
296
326
  @inline(__always)
297
327
  get {
298
- return self.__isFamilyShareable.value
328
+ return self.__isFamilyShareableIOS.value
299
329
  }
300
330
  @inline(__always)
301
331
  set {
302
- self.__isFamilyShareable = { () -> bridge.std__optional_bool_ in
332
+ self.__isFamilyShareableIOS = { () -> bridge.std__optional_bool_ in
303
333
  if let __unwrappedValue = newValue {
304
334
  return bridge.create_std__optional_bool_(__unwrappedValue)
305
335
  } else {
@@ -309,12 +339,12 @@ public extension NitroProduct {
309
339
  }
310
340
  }
311
341
 
312
- var jsonRepresentation: String? {
342
+ var jsonRepresentationIOS: String? {
313
343
  @inline(__always)
314
344
  get {
315
345
  return { () -> String? in
316
- if bridge.has_value_std__optional_std__string_(self.__jsonRepresentation) {
317
- let __unwrapped = bridge.get_std__optional_std__string_(self.__jsonRepresentation)
346
+ if bridge.has_value_std__optional_std__string_(self.__jsonRepresentationIOS) {
347
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__jsonRepresentationIOS)
318
348
  return String(__unwrapped)
319
349
  } else {
320
350
  return nil
@@ -323,7 +353,7 @@ public extension NitroProduct {
323
353
  }
324
354
  @inline(__always)
325
355
  set {
326
- self.__jsonRepresentation = { () -> bridge.std__optional_std__string_ in
356
+ self.__jsonRepresentationIOS = { () -> bridge.std__optional_std__string_ in
327
357
  if let __unwrappedValue = newValue {
328
358
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
329
359
  } else {
@@ -480,12 +510,12 @@ public extension NitroProduct {
480
510
  }
481
511
  }
482
512
 
483
- var originalPrice: String? {
513
+ var originalPriceAndroid: String? {
484
514
  @inline(__always)
485
515
  get {
486
516
  return { () -> String? in
487
- if bridge.has_value_std__optional_std__string_(self.__originalPrice) {
488
- let __unwrapped = bridge.get_std__optional_std__string_(self.__originalPrice)
517
+ if bridge.has_value_std__optional_std__string_(self.__originalPriceAndroid) {
518
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__originalPriceAndroid)
489
519
  return String(__unwrapped)
490
520
  } else {
491
521
  return nil
@@ -494,7 +524,7 @@ public extension NitroProduct {
494
524
  }
495
525
  @inline(__always)
496
526
  set {
497
- self.__originalPrice = { () -> bridge.std__optional_std__string_ in
527
+ self.__originalPriceAndroid = { () -> bridge.std__optional_std__string_ in
498
528
  if let __unwrappedValue = newValue {
499
529
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
500
530
  } else {
@@ -504,14 +534,14 @@ public extension NitroProduct {
504
534
  }
505
535
  }
506
536
 
507
- var originalPriceAmountMicros: Double? {
537
+ var originalPriceAmountMicrosAndroid: Double? {
508
538
  @inline(__always)
509
539
  get {
510
- return self.__originalPriceAmountMicros.value
540
+ return self.__originalPriceAmountMicrosAndroid.value
511
541
  }
512
542
  @inline(__always)
513
543
  set {
514
- self.__originalPriceAmountMicros = { () -> bridge.std__optional_double_ in
544
+ self.__originalPriceAmountMicrosAndroid = { () -> bridge.std__optional_double_ in
515
545
  if let __unwrappedValue = newValue {
516
546
  return bridge.create_std__optional_double_(__unwrappedValue)
517
547
  } else {
@@ -521,14 +551,14 @@ public extension NitroProduct {
521
551
  }
522
552
  }
523
553
 
524
- var introductoryPriceValue: Double? {
554
+ var introductoryPriceValueAndroid: Double? {
525
555
  @inline(__always)
526
556
  get {
527
- return self.__introductoryPriceValue.value
557
+ return self.__introductoryPriceValueAndroid.value
528
558
  }
529
559
  @inline(__always)
530
560
  set {
531
- self.__introductoryPriceValue = { () -> bridge.std__optional_double_ in
561
+ self.__introductoryPriceValueAndroid = { () -> bridge.std__optional_double_ in
532
562
  if let __unwrappedValue = newValue {
533
563
  return bridge.create_std__optional_double_(__unwrappedValue)
534
564
  } else {
@@ -538,14 +568,14 @@ public extension NitroProduct {
538
568
  }
539
569
  }
540
570
 
541
- var introductoryPriceCycles: Double? {
571
+ var introductoryPriceCyclesAndroid: Double? {
542
572
  @inline(__always)
543
573
  get {
544
- return self.__introductoryPriceCycles.value
574
+ return self.__introductoryPriceCyclesAndroid.value
545
575
  }
546
576
  @inline(__always)
547
577
  set {
548
- self.__introductoryPriceCycles = { () -> bridge.std__optional_double_ in
578
+ self.__introductoryPriceCyclesAndroid = { () -> bridge.std__optional_double_ in
549
579
  if let __unwrappedValue = newValue {
550
580
  return bridge.create_std__optional_double_(__unwrappedValue)
551
581
  } else {
@@ -555,12 +585,12 @@ public extension NitroProduct {
555
585
  }
556
586
  }
557
587
 
558
- var introductoryPricePeriod: String? {
588
+ var introductoryPricePeriodAndroid: String? {
559
589
  @inline(__always)
560
590
  get {
561
591
  return { () -> String? in
562
- if bridge.has_value_std__optional_std__string_(self.__introductoryPricePeriod) {
563
- let __unwrapped = bridge.get_std__optional_std__string_(self.__introductoryPricePeriod)
592
+ if bridge.has_value_std__optional_std__string_(self.__introductoryPricePeriodAndroid) {
593
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__introductoryPricePeriodAndroid)
564
594
  return String(__unwrapped)
565
595
  } else {
566
596
  return nil
@@ -569,7 +599,7 @@ public extension NitroProduct {
569
599
  }
570
600
  @inline(__always)
571
601
  set {
572
- self.__introductoryPricePeriod = { () -> bridge.std__optional_std__string_ in
602
+ self.__introductoryPricePeriodAndroid = { () -> bridge.std__optional_std__string_ in
573
603
  if let __unwrappedValue = newValue {
574
604
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
575
605
  } else {
@@ -579,12 +609,12 @@ public extension NitroProduct {
579
609
  }
580
610
  }
581
611
 
582
- var subscriptionPeriod: String? {
612
+ var subscriptionPeriodAndroid: String? {
583
613
  @inline(__always)
584
614
  get {
585
615
  return { () -> String? in
586
- if bridge.has_value_std__optional_std__string_(self.__subscriptionPeriod) {
587
- let __unwrapped = bridge.get_std__optional_std__string_(self.__subscriptionPeriod)
616
+ if bridge.has_value_std__optional_std__string_(self.__subscriptionPeriodAndroid) {
617
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__subscriptionPeriodAndroid)
588
618
  return String(__unwrapped)
589
619
  } else {
590
620
  return nil
@@ -593,7 +623,7 @@ public extension NitroProduct {
593
623
  }
594
624
  @inline(__always)
595
625
  set {
596
- self.__subscriptionPeriod = { () -> bridge.std__optional_std__string_ in
626
+ self.__subscriptionPeriodAndroid = { () -> bridge.std__optional_std__string_ in
597
627
  if let __unwrappedValue = newValue {
598
628
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
599
629
  } else {
@@ -603,12 +633,12 @@ public extension NitroProduct {
603
633
  }
604
634
  }
605
635
 
606
- var freeTrialPeriod: String? {
636
+ var freeTrialPeriodAndroid: String? {
607
637
  @inline(__always)
608
638
  get {
609
639
  return { () -> String? in
610
- if bridge.has_value_std__optional_std__string_(self.__freeTrialPeriod) {
611
- let __unwrapped = bridge.get_std__optional_std__string_(self.__freeTrialPeriod)
640
+ if bridge.has_value_std__optional_std__string_(self.__freeTrialPeriodAndroid) {
641
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__freeTrialPeriodAndroid)
612
642
  return String(__unwrapped)
613
643
  } else {
614
644
  return nil
@@ -617,7 +647,7 @@ public extension NitroProduct {
617
647
  }
618
648
  @inline(__always)
619
649
  set {
620
- self.__freeTrialPeriod = { () -> bridge.std__optional_std__string_ in
650
+ self.__freeTrialPeriodAndroid = { () -> bridge.std__optional_std__string_ in
621
651
  if let __unwrappedValue = newValue {
622
652
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
623
653
  } else {
@@ -18,14 +18,14 @@ public extension NitroPurchase {
18
18
  /**
19
19
  * Create a new instance of `NitroPurchase`.
20
20
  */
21
- init(id: String, productId: String, transactionDate: Double, purchaseToken: String?, platform: String, quantityIOS: Double?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, appAccountToken: String?, purchaseTokenAndroid: String?, dataAndroid: String?, signatureAndroid: String?, autoRenewingAndroid: Bool?, purchaseStateAndroid: Double?, isAcknowledgedAndroid: Bool?, packageNameAndroid: String?, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?) {
21
+ init(id: String, productId: String, transactionDate: Double, purchaseToken: String?, platform: String, quantity: Double, purchaseState: String, isAutoRenewing: Bool, quantityIOS: Double?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, appAccountToken: String?, purchaseTokenAndroid: String?, dataAndroid: String?, signatureAndroid: String?, autoRenewingAndroid: Bool?, purchaseStateAndroid: Double?, isAcknowledgedAndroid: Bool?, packageNameAndroid: String?, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?) {
22
22
  self.init(std.string(id), std.string(productId), transactionDate, { () -> bridge.std__optional_std__string_ in
23
23
  if let __unwrappedValue = purchaseToken {
24
24
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
25
25
  } else {
26
26
  return .init()
27
27
  }
28
- }(), std.string(platform), { () -> bridge.std__optional_double_ in
28
+ }(), std.string(platform), quantity, std.string(purchaseState), isAutoRenewing, { () -> bridge.std__optional_double_ in
29
29
  if let __unwrappedValue = quantityIOS {
30
30
  return bridge.create_std__optional_double_(__unwrappedValue)
31
31
  } else {
@@ -174,6 +174,39 @@ public extension NitroPurchase {
174
174
  }
175
175
  }
176
176
 
177
+ var quantity: Double {
178
+ @inline(__always)
179
+ get {
180
+ return self.__quantity
181
+ }
182
+ @inline(__always)
183
+ set {
184
+ self.__quantity = newValue
185
+ }
186
+ }
187
+
188
+ var purchaseState: String {
189
+ @inline(__always)
190
+ get {
191
+ return String(self.__purchaseState)
192
+ }
193
+ @inline(__always)
194
+ set {
195
+ self.__purchaseState = std.string(newValue)
196
+ }
197
+ }
198
+
199
+ var isAutoRenewing: Bool {
200
+ @inline(__always)
201
+ get {
202
+ return self.__isAutoRenewing
203
+ }
204
+ @inline(__always)
205
+ set {
206
+ self.__isAutoRenewing = newValue
207
+ }
208
+ }
209
+
177
210
  var quantityIOS: Double? {
178
211
  @inline(__always)
179
212
  get {