react-native-iap 14.4.27 → 14.4.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NitroIap.podspec +2 -1
- package/ios/RnIapHelper.swift +9 -4
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +50 -6
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JAndroidSubscriptionOfferInput.hpp +5 -1
- package/nitrogen/generated/android/c++/JExternalPurchaseLinkResultIOS.hpp +5 -1
- package/nitrogen/generated/android/c++/JExternalPurchaseNoticeResultIOS.hpp +5 -1
- package/nitrogen/generated/android/c++/JInitConnectionConfig.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroActiveSubscription.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidOptions.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesIosOptions.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesOptions.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroDeepLinkOptionsAndroid.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroFinishTransactionAndroidParams.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroFinishTransactionIosParams.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroFinishTransactionParams.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroOneTimePurchaseOfferDetail.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroProduct.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroPurchase.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroPurchaseResult.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroReceiptValidationAndroidOptions.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroReceiptValidationParams.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroReceiptValidationResultAndroid.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroRenewalInfoIOS.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseIos.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroSubscriptionRenewalInfo.hpp +5 -1
- package/nitrogen/generated/android/c++/JNitroSubscriptionStatus.hpp +5 -1
- package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +5 -1
- package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +5 -1
- package/nitrogen/generated/android/c++/JPurchaseOfferIOS.hpp +5 -1
- package/nitrogen/generated/android/c++/JRenewalInfoIOS.hpp +5 -1
- package/nitrogen/generated/android/c++/JUserChoiceBillingDetails.hpp +5 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/AndroidSubscriptionOfferInput.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseLinkResultIOS.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseNoticeResultIOS.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroProduct.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchase.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchaseResult.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_UserChoiceBillingDetails.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +3 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/InitConnectionConfig.kt +13 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroActiveSubscription.kt +52 -45
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidOptions.kt +13 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesIosOptions.kt +22 -15
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesOptions.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroDeepLinkOptionsAndroid.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionAndroidParams.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionIosParams.kt +13 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionParams.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroOneTimePurchaseOfferDetail.kt +19 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +102 -95
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +132 -125
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseResult.kt +25 -18
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationAndroidOptions.kt +22 -15
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationParams.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultAndroid.kt +66 -59
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultIOS.kt +22 -15
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRenewalInfoIOS.kt +43 -36
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +31 -24
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseIos.kt +25 -18
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionRenewalInfo.kt +28 -21
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionStatus.kt +19 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Purchase.kt +18 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +69 -62
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +111 -104
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseOfferIOS.kt +19 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RenewalInfoIOS.kt +43 -36
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RequestPurchaseResult.kt +23 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/UserChoiceBillingDetails.kt +16 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_Boolean_NitroPurchaseResult.kt +18 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.kt +18 -1
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +22 -22
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +23 -22
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +4 -4
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroProduct_.swift +1 -8
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroPurchase_.swift +1 -8
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +3 -16
- package/nitrogen/generated/ios/swift/NitroActiveSubscription.swift +17 -10
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesIosOptions.swift +32 -4
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesOptions.swift +2 -16
- package/nitrogen/generated/ios/swift/NitroFinishTransactionAndroidParams.swift +8 -1
- package/nitrogen/generated/ios/swift/NitroFinishTransactionParams.swift +2 -16
- package/nitrogen/generated/ios/swift/NitroProduct.swift +9 -9
- package/nitrogen/generated/ios/swift/NitroPurchase.swift +25 -11
- package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +2 -16
- package/nitrogen/generated/ios/swift/NitroReceiptValidationAndroidOptions.swift +8 -1
- package/nitrogen/generated/ios/swift/NitroReceiptValidationParams.swift +1 -8
- package/nitrogen/generated/ios/swift/NitroReceiptValidationResultIOS.swift +1 -8
- package/nitrogen/generated/ios/swift/NitroRenewalInfoIOS.swift +8 -1
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +8 -1
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseIos.swift +8 -1
- package/nitrogen/generated/ios/swift/NitroSubscriptionStatus.swift +1 -8
- package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +16 -2
- package/nitrogen/generated/ios/swift/PurchaseIOS.swift +10 -17
- package/nitrogen/generated/ios/swift/RenewalInfoIOS.swift +8 -1
- package/nitrogen/generated/shared/c++/AndroidSubscriptionOfferInput.hpp +8 -0
- package/nitrogen/generated/shared/c++/ExternalPurchaseLinkResultIOS.hpp +8 -0
- package/nitrogen/generated/shared/c++/ExternalPurchaseNoticeResultIOS.hpp +8 -0
- package/nitrogen/generated/shared/c++/InitConnectionConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroActiveSubscription.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidOptions.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesIosOptions.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesOptions.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroDeepLinkOptionsAndroid.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroFinishTransactionAndroidParams.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroFinishTransactionIosParams.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroFinishTransactionParams.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroOneTimePurchaseOfferDetail.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroProduct.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroPurchase.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroPurchaseResult.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroReceiptValidationAndroidOptions.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroReceiptValidationParams.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroReceiptValidationResultAndroid.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroReceiptValidationResultIOS.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroRenewalInfoIOS.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseIos.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroSubscriptionRenewalInfo.hpp +8 -0
- package/nitrogen/generated/shared/c++/NitroSubscriptionStatus.hpp +8 -0
- package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +8 -0
- package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +8 -0
- package/nitrogen/generated/shared/c++/PurchaseOfferIOS.hpp +8 -0
- package/nitrogen/generated/shared/c++/RenewalInfoIOS.hpp +8 -0
- package/nitrogen/generated/shared/c++/UserChoiceBillingDetails.hpp +8 -0
- package/openiap-versions.json +1 -1
- package/package.json +4 -4
- package/src/index.ts +18 -0
- package/src/specs/RnIap.nitro.ts +50 -6
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `NitroFinishTransactionIosParams` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { struct NitroFinishTransactionIosParams; }
|
|
@@ -67,6 +72,9 @@ namespace margelo::nitro {
|
|
|
67
72
|
return false;
|
|
68
73
|
}
|
|
69
74
|
jsi::Object obj = value.getObject(runtime);
|
|
75
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
70
78
|
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroFinishTransactionIosParams>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
|
|
71
79
|
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroFinishTransactionAndroidParams>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
|
|
72
80
|
return true;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -65,6 +70,9 @@ namespace margelo::nitro {
|
|
|
65
70
|
return false;
|
|
66
71
|
}
|
|
67
72
|
jsi::Object obj = value.getObject(runtime);
|
|
73
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
68
76
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "formattedPrice"))) return false;
|
|
69
77
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "priceAmountMicros"))) return false;
|
|
70
78
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "priceCurrencyCode"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { enum class IapPlatform; }
|
|
@@ -155,6 +160,9 @@ namespace margelo::nitro {
|
|
|
155
160
|
return false;
|
|
156
161
|
}
|
|
157
162
|
jsi::Object obj = value.getObject(runtime);
|
|
163
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
158
166
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
159
167
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "title"))) return false;
|
|
160
168
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "description"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { enum class IapPlatform; }
|
|
@@ -185,6 +190,9 @@ namespace margelo::nitro {
|
|
|
185
190
|
return false;
|
|
186
191
|
}
|
|
187
192
|
jsi::Object obj = value.getObject(runtime);
|
|
193
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
188
196
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
189
197
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "productId"))) return false;
|
|
190
198
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "transactionDate"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `NitroRequestPurchaseIos` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { struct NitroRequestPurchaseIos; }
|
|
@@ -67,6 +72,9 @@ namespace margelo::nitro {
|
|
|
67
72
|
return false;
|
|
68
73
|
}
|
|
69
74
|
jsi::Object obj = value.getObject(runtime);
|
|
75
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
70
78
|
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseIos>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
|
|
71
79
|
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
|
|
72
80
|
return true;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -72,6 +77,9 @@ namespace margelo::nitro {
|
|
|
72
77
|
return false;
|
|
73
78
|
}
|
|
74
79
|
jsi::Object obj = value.getObject(runtime);
|
|
80
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
75
83
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "responseCode"))) return false;
|
|
76
84
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "debugMessage"))) return false;
|
|
77
85
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "code"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -69,6 +74,9 @@ namespace margelo::nitro {
|
|
|
69
74
|
return false;
|
|
70
75
|
}
|
|
71
76
|
jsi::Object obj = value.getObject(runtime);
|
|
77
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
72
80
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "accessToken"))) return false;
|
|
73
81
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isSub"))) return false;
|
|
74
82
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "packageName"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `NitroReceiptValidationAndroidOptions` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { struct NitroReceiptValidationAndroidOptions; }
|
|
@@ -65,6 +70,9 @@ namespace margelo::nitro {
|
|
|
65
70
|
return false;
|
|
66
71
|
}
|
|
67
72
|
jsi::Object obj = value.getObject(runtime);
|
|
73
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
68
76
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sku"))) return false;
|
|
69
77
|
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroReceiptValidationAndroidOptions>>::canConvert(runtime, obj.getProperty(runtime, "androidOptions"))) return false;
|
|
70
78
|
return true;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -111,6 +116,9 @@ namespace margelo::nitro {
|
|
|
111
116
|
return false;
|
|
112
117
|
}
|
|
113
118
|
jsi::Object obj = value.getObject(runtime);
|
|
119
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
114
122
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "autoRenewing"))) return false;
|
|
115
123
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "betaProduct"))) return false;
|
|
116
124
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "cancelDate"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `NitroPurchase` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { struct NitroPurchase; }
|
|
@@ -71,6 +76,9 @@ namespace margelo::nitro {
|
|
|
71
76
|
return false;
|
|
72
77
|
}
|
|
73
78
|
jsi::Object obj = value.getObject(runtime);
|
|
79
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
74
82
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isValid"))) return false;
|
|
75
83
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "receiptData"))) return false;
|
|
76
84
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "jwsRepresentation"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -90,6 +95,9 @@ namespace margelo::nitro {
|
|
|
90
95
|
return false;
|
|
91
96
|
}
|
|
92
97
|
jsi::Object obj = value.getObject(runtime);
|
|
98
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
93
101
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "willAutoRenew"))) return false;
|
|
94
102
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "autoRenewPreference"))) return false;
|
|
95
103
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "pendingUpgradeProductId"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `AndroidSubscriptionOfferInput` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { struct AndroidSubscriptionOfferInput; }
|
|
@@ -81,6 +86,9 @@ namespace margelo::nitro {
|
|
|
81
86
|
return false;
|
|
82
87
|
}
|
|
83
88
|
jsi::Object obj = value.getObject(runtime);
|
|
89
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
84
92
|
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "skus"))) return false;
|
|
85
93
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "obfuscatedAccountIdAndroid"))) return false;
|
|
86
94
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "obfuscatedProfileIdAndroid"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -73,6 +78,9 @@ namespace margelo::nitro {
|
|
|
73
78
|
return false;
|
|
74
79
|
}
|
|
75
80
|
jsi::Object obj = value.getObject(runtime);
|
|
81
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
76
84
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sku"))) return false;
|
|
77
85
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "andDangerouslyFinishTransactionAutomatically"))) return false;
|
|
78
86
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "appAccountToken"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -75,6 +80,9 @@ namespace margelo::nitro {
|
|
|
75
80
|
return false;
|
|
76
81
|
}
|
|
77
82
|
jsi::Object obj = value.getObject(runtime);
|
|
83
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
78
86
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "autoRenewStatus"))) return false;
|
|
79
87
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "autoRenewPreference"))) return false;
|
|
80
88
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "expirationReason"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `NitroSubscriptionRenewalInfo` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { struct NitroSubscriptionRenewalInfo; }
|
|
@@ -68,6 +73,9 @@ namespace margelo::nitro {
|
|
|
68
73
|
return false;
|
|
69
74
|
}
|
|
70
75
|
jsi::Object obj = value.getObject(runtime);
|
|
76
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
71
79
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "state"))) return false;
|
|
72
80
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "platform"))) return false;
|
|
73
81
|
if (!JSIConverter<std::optional<margelo::nitro::iap::NitroSubscriptionRenewalInfo>>::canConvert(runtime, obj.getProperty(runtime, "renewalInfo"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { enum class IapPlatform; }
|
|
@@ -120,6 +125,9 @@ namespace margelo::nitro {
|
|
|
120
125
|
return false;
|
|
121
126
|
}
|
|
122
127
|
jsi::Object obj = value.getObject(runtime);
|
|
128
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
123
131
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "autoRenewingAndroid"))) return false;
|
|
124
132
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "currentPlanId"))) return false;
|
|
125
133
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "dataAndroid"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `PurchaseOfferIOS` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
|
|
@@ -168,6 +173,9 @@ namespace margelo::nitro {
|
|
|
168
173
|
return false;
|
|
169
174
|
}
|
|
170
175
|
jsi::Object obj = value.getObject(runtime);
|
|
176
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
171
179
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "appAccountToken"))) return false;
|
|
172
180
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "appBundleIdIOS"))) return false;
|
|
173
181
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "countryCodeIOS"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -65,6 +70,9 @@ namespace margelo::nitro {
|
|
|
65
70
|
return false;
|
|
66
71
|
}
|
|
67
72
|
jsi::Object obj = value.getObject(runtime);
|
|
73
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
68
76
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
69
77
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "paymentMode"))) return false;
|
|
70
78
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "type"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -90,6 +95,9 @@ namespace margelo::nitro {
|
|
|
90
95
|
return false;
|
|
91
96
|
}
|
|
92
97
|
jsi::Object obj = value.getObject(runtime);
|
|
98
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
93
101
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "autoRenewPreference"))) return false;
|
|
94
102
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "expirationReason"))) return false;
|
|
95
103
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "gracePeriodExpirationDate"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -63,6 +68,9 @@ namespace margelo::nitro {
|
|
|
63
68
|
return false;
|
|
64
69
|
}
|
|
65
70
|
jsi::Object obj = value.getObject(runtime);
|
|
71
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
66
74
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "externalTransactionToken"))) return false;
|
|
67
75
|
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "products"))) return false;
|
|
68
76
|
return true;
|
package/openiap-versions.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-iap",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.29",
|
|
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",
|
|
@@ -108,19 +108,19 @@
|
|
|
108
108
|
"husky": "^8.0.3",
|
|
109
109
|
"jest": "^30.1.1",
|
|
110
110
|
"lint-staged": "^15.2.0",
|
|
111
|
-
"nitrogen": "^0.
|
|
111
|
+
"nitrogen": "^0.31.1",
|
|
112
112
|
"prettier": "^3.3.3",
|
|
113
113
|
"react": "19.1.0",
|
|
114
114
|
"react-native": "0.81.1",
|
|
115
115
|
"react-native-builder-bob": "^0.38.4",
|
|
116
|
-
"react-native-nitro-modules": "^0.
|
|
116
|
+
"react-native-nitro-modules": "^0.31.1",
|
|
117
117
|
"react-test-renderer": "^19.1.1",
|
|
118
118
|
"typescript": "^5.9.2"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
121
|
"react": "*",
|
|
122
122
|
"react-native": "*",
|
|
123
|
-
"react-native-nitro-modules": "^0.
|
|
123
|
+
"react-native-nitro-modules": "^0.31.1"
|
|
124
124
|
},
|
|
125
125
|
"workspaces": [
|
|
126
126
|
"example"
|
package/src/index.ts
CHANGED
|
@@ -827,6 +827,12 @@ export const getReceiptDataIOS: QueryField<'getReceiptDataIOS'> = async () => {
|
|
|
827
827
|
throw new Error('getReceiptDataIOS is only available on iOS');
|
|
828
828
|
}
|
|
829
829
|
|
|
830
|
+
RnIapConsole.warn(
|
|
831
|
+
'[getReceiptDataIOS] ⚠️ iOS receipts contain ALL transactions, not just the latest one. ' +
|
|
832
|
+
'For individual purchase validation, use getTransactionJwsIOS(productId) instead. ' +
|
|
833
|
+
'See: https://react-native-iap.hyo.dev/docs/guides/receipt-validation',
|
|
834
|
+
);
|
|
835
|
+
|
|
830
836
|
try {
|
|
831
837
|
return await IAP.instance.getReceiptDataIOS();
|
|
832
838
|
} catch (error) {
|
|
@@ -841,6 +847,12 @@ export const getReceiptIOS = async (): Promise<string> => {
|
|
|
841
847
|
throw new Error('getReceiptIOS is only available on iOS');
|
|
842
848
|
}
|
|
843
849
|
|
|
850
|
+
RnIapConsole.warn(
|
|
851
|
+
'[getReceiptIOS] ⚠️ iOS receipts contain ALL transactions, not just the latest one. ' +
|
|
852
|
+
'For individual purchase validation, use getTransactionJwsIOS(productId) instead. ' +
|
|
853
|
+
'See: https://react-native-iap.hyo.dev/docs/guides/receipt-validation',
|
|
854
|
+
);
|
|
855
|
+
|
|
844
856
|
try {
|
|
845
857
|
if (typeof IAP.instance.getReceiptIOS === 'function') {
|
|
846
858
|
return await IAP.instance.getReceiptIOS();
|
|
@@ -858,6 +870,12 @@ export const requestReceiptRefreshIOS = async (): Promise<string> => {
|
|
|
858
870
|
throw new Error('requestReceiptRefreshIOS is only available on iOS');
|
|
859
871
|
}
|
|
860
872
|
|
|
873
|
+
RnIapConsole.warn(
|
|
874
|
+
'[requestReceiptRefreshIOS] ⚠️ iOS receipts contain ALL transactions, not just the latest one. ' +
|
|
875
|
+
'For individual purchase validation, use getTransactionJwsIOS(productId) instead. ' +
|
|
876
|
+
'See: https://react-native-iap.hyo.dev/docs/guides/receipt-validation',
|
|
877
|
+
);
|
|
878
|
+
|
|
861
879
|
try {
|
|
862
880
|
if (typeof IAP.instance.requestReceiptRefreshIOS === 'function') {
|
|
863
881
|
return await IAP.instance.requestReceiptRefreshIOS();
|
package/src/specs/RnIap.nitro.ts
CHANGED
|
@@ -556,22 +556,49 @@ export interface RnIap extends HybridObject<{ios: 'swift'; android: 'kotlin'}> {
|
|
|
556
556
|
|
|
557
557
|
/**
|
|
558
558
|
* Get receipt data (iOS only)
|
|
559
|
-
*
|
|
559
|
+
*
|
|
560
|
+
* ⚠️ **IMPORTANT**: iOS receipts are cumulative and contain ALL transactions for the app,
|
|
561
|
+
* not just the most recent one. The receipt data does not change between purchases.
|
|
562
|
+
*
|
|
563
|
+
* **For individual purchase validation, use `getTransactionJwsIOS(productId)` instead.**
|
|
564
|
+
*
|
|
565
|
+
* This returns the App Store Receipt, which:
|
|
566
|
+
* - Contains all purchase history for the app
|
|
567
|
+
* - Does not update immediately after finishTransaction()
|
|
568
|
+
* - May be unavailable immediately after purchase (throws receipt-failed error)
|
|
569
|
+
* - Requires parsing to extract specific transactions
|
|
570
|
+
*
|
|
571
|
+
* @returns Promise<string> - Base64 encoded receipt data containing all app transactions
|
|
572
|
+
* @throws {Error} receipt-failed if receipt is not available (e.g., immediately after purchase)
|
|
560
573
|
* @platform iOS
|
|
574
|
+
* @see getTransactionJwsIOS for validating individual transactions (recommended)
|
|
561
575
|
*/
|
|
562
576
|
getReceiptDataIOS(): Promise<string>;
|
|
563
577
|
|
|
564
578
|
/**
|
|
565
579
|
* Alias for getReceiptDataIOS maintained for compatibility (iOS only)
|
|
566
|
-
*
|
|
580
|
+
*
|
|
581
|
+
* ⚠️ **IMPORTANT**: iOS receipts are cumulative and contain ALL transactions.
|
|
582
|
+
* For individual purchase validation, use `getTransactionJwsIOS(productId)` instead.
|
|
583
|
+
*
|
|
584
|
+
* @returns Promise<string> - Base64 encoded receipt data containing all app transactions
|
|
567
585
|
* @platform iOS
|
|
586
|
+
* @see getReceiptDataIOS for full documentation
|
|
587
|
+
* @see getTransactionJwsIOS for validating individual transactions (recommended)
|
|
568
588
|
*/
|
|
569
589
|
getReceiptIOS(): Promise<string>;
|
|
570
590
|
|
|
571
591
|
/**
|
|
572
592
|
* Request a refreshed receipt from the App Store (iOS only)
|
|
573
|
-
*
|
|
593
|
+
*
|
|
594
|
+
* This calls syncIOS() to refresh the receipt from Apple's servers, then returns it.
|
|
595
|
+
*
|
|
596
|
+
* ⚠️ **IMPORTANT**: iOS receipts are cumulative and contain ALL transactions.
|
|
597
|
+
* For individual purchase validation, use `getTransactionJwsIOS(productId)` instead.
|
|
598
|
+
*
|
|
599
|
+
* @returns Promise<string> - Updated Base64 encoded receipt data containing all app transactions
|
|
574
600
|
* @platform iOS
|
|
601
|
+
* @see getTransactionJwsIOS for validating individual transactions (recommended)
|
|
575
602
|
*/
|
|
576
603
|
requestReceiptRefreshIOS(): Promise<string>;
|
|
577
604
|
|
|
@@ -584,10 +611,27 @@ export interface RnIap extends HybridObject<{ios: 'swift'; android: 'kotlin'}> {
|
|
|
584
611
|
isTransactionVerifiedIOS(sku: string): Promise<boolean>;
|
|
585
612
|
|
|
586
613
|
/**
|
|
587
|
-
* Get transaction JWS representation (iOS only)
|
|
588
|
-
*
|
|
589
|
-
*
|
|
614
|
+
* Get transaction JWS (JSON Web Signature) representation for a specific product (iOS only)
|
|
615
|
+
*
|
|
616
|
+
* ✅ **RECOMMENDED** for validating individual purchases with your backend.
|
|
617
|
+
*
|
|
618
|
+
* This returns a unique, cryptographically signed token for the specific transaction,
|
|
619
|
+
* unlike `getReceiptDataIOS()` which returns ALL transactions.
|
|
620
|
+
*
|
|
621
|
+
* Benefits:
|
|
622
|
+
* - Contains ONLY the requested transaction (not all historical purchases)
|
|
623
|
+
* - Cryptographically signed by Apple (can be verified)
|
|
624
|
+
* - Available immediately after purchase
|
|
625
|
+
* - Simpler to validate on your backend
|
|
626
|
+
*
|
|
627
|
+
* @param sku - The product SKU/ID to get the transaction JWS for
|
|
628
|
+
* @returns Promise<string | null> - JWS string for the transaction, or null if not found
|
|
590
629
|
* @platform iOS
|
|
630
|
+
* @example
|
|
631
|
+
* ```typescript
|
|
632
|
+
* const jws = await getTransactionJwsIOS('com.example.product');
|
|
633
|
+
* // Send jws to your backend for validation
|
|
634
|
+
* ```
|
|
591
635
|
*/
|
|
592
636
|
getTransactionJwsIOS(sku: string): Promise<string | null>;
|
|
593
637
|
|