react-native-iap 14.4.26 → 14.4.28

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 (152) hide show
  1. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +1 -1
  2. package/ios/RnIapHelper.swift +7 -1
  3. package/lib/module/index.js +3 -0
  4. package/lib/module/index.js.map +1 -1
  5. package/lib/module/utils/type-bridge.js +2 -1
  6. package/lib/module/utils/type-bridge.js.map +1 -1
  7. package/lib/typescript/src/index.d.ts.map +1 -1
  8. package/lib/typescript/src/specs/RnIap.nitro.d.ts +52 -8
  9. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  10. package/lib/typescript/src/types.d.ts +1 -1
  11. package/lib/typescript/src/types.d.ts.map +1 -1
  12. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  13. package/nitrogen/generated/android/c++/JAndroidSubscriptionOfferInput.hpp +5 -1
  14. package/nitrogen/generated/android/c++/JExternalPurchaseLinkResultIOS.hpp +5 -1
  15. package/nitrogen/generated/android/c++/JExternalPurchaseNoticeResultIOS.hpp +5 -1
  16. package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +2 -0
  17. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +4 -0
  18. package/nitrogen/generated/android/c++/JInitConnectionConfig.hpp +5 -1
  19. package/nitrogen/generated/android/c++/JNitroActiveSubscription.hpp +5 -1
  20. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidOptions.hpp +5 -1
  21. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesIosOptions.hpp +5 -1
  22. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesOptions.hpp +5 -1
  23. package/nitrogen/generated/android/c++/JNitroDeepLinkOptionsAndroid.hpp +5 -1
  24. package/nitrogen/generated/android/c++/JNitroFinishTransactionAndroidParams.hpp +5 -1
  25. package/nitrogen/generated/android/c++/JNitroFinishTransactionIosParams.hpp +5 -1
  26. package/nitrogen/generated/android/c++/JNitroFinishTransactionParams.hpp +5 -1
  27. package/nitrogen/generated/android/c++/JNitroOneTimePurchaseOfferDetail.hpp +5 -1
  28. package/nitrogen/generated/android/c++/JNitroProduct.hpp +11 -5
  29. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +5 -1
  30. package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +5 -1
  31. package/nitrogen/generated/android/c++/JNitroPurchaseResult.hpp +5 -1
  32. package/nitrogen/generated/android/c++/JNitroReceiptValidationAndroidOptions.hpp +5 -1
  33. package/nitrogen/generated/android/c++/JNitroReceiptValidationParams.hpp +5 -1
  34. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultAndroid.hpp +5 -1
  35. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +5 -1
  36. package/nitrogen/generated/android/c++/JNitroRenewalInfoIOS.hpp +5 -1
  37. package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +5 -1
  38. package/nitrogen/generated/android/c++/JNitroRequestPurchaseIos.hpp +5 -1
  39. package/nitrogen/generated/android/c++/JNitroSubscriptionRenewalInfo.hpp +5 -1
  40. package/nitrogen/generated/android/c++/JNitroSubscriptionStatus.hpp +5 -1
  41. package/nitrogen/generated/android/c++/JPaymentModeIOS.hpp +65 -0
  42. package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +5 -1
  43. package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +5 -1
  44. package/nitrogen/generated/android/c++/JPurchaseOfferIOS.hpp +5 -1
  45. package/nitrogen/generated/android/c++/JRenewalInfoIOS.hpp +5 -1
  46. package/nitrogen/generated/android/c++/JUserChoiceBillingDetails.hpp +5 -1
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/AndroidSubscriptionOfferInput.kt +16 -9
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseLinkResultIOS.kt +16 -9
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseNoticeResultIOS.kt +16 -9
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroProduct.kt +0 -1
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchase.kt +0 -1
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchaseResult.kt +0 -1
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_UserChoiceBillingDetails.kt +0 -1
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +3 -2
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/InitConnectionConfig.kt +13 -6
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroActiveSubscription.kt +52 -45
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidOptions.kt +13 -6
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesIosOptions.kt +22 -15
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesOptions.kt +16 -9
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroDeepLinkOptionsAndroid.kt +16 -9
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionAndroidParams.kt +16 -9
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionIosParams.kt +13 -6
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionParams.kt +16 -9
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroOneTimePurchaseOfferDetail.kt +19 -12
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +102 -95
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +132 -125
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +16 -9
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseResult.kt +25 -18
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationAndroidOptions.kt +22 -15
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationParams.kt +16 -9
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultAndroid.kt +66 -59
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultIOS.kt +22 -15
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRenewalInfoIOS.kt +43 -36
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +31 -24
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseIos.kt +25 -18
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionRenewalInfo.kt +28 -21
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionStatus.kt +19 -12
  78. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PaymentModeIOS.kt +23 -0
  79. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Purchase.kt +18 -1
  80. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +69 -62
  81. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +111 -104
  82. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseOfferIOS.kt +19 -12
  83. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RenewalInfoIOS.kt +43 -36
  84. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RequestPurchaseResult.kt +23 -1
  85. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/UserChoiceBillingDetails.kt +16 -9
  86. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_Boolean_NitroPurchaseResult.kt +18 -1
  87. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.kt +18 -1
  88. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +22 -22
  89. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +26 -22
  90. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +3 -0
  91. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +7 -4
  92. package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroProduct_.swift +1 -8
  93. package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroPurchase_.swift +1 -8
  94. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -0
  95. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +3 -16
  96. package/nitrogen/generated/ios/swift/NitroActiveSubscription.swift +17 -10
  97. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesIosOptions.swift +32 -4
  98. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesOptions.swift +2 -16
  99. package/nitrogen/generated/ios/swift/NitroFinishTransactionAndroidParams.swift +8 -1
  100. package/nitrogen/generated/ios/swift/NitroFinishTransactionParams.swift +2 -16
  101. package/nitrogen/generated/ios/swift/NitroProduct.swift +14 -33
  102. package/nitrogen/generated/ios/swift/NitroPurchase.swift +25 -11
  103. package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +2 -16
  104. package/nitrogen/generated/ios/swift/NitroReceiptValidationAndroidOptions.swift +8 -1
  105. package/nitrogen/generated/ios/swift/NitroReceiptValidationParams.swift +1 -8
  106. package/nitrogen/generated/ios/swift/NitroReceiptValidationResultIOS.swift +1 -8
  107. package/nitrogen/generated/ios/swift/NitroRenewalInfoIOS.swift +8 -1
  108. package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +8 -1
  109. package/nitrogen/generated/ios/swift/NitroRequestPurchaseIos.swift +8 -1
  110. package/nitrogen/generated/ios/swift/NitroSubscriptionStatus.swift +1 -8
  111. package/nitrogen/generated/ios/swift/PaymentModeIOS.swift +48 -0
  112. package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +16 -2
  113. package/nitrogen/generated/ios/swift/PurchaseIOS.swift +10 -17
  114. package/nitrogen/generated/ios/swift/RenewalInfoIOS.swift +8 -1
  115. package/nitrogen/generated/shared/c++/AndroidSubscriptionOfferInput.hpp +8 -0
  116. package/nitrogen/generated/shared/c++/ExternalPurchaseLinkResultIOS.hpp +8 -0
  117. package/nitrogen/generated/shared/c++/ExternalPurchaseNoticeResultIOS.hpp +8 -0
  118. package/nitrogen/generated/shared/c++/InitConnectionConfig.hpp +8 -0
  119. package/nitrogen/generated/shared/c++/NitroActiveSubscription.hpp +8 -0
  120. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidOptions.hpp +8 -0
  121. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesIosOptions.hpp +8 -0
  122. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesOptions.hpp +8 -0
  123. package/nitrogen/generated/shared/c++/NitroDeepLinkOptionsAndroid.hpp +8 -0
  124. package/nitrogen/generated/shared/c++/NitroFinishTransactionAndroidParams.hpp +8 -0
  125. package/nitrogen/generated/shared/c++/NitroFinishTransactionIosParams.hpp +8 -0
  126. package/nitrogen/generated/shared/c++/NitroFinishTransactionParams.hpp +8 -0
  127. package/nitrogen/generated/shared/c++/NitroOneTimePurchaseOfferDetail.hpp +8 -0
  128. package/nitrogen/generated/shared/c++/NitroProduct.hpp +16 -5
  129. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +8 -0
  130. package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +8 -0
  131. package/nitrogen/generated/shared/c++/NitroPurchaseResult.hpp +8 -0
  132. package/nitrogen/generated/shared/c++/NitroReceiptValidationAndroidOptions.hpp +8 -0
  133. package/nitrogen/generated/shared/c++/NitroReceiptValidationParams.hpp +8 -0
  134. package/nitrogen/generated/shared/c++/NitroReceiptValidationResultAndroid.hpp +8 -0
  135. package/nitrogen/generated/shared/c++/NitroReceiptValidationResultIOS.hpp +8 -0
  136. package/nitrogen/generated/shared/c++/NitroRenewalInfoIOS.hpp +8 -0
  137. package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +8 -0
  138. package/nitrogen/generated/shared/c++/NitroRequestPurchaseIos.hpp +8 -0
  139. package/nitrogen/generated/shared/c++/NitroSubscriptionRenewalInfo.hpp +8 -0
  140. package/nitrogen/generated/shared/c++/NitroSubscriptionStatus.hpp +8 -0
  141. package/nitrogen/generated/shared/c++/PaymentModeIOS.hpp +84 -0
  142. package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +8 -0
  143. package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +8 -0
  144. package/nitrogen/generated/shared/c++/PurchaseOfferIOS.hpp +8 -0
  145. package/nitrogen/generated/shared/c++/RenewalInfoIOS.hpp +8 -0
  146. package/nitrogen/generated/shared/c++/UserChoiceBillingDetails.hpp +8 -0
  147. package/openiap-versions.json +2 -2
  148. package/package.json +4 -4
  149. package/src/index.ts +18 -0
  150. package/src/specs/RnIap.nitro.ts +52 -7
  151. package/src/types.ts +1 -1
  152. package/src/utils/type-bridge.ts +2 -1
@@ -9,7 +9,6 @@ package com.margelo.nitro.iap
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
13
12
 
14
13
 
15
14
  /**
@@ -17,16 +16,24 @@ import com.margelo.nitro.core.*
17
16
  */
18
17
  @DoNotStrip
19
18
  @Keep
20
- data class NitroFinishTransactionAndroidParams
19
+ data class NitroFinishTransactionAndroidParams(
21
20
  @DoNotStrip
22
21
  @Keep
23
- constructor(
24
- @DoNotStrip
25
- @Keep
26
- val purchaseToken: String,
22
+ val purchaseToken: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val isConsumable: Boolean?
26
+ ) {
27
+ private companion object {
28
+ /**
29
+ * Constructor called from C++
30
+ */
27
31
  @DoNotStrip
28
32
  @Keep
29
- val isConsumable: Boolean?
30
- ) {
31
- /* main constructor */
33
+ @Suppress("unused")
34
+ @JvmStatic
35
+ private fun fromCpp(purchaseToken: String, isConsumable: Boolean?): NitroFinishTransactionAndroidParams {
36
+ return NitroFinishTransactionAndroidParams(purchaseToken, isConsumable)
37
+ }
38
+ }
32
39
  }
@@ -9,7 +9,6 @@ package com.margelo.nitro.iap
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
13
12
 
14
13
 
15
14
  /**
@@ -17,13 +16,21 @@ import com.margelo.nitro.core.*
17
16
  */
18
17
  @DoNotStrip
19
18
  @Keep
20
- data class NitroFinishTransactionIosParams
19
+ data class NitroFinishTransactionIosParams(
21
20
  @DoNotStrip
22
21
  @Keep
23
- constructor(
22
+ val transactionId: String
23
+ ) {
24
+ private companion object {
25
+ /**
26
+ * Constructor called from C++
27
+ */
24
28
  @DoNotStrip
25
29
  @Keep
26
- val transactionId: String
27
- ) {
28
- /* main constructor */
30
+ @Suppress("unused")
31
+ @JvmStatic
32
+ private fun fromCpp(transactionId: String): NitroFinishTransactionIosParams {
33
+ return NitroFinishTransactionIosParams(transactionId)
34
+ }
35
+ }
29
36
  }
@@ -9,7 +9,6 @@ package com.margelo.nitro.iap
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
13
12
 
14
13
 
15
14
  /**
@@ -17,16 +16,24 @@ import com.margelo.nitro.core.*
17
16
  */
18
17
  @DoNotStrip
19
18
  @Keep
20
- data class NitroFinishTransactionParams
19
+ data class NitroFinishTransactionParams(
21
20
  @DoNotStrip
22
21
  @Keep
23
- constructor(
24
- @DoNotStrip
25
- @Keep
26
- val ios: NitroFinishTransactionIosParams?,
22
+ val ios: NitroFinishTransactionIosParams?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val android: NitroFinishTransactionAndroidParams?
26
+ ) {
27
+ private companion object {
28
+ /**
29
+ * Constructor called from C++
30
+ */
27
31
  @DoNotStrip
28
32
  @Keep
29
- val android: NitroFinishTransactionAndroidParams?
30
- ) {
31
- /* main constructor */
33
+ @Suppress("unused")
34
+ @JvmStatic
35
+ private fun fromCpp(ios: NitroFinishTransactionIosParams?, android: NitroFinishTransactionAndroidParams?): NitroFinishTransactionParams {
36
+ return NitroFinishTransactionParams(ios, android)
37
+ }
38
+ }
32
39
  }
@@ -9,7 +9,6 @@ package com.margelo.nitro.iap
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
13
12
 
14
13
 
15
14
  /**
@@ -17,19 +16,27 @@ import com.margelo.nitro.core.*
17
16
  */
18
17
  @DoNotStrip
19
18
  @Keep
20
- data class NitroOneTimePurchaseOfferDetail
19
+ data class NitroOneTimePurchaseOfferDetail(
21
20
  @DoNotStrip
22
21
  @Keep
23
- constructor(
24
- @DoNotStrip
25
- @Keep
26
- val formattedPrice: String,
27
- @DoNotStrip
28
- @Keep
29
- val priceAmountMicros: String,
22
+ val formattedPrice: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val priceAmountMicros: String,
26
+ @DoNotStrip
27
+ @Keep
28
+ val priceCurrencyCode: String
29
+ ) {
30
+ private companion object {
31
+ /**
32
+ * Constructor called from C++
33
+ */
30
34
  @DoNotStrip
31
35
  @Keep
32
- val priceCurrencyCode: String
33
- ) {
34
- /* main constructor */
36
+ @Suppress("unused")
37
+ @JvmStatic
38
+ private fun fromCpp(formattedPrice: String, priceAmountMicros: String, priceCurrencyCode: String): NitroOneTimePurchaseOfferDetail {
39
+ return NitroOneTimePurchaseOfferDetail(formattedPrice, priceAmountMicros, priceCurrencyCode)
40
+ }
41
+ }
35
42
  }
@@ -9,7 +9,6 @@ package com.margelo.nitro.iap
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
13
12
 
14
13
 
15
14
  /**
@@ -17,100 +16,108 @@ import com.margelo.nitro.core.*
17
16
  */
18
17
  @DoNotStrip
19
18
  @Keep
20
- data class NitroProduct
19
+ data class NitroProduct(
21
20
  @DoNotStrip
22
21
  @Keep
23
- constructor(
24
- @DoNotStrip
25
- @Keep
26
- val id: String,
27
- @DoNotStrip
28
- @Keep
29
- val title: String,
30
- @DoNotStrip
31
- @Keep
32
- val description: String,
33
- @DoNotStrip
34
- @Keep
35
- val type: String,
36
- @DoNotStrip
37
- @Keep
38
- val displayName: String?,
39
- @DoNotStrip
40
- @Keep
41
- val displayPrice: String?,
42
- @DoNotStrip
43
- @Keep
44
- val currency: String?,
45
- @DoNotStrip
46
- @Keep
47
- val price: Double?,
48
- @DoNotStrip
49
- @Keep
50
- val platform: IapPlatform,
51
- @DoNotStrip
52
- @Keep
53
- val typeIOS: String?,
54
- @DoNotStrip
55
- @Keep
56
- val isFamilyShareableIOS: Boolean?,
57
- @DoNotStrip
58
- @Keep
59
- val jsonRepresentationIOS: String?,
60
- @DoNotStrip
61
- @Keep
62
- val discountsIOS: String?,
63
- @DoNotStrip
64
- @Keep
65
- val introductoryPriceIOS: String?,
66
- @DoNotStrip
67
- @Keep
68
- val introductoryPriceAsAmountIOS: Double?,
69
- @DoNotStrip
70
- @Keep
71
- val introductoryPriceNumberOfPeriodsIOS: Double?,
72
- @DoNotStrip
73
- @Keep
74
- val introductoryPricePaymentModeIOS: String?,
75
- @DoNotStrip
76
- @Keep
77
- val introductoryPriceSubscriptionPeriodIOS: String?,
78
- @DoNotStrip
79
- @Keep
80
- val subscriptionPeriodNumberIOS: Double?,
81
- @DoNotStrip
82
- @Keep
83
- val subscriptionPeriodUnitIOS: String?,
84
- @DoNotStrip
85
- @Keep
86
- val nameAndroid: String?,
87
- @DoNotStrip
88
- @Keep
89
- val originalPriceAndroid: String?,
90
- @DoNotStrip
91
- @Keep
92
- val originalPriceAmountMicrosAndroid: Double?,
93
- @DoNotStrip
94
- @Keep
95
- val introductoryPriceCyclesAndroid: Double?,
96
- @DoNotStrip
97
- @Keep
98
- val introductoryPricePeriodAndroid: String?,
99
- @DoNotStrip
100
- @Keep
101
- val introductoryPriceValueAndroid: Double?,
102
- @DoNotStrip
103
- @Keep
104
- val subscriptionPeriodAndroid: String?,
105
- @DoNotStrip
106
- @Keep
107
- val freeTrialPeriodAndroid: String?,
108
- @DoNotStrip
109
- @Keep
110
- val subscriptionOfferDetailsAndroid: String?,
111
- @DoNotStrip
112
- @Keep
113
- val oneTimePurchaseOfferDetailsAndroid: NitroOneTimePurchaseOfferDetail?
114
- ) {
115
- /* main constructor */
22
+ val id: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val title: String,
26
+ @DoNotStrip
27
+ @Keep
28
+ val description: String,
29
+ @DoNotStrip
30
+ @Keep
31
+ val type: String,
32
+ @DoNotStrip
33
+ @Keep
34
+ val displayName: String?,
35
+ @DoNotStrip
36
+ @Keep
37
+ val displayPrice: String?,
38
+ @DoNotStrip
39
+ @Keep
40
+ val currency: String?,
41
+ @DoNotStrip
42
+ @Keep
43
+ val price: Double?,
44
+ @DoNotStrip
45
+ @Keep
46
+ val platform: IapPlatform,
47
+ @DoNotStrip
48
+ @Keep
49
+ val typeIOS: String?,
50
+ @DoNotStrip
51
+ @Keep
52
+ val isFamilyShareableIOS: Boolean?,
53
+ @DoNotStrip
54
+ @Keep
55
+ val jsonRepresentationIOS: String?,
56
+ @DoNotStrip
57
+ @Keep
58
+ val discountsIOS: String?,
59
+ @DoNotStrip
60
+ @Keep
61
+ val introductoryPriceIOS: String?,
62
+ @DoNotStrip
63
+ @Keep
64
+ val introductoryPriceAsAmountIOS: Double?,
65
+ @DoNotStrip
66
+ @Keep
67
+ val introductoryPriceNumberOfPeriodsIOS: Double?,
68
+ @DoNotStrip
69
+ @Keep
70
+ val introductoryPricePaymentModeIOS: PaymentModeIOS,
71
+ @DoNotStrip
72
+ @Keep
73
+ val introductoryPriceSubscriptionPeriodIOS: String?,
74
+ @DoNotStrip
75
+ @Keep
76
+ val subscriptionPeriodNumberIOS: Double?,
77
+ @DoNotStrip
78
+ @Keep
79
+ val subscriptionPeriodUnitIOS: String?,
80
+ @DoNotStrip
81
+ @Keep
82
+ val nameAndroid: String?,
83
+ @DoNotStrip
84
+ @Keep
85
+ val originalPriceAndroid: String?,
86
+ @DoNotStrip
87
+ @Keep
88
+ val originalPriceAmountMicrosAndroid: Double?,
89
+ @DoNotStrip
90
+ @Keep
91
+ val introductoryPriceCyclesAndroid: Double?,
92
+ @DoNotStrip
93
+ @Keep
94
+ val introductoryPricePeriodAndroid: String?,
95
+ @DoNotStrip
96
+ @Keep
97
+ val introductoryPriceValueAndroid: Double?,
98
+ @DoNotStrip
99
+ @Keep
100
+ val subscriptionPeriodAndroid: String?,
101
+ @DoNotStrip
102
+ @Keep
103
+ val freeTrialPeriodAndroid: String?,
104
+ @DoNotStrip
105
+ @Keep
106
+ val subscriptionOfferDetailsAndroid: String?,
107
+ @DoNotStrip
108
+ @Keep
109
+ val oneTimePurchaseOfferDetailsAndroid: NitroOneTimePurchaseOfferDetail?
110
+ ) {
111
+ private companion object {
112
+ /**
113
+ * Constructor called from C++
114
+ */
115
+ @DoNotStrip
116
+ @Keep
117
+ @Suppress("unused")
118
+ @JvmStatic
119
+ private fun fromCpp(id: String, title: String, description: String, type: String, displayName: String?, displayPrice: String?, currency: String?, price: Double?, platform: IapPlatform, typeIOS: String?, isFamilyShareableIOS: Boolean?, jsonRepresentationIOS: String?, discountsIOS: String?, introductoryPriceIOS: String?, introductoryPriceAsAmountIOS: Double?, introductoryPriceNumberOfPeriodsIOS: Double?, introductoryPricePaymentModeIOS: PaymentModeIOS, introductoryPriceSubscriptionPeriodIOS: String?, subscriptionPeriodNumberIOS: Double?, subscriptionPeriodUnitIOS: String?, nameAndroid: String?, originalPriceAndroid: String?, originalPriceAmountMicrosAndroid: Double?, introductoryPriceCyclesAndroid: Double?, introductoryPricePeriodAndroid: String?, introductoryPriceValueAndroid: Double?, subscriptionPeriodAndroid: String?, freeTrialPeriodAndroid: String?, subscriptionOfferDetailsAndroid: String?, oneTimePurchaseOfferDetailsAndroid: NitroOneTimePurchaseOfferDetail?): NitroProduct {
120
+ return NitroProduct(id, title, description, type, displayName, displayPrice, currency, price, platform, typeIOS, isFamilyShareableIOS, jsonRepresentationIOS, discountsIOS, introductoryPriceIOS, introductoryPriceAsAmountIOS, introductoryPriceNumberOfPeriodsIOS, introductoryPricePaymentModeIOS, introductoryPriceSubscriptionPeriodIOS, subscriptionPeriodNumberIOS, subscriptionPeriodUnitIOS, nameAndroid, originalPriceAndroid, originalPriceAmountMicrosAndroid, introductoryPriceCyclesAndroid, introductoryPricePeriodAndroid, introductoryPriceValueAndroid, subscriptionPeriodAndroid, freeTrialPeriodAndroid, subscriptionOfferDetailsAndroid, oneTimePurchaseOfferDetailsAndroid)
121
+ }
122
+ }
116
123
  }
@@ -9,7 +9,6 @@ package com.margelo.nitro.iap
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
13
12
 
14
13
 
15
14
  /**
@@ -17,130 +16,138 @@ import com.margelo.nitro.core.*
17
16
  */
18
17
  @DoNotStrip
19
18
  @Keep
20
- data class NitroPurchase
19
+ data class NitroPurchase(
21
20
  @DoNotStrip
22
21
  @Keep
23
- constructor(
24
- @DoNotStrip
25
- @Keep
26
- val id: String,
27
- @DoNotStrip
28
- @Keep
29
- val productId: String,
30
- @DoNotStrip
31
- @Keep
32
- val transactionDate: Double,
33
- @DoNotStrip
34
- @Keep
35
- val purchaseToken: String?,
36
- @DoNotStrip
37
- @Keep
38
- val platform: IapPlatform,
39
- @DoNotStrip
40
- @Keep
41
- val quantity: Double,
42
- @DoNotStrip
43
- @Keep
44
- val purchaseState: PurchaseState,
45
- @DoNotStrip
46
- @Keep
47
- val isAutoRenewing: Boolean,
48
- @DoNotStrip
49
- @Keep
50
- val quantityIOS: Double?,
51
- @DoNotStrip
52
- @Keep
53
- val originalTransactionDateIOS: Double?,
54
- @DoNotStrip
55
- @Keep
56
- val originalTransactionIdentifierIOS: String?,
57
- @DoNotStrip
58
- @Keep
59
- val appAccountToken: String?,
60
- @DoNotStrip
61
- @Keep
62
- val appBundleIdIOS: String?,
63
- @DoNotStrip
64
- @Keep
65
- val countryCodeIOS: String?,
66
- @DoNotStrip
67
- @Keep
68
- val currencyCodeIOS: String?,
69
- @DoNotStrip
70
- @Keep
71
- val currencySymbolIOS: String?,
72
- @DoNotStrip
73
- @Keep
74
- val environmentIOS: String?,
75
- @DoNotStrip
76
- @Keep
77
- val expirationDateIOS: Double?,
78
- @DoNotStrip
79
- @Keep
80
- val isUpgradedIOS: Boolean?,
81
- @DoNotStrip
82
- @Keep
83
- val offerIOS: String?,
84
- @DoNotStrip
85
- @Keep
86
- val ownershipTypeIOS: String?,
87
- @DoNotStrip
88
- @Keep
89
- val reasonIOS: String?,
90
- @DoNotStrip
91
- @Keep
92
- val reasonStringRepresentationIOS: String?,
93
- @DoNotStrip
94
- @Keep
95
- val revocationDateIOS: Double?,
96
- @DoNotStrip
97
- @Keep
98
- val revocationReasonIOS: String?,
99
- @DoNotStrip
100
- @Keep
101
- val storefrontCountryCodeIOS: String?,
102
- @DoNotStrip
103
- @Keep
104
- val subscriptionGroupIdIOS: String?,
105
- @DoNotStrip
106
- @Keep
107
- val transactionReasonIOS: String?,
108
- @DoNotStrip
109
- @Keep
110
- val webOrderLineItemIdIOS: String?,
111
- @DoNotStrip
112
- @Keep
113
- val renewalInfoIOS: NitroRenewalInfoIOS?,
114
- @DoNotStrip
115
- @Keep
116
- val purchaseTokenAndroid: String?,
117
- @DoNotStrip
118
- @Keep
119
- val dataAndroid: String?,
120
- @DoNotStrip
121
- @Keep
122
- val signatureAndroid: String?,
123
- @DoNotStrip
124
- @Keep
125
- val autoRenewingAndroid: Boolean?,
126
- @DoNotStrip
127
- @Keep
128
- val purchaseStateAndroid: Double?,
129
- @DoNotStrip
130
- @Keep
131
- val isAcknowledgedAndroid: Boolean?,
132
- @DoNotStrip
133
- @Keep
134
- val packageNameAndroid: String?,
135
- @DoNotStrip
136
- @Keep
137
- val obfuscatedAccountIdAndroid: String?,
138
- @DoNotStrip
139
- @Keep
140
- val obfuscatedProfileIdAndroid: String?,
141
- @DoNotStrip
142
- @Keep
143
- val developerPayloadAndroid: String?
144
- ) {
145
- /* main constructor */
22
+ val id: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val productId: String,
26
+ @DoNotStrip
27
+ @Keep
28
+ val transactionDate: Double,
29
+ @DoNotStrip
30
+ @Keep
31
+ val purchaseToken: String?,
32
+ @DoNotStrip
33
+ @Keep
34
+ val platform: IapPlatform,
35
+ @DoNotStrip
36
+ @Keep
37
+ val quantity: Double,
38
+ @DoNotStrip
39
+ @Keep
40
+ val purchaseState: PurchaseState,
41
+ @DoNotStrip
42
+ @Keep
43
+ val isAutoRenewing: Boolean,
44
+ @DoNotStrip
45
+ @Keep
46
+ val quantityIOS: Double?,
47
+ @DoNotStrip
48
+ @Keep
49
+ val originalTransactionDateIOS: Double?,
50
+ @DoNotStrip
51
+ @Keep
52
+ val originalTransactionIdentifierIOS: String?,
53
+ @DoNotStrip
54
+ @Keep
55
+ val appAccountToken: String?,
56
+ @DoNotStrip
57
+ @Keep
58
+ val appBundleIdIOS: String?,
59
+ @DoNotStrip
60
+ @Keep
61
+ val countryCodeIOS: String?,
62
+ @DoNotStrip
63
+ @Keep
64
+ val currencyCodeIOS: String?,
65
+ @DoNotStrip
66
+ @Keep
67
+ val currencySymbolIOS: String?,
68
+ @DoNotStrip
69
+ @Keep
70
+ val environmentIOS: String?,
71
+ @DoNotStrip
72
+ @Keep
73
+ val expirationDateIOS: Double?,
74
+ @DoNotStrip
75
+ @Keep
76
+ val isUpgradedIOS: Boolean?,
77
+ @DoNotStrip
78
+ @Keep
79
+ val offerIOS: String?,
80
+ @DoNotStrip
81
+ @Keep
82
+ val ownershipTypeIOS: String?,
83
+ @DoNotStrip
84
+ @Keep
85
+ val reasonIOS: String?,
86
+ @DoNotStrip
87
+ @Keep
88
+ val reasonStringRepresentationIOS: String?,
89
+ @DoNotStrip
90
+ @Keep
91
+ val revocationDateIOS: Double?,
92
+ @DoNotStrip
93
+ @Keep
94
+ val revocationReasonIOS: String?,
95
+ @DoNotStrip
96
+ @Keep
97
+ val storefrontCountryCodeIOS: String?,
98
+ @DoNotStrip
99
+ @Keep
100
+ val subscriptionGroupIdIOS: String?,
101
+ @DoNotStrip
102
+ @Keep
103
+ val transactionReasonIOS: String?,
104
+ @DoNotStrip
105
+ @Keep
106
+ val webOrderLineItemIdIOS: String?,
107
+ @DoNotStrip
108
+ @Keep
109
+ val renewalInfoIOS: NitroRenewalInfoIOS?,
110
+ @DoNotStrip
111
+ @Keep
112
+ val purchaseTokenAndroid: String?,
113
+ @DoNotStrip
114
+ @Keep
115
+ val dataAndroid: String?,
116
+ @DoNotStrip
117
+ @Keep
118
+ val signatureAndroid: String?,
119
+ @DoNotStrip
120
+ @Keep
121
+ val autoRenewingAndroid: Boolean?,
122
+ @DoNotStrip
123
+ @Keep
124
+ val purchaseStateAndroid: Double?,
125
+ @DoNotStrip
126
+ @Keep
127
+ val isAcknowledgedAndroid: Boolean?,
128
+ @DoNotStrip
129
+ @Keep
130
+ val packageNameAndroid: String?,
131
+ @DoNotStrip
132
+ @Keep
133
+ val obfuscatedAccountIdAndroid: String?,
134
+ @DoNotStrip
135
+ @Keep
136
+ val obfuscatedProfileIdAndroid: String?,
137
+ @DoNotStrip
138
+ @Keep
139
+ val developerPayloadAndroid: String?
140
+ ) {
141
+ private companion object {
142
+ /**
143
+ * Constructor called from C++
144
+ */
145
+ @DoNotStrip
146
+ @Keep
147
+ @Suppress("unused")
148
+ @JvmStatic
149
+ private fun fromCpp(id: String, productId: String, transactionDate: Double, purchaseToken: String?, platform: IapPlatform, quantity: Double, purchaseState: PurchaseState, isAutoRenewing: Boolean, quantityIOS: Double?, originalTransactionDateIOS: Double?, originalTransactionIdentifierIOS: String?, appAccountToken: String?, appBundleIdIOS: String?, countryCodeIOS: String?, currencyCodeIOS: String?, currencySymbolIOS: String?, environmentIOS: String?, expirationDateIOS: Double?, isUpgradedIOS: Boolean?, offerIOS: String?, ownershipTypeIOS: String?, reasonIOS: String?, reasonStringRepresentationIOS: String?, revocationDateIOS: Double?, revocationReasonIOS: String?, storefrontCountryCodeIOS: String?, subscriptionGroupIdIOS: String?, transactionReasonIOS: String?, webOrderLineItemIdIOS: String?, renewalInfoIOS: NitroRenewalInfoIOS?, purchaseTokenAndroid: String?, dataAndroid: String?, signatureAndroid: String?, autoRenewingAndroid: Boolean?, purchaseStateAndroid: Double?, isAcknowledgedAndroid: Boolean?, packageNameAndroid: String?, obfuscatedAccountIdAndroid: String?, obfuscatedProfileIdAndroid: String?, developerPayloadAndroid: String?): NitroPurchase {
150
+ return NitroPurchase(id, productId, transactionDate, purchaseToken, platform, quantity, purchaseState, isAutoRenewing, quantityIOS, originalTransactionDateIOS, originalTransactionIdentifierIOS, appAccountToken, appBundleIdIOS, countryCodeIOS, currencyCodeIOS, currencySymbolIOS, environmentIOS, expirationDateIOS, isUpgradedIOS, offerIOS, ownershipTypeIOS, reasonIOS, reasonStringRepresentationIOS, revocationDateIOS, revocationReasonIOS, storefrontCountryCodeIOS, subscriptionGroupIdIOS, transactionReasonIOS, webOrderLineItemIdIOS, renewalInfoIOS, purchaseTokenAndroid, dataAndroid, signatureAndroid, autoRenewingAndroid, purchaseStateAndroid, isAcknowledgedAndroid, packageNameAndroid, obfuscatedAccountIdAndroid, obfuscatedProfileIdAndroid, developerPayloadAndroid)
151
+ }
152
+ }
146
153
  }