react-native-iap 14.3.7 → 14.3.8
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/README.md +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +61 -11
- package/ios/HybridRnIap.swift +47 -12
- package/lib/module/hooks/useIAP.js +31 -21
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +580 -695
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +12 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/purchase.js +22 -0
- package/lib/module/utils/purchase.js.map +1 -0
- package/lib/module/utils.js +43 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/plugin/src/withIAP.d.ts +1 -0
- package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts +4 -5
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +57 -176
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +113 -154
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +99 -76
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/purchase.d.ts +4 -0
- package/lib/typescript/src/utils/purchase.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +8 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/nitrogen/generated/android/NitroIap+autolinking.cmake +1 -1
- package/nitrogen/generated/android/c++/{JNitroSubscriptionOffer.hpp → JAndroidSubscriptionOfferInput.hpp} +15 -15
- package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +2 -0
- package/nitrogen/generated/android/c++/JFunc_void_NitroPurchase.hpp +4 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +16 -16
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidOptions.hpp +6 -5
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidType.hpp +59 -0
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesOptions.hpp +2 -1
- package/nitrogen/generated/android/c++/JNitroProduct.hpp +22 -20
- package/nitrogen/generated/android/c++/JNitroPurchase.hpp +12 -8
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +2 -2
- package/nitrogen/generated/android/c++/JNitroReceiptValidationAndroidOptions.hpp +10 -10
- package/nitrogen/generated/android/c++/JNitroReceiptValidationResultAndroid.hpp +6 -6
- package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +4 -0
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +7 -7
- package/nitrogen/generated/android/c++/JRequestPurchaseResult.cpp +39 -0
- package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +68 -53
- package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.hpp +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/{NitroSubscriptionOffer.kt → AndroidSubscriptionOfferInput.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidOptions.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidType.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +11 -11
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationAndroidOptions.kt +4 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultAndroid.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RequestPurchaseResult.kt +31 -13
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +4 -4
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +99 -64
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +6 -6
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +10 -10
- package/nitrogen/generated/ios/swift/{NitroSubscriptionOffer.swift → AndroidSubscriptionOfferInput.swift} +13 -13
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__variant_PurchaseAndroid__PurchaseIOS__std__vector_std__variant_PurchaseAndroid__PurchaseIOS____.swift +81 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +35 -7
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesAndroidOptions.swift +7 -14
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesAndroidType.swift +40 -0
- package/nitrogen/generated/ios/swift/NitroProduct.swift +72 -72
- package/nitrogen/generated/ios/swift/NitroPurchase.swift +8 -8
- package/nitrogen/generated/ios/swift/NitroReceiptValidationAndroidOptions.swift +21 -21
- package/nitrogen/generated/ios/swift/NitroReceiptValidationResultAndroid.swift +37 -11
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +11 -11
- package/nitrogen/generated/ios/swift/RequestPurchaseResult.swift +8 -137
- package/nitrogen/generated/shared/c++/{NitroSubscriptionOffer.hpp → AndroidSubscriptionOfferInput.hpp} +15 -15
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +9 -6
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidOptions.hpp +8 -7
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidType.hpp +76 -0
- package/nitrogen/generated/shared/c++/NitroProduct.hpp +24 -22
- package/nitrogen/generated/shared/c++/NitroPurchase.hpp +15 -10
- package/nitrogen/generated/shared/c++/NitroReceiptValidationAndroidOptions.hpp +10 -10
- package/nitrogen/generated/shared/c++/NitroReceiptValidationResultAndroid.hpp +9 -9
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +8 -8
- package/package.json +2 -2
- package/plugin/build/withIAP.d.ts +1 -0
- package/plugin/build/withIAP.js +8 -2
- package/plugin/src/withIAP.ts +13 -3
- package/src/hooks/useIAP.ts +63 -32
- package/src/index.ts +716 -790
- package/src/specs/RnIap.nitro.ts +131 -163
- package/src/types.ts +131 -85
- package/src/utils/purchase.ts +32 -0
- package/src/utils.ts +68 -0
- package/nitrogen/generated/android/c++/JVariant_PurchaseAndroid_PurchaseIOS.cpp +0 -26
- package/nitrogen/generated/android/c++/JVariant_PurchaseAndroid_PurchaseIOS.hpp +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_PurchaseAndroid_PurchaseIOS.kt +0 -42
- package/nitrogen/generated/ios/swift/Func_void_RequestPurchaseResult.swift +0 -47
- package/nitrogen/generated/ios/swift/Variant_PurchaseAndroid_PurchaseIOS.swift +0 -18
- package/nitrogen/generated/shared/c++/RequestPurchaseResult.hpp +0 -78
package/src/specs/RnIap.nitro.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import type {HybridObject} from 'react-native-nitro-modules';
|
|
2
|
-
|
|
2
|
+
// NOTE: This Nitro spec re-exports types from the generated schema (src/types.ts)
|
|
3
|
+
// via type aliases to avoid duplicating structure. Nitro's codegen expects the
|
|
4
|
+
// canonical `Nitro*` names defined here, so we keep the aliases rather than
|
|
5
|
+
// removing the types entirely.
|
|
6
|
+
import type {
|
|
7
|
+
AndroidSubscriptionOfferInput,
|
|
8
|
+
DeepLinkOptions,
|
|
9
|
+
MutationFinishTransactionArgs,
|
|
10
|
+
ProductCommon,
|
|
11
|
+
PurchaseCommon,
|
|
12
|
+
PurchaseOptions,
|
|
13
|
+
ReceiptValidationAndroidOptions,
|
|
14
|
+
ReceiptValidationProps,
|
|
15
|
+
ReceiptValidationResultAndroid,
|
|
16
|
+
RequestPurchaseIosProps,
|
|
17
|
+
RequestPurchaseResult,
|
|
18
|
+
RequestSubscriptionAndroidProps,
|
|
19
|
+
} from '../types';
|
|
3
20
|
|
|
4
21
|
// ╔══════════════════════════════════════════════════════════════════════════╗
|
|
5
22
|
// ║ PARAMS ║
|
|
@@ -7,22 +24,16 @@ import type {RequestPurchaseResult} from '../types';
|
|
|
7
24
|
|
|
8
25
|
// Receipt validation parameters
|
|
9
26
|
|
|
10
|
-
/**
|
|
11
|
-
* Android-specific receipt validation options
|
|
12
|
-
*/
|
|
13
27
|
export interface NitroReceiptValidationAndroidOptions {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
accessToken: ReceiptValidationAndroidOptions['accessToken'];
|
|
29
|
+
isSub?: ReceiptValidationAndroidOptions['isSub'];
|
|
30
|
+
packageName: ReceiptValidationAndroidOptions['packageName'];
|
|
31
|
+
productToken: ReceiptValidationAndroidOptions['productToken'];
|
|
18
32
|
}
|
|
19
33
|
|
|
20
|
-
/**
|
|
21
|
-
* Receipt validation parameters
|
|
22
|
-
*/
|
|
23
34
|
export interface NitroReceiptValidationParams {
|
|
24
|
-
sku:
|
|
25
|
-
androidOptions?: NitroReceiptValidationAndroidOptions;
|
|
35
|
+
sku: ReceiptValidationProps['sku'];
|
|
36
|
+
androidOptions?: NitroReceiptValidationAndroidOptions | null;
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
// Purchase request parameters
|
|
@@ -30,41 +41,27 @@ export interface NitroReceiptValidationParams {
|
|
|
30
41
|
/**
|
|
31
42
|
* iOS-specific purchase request parameters
|
|
32
43
|
*/
|
|
33
|
-
interface NitroRequestPurchaseIos {
|
|
34
|
-
sku:
|
|
35
|
-
andDangerouslyFinishTransactionAutomatically?:
|
|
36
|
-
appAccountToken?:
|
|
37
|
-
quantity?:
|
|
38
|
-
withOffer?: Record<string, string
|
|
44
|
+
export interface NitroRequestPurchaseIos {
|
|
45
|
+
sku: RequestPurchaseIosProps['sku'];
|
|
46
|
+
andDangerouslyFinishTransactionAutomatically?: RequestPurchaseIosProps['andDangerouslyFinishTransactionAutomatically'];
|
|
47
|
+
appAccountToken?: RequestPurchaseIosProps['appAccountToken'];
|
|
48
|
+
quantity?: RequestPurchaseIosProps['quantity'];
|
|
49
|
+
withOffer?: Record<string, string> | null;
|
|
39
50
|
}
|
|
40
51
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Android-specific purchase request parameters
|
|
51
|
-
*/
|
|
52
|
-
interface NitroRequestPurchaseAndroid {
|
|
53
|
-
skus: string[];
|
|
54
|
-
obfuscatedAccountIdAndroid?: string;
|
|
55
|
-
obfuscatedProfileIdAndroid?: string;
|
|
56
|
-
isOfferPersonalized?: boolean;
|
|
57
|
-
subscriptionOffers?: NitroSubscriptionOffer[];
|
|
58
|
-
replacementModeAndroid?: number;
|
|
59
|
-
purchaseTokenAndroid?: string;
|
|
52
|
+
export interface NitroRequestPurchaseAndroid {
|
|
53
|
+
skus: RequestSubscriptionAndroidProps['skus'];
|
|
54
|
+
obfuscatedAccountIdAndroid?: RequestSubscriptionAndroidProps['obfuscatedAccountIdAndroid'];
|
|
55
|
+
obfuscatedProfileIdAndroid?: RequestSubscriptionAndroidProps['obfuscatedProfileIdAndroid'];
|
|
56
|
+
isOfferPersonalized?: RequestSubscriptionAndroidProps['isOfferPersonalized'];
|
|
57
|
+
subscriptionOffers?: AndroidSubscriptionOfferInput[] | null;
|
|
58
|
+
replacementModeAndroid?: RequestSubscriptionAndroidProps['replacementModeAndroid'];
|
|
59
|
+
purchaseTokenAndroid?: RequestSubscriptionAndroidProps['purchaseTokenAndroid'];
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
interface NitroPurchaseRequest {
|
|
66
|
-
ios?: NitroRequestPurchaseIos;
|
|
67
|
-
android?: NitroRequestPurchaseAndroid;
|
|
62
|
+
export interface NitroPurchaseRequest {
|
|
63
|
+
ios?: NitroRequestPurchaseIos | null;
|
|
64
|
+
android?: NitroRequestPurchaseAndroid | null;
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
// Available purchases parameters
|
|
@@ -72,26 +69,20 @@ interface NitroPurchaseRequest {
|
|
|
72
69
|
/**
|
|
73
70
|
* iOS-specific options for getting available purchases
|
|
74
71
|
*/
|
|
75
|
-
interface NitroAvailablePurchasesIosOptions {
|
|
76
|
-
alsoPublishToEventListener?: boolean
|
|
77
|
-
onlyIncludeActiveItems?: boolean
|
|
78
|
-
alsoPublishToEventListenerIOS?: boolean;
|
|
79
|
-
onlyIncludeActiveItemsIOS?: boolean;
|
|
72
|
+
export interface NitroAvailablePurchasesIosOptions extends PurchaseOptions {
|
|
73
|
+
alsoPublishToEventListener?: boolean | null;
|
|
74
|
+
onlyIncludeActiveItems?: boolean | null;
|
|
80
75
|
}
|
|
81
76
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
type?: string; // 'inapp' or 'subs'
|
|
77
|
+
type NitroAvailablePurchasesAndroidType = 'inapp' | 'subs';
|
|
78
|
+
|
|
79
|
+
export interface NitroAvailablePurchasesAndroidOptions {
|
|
80
|
+
type?: NitroAvailablePurchasesAndroidType;
|
|
87
81
|
}
|
|
88
82
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
interface NitroAvailablePurchasesOptions {
|
|
93
|
-
ios?: NitroAvailablePurchasesIosOptions;
|
|
94
|
-
android?: NitroAvailablePurchasesAndroidOptions;
|
|
83
|
+
export interface NitroAvailablePurchasesOptions {
|
|
84
|
+
ios?: NitroAvailablePurchasesIosOptions | null;
|
|
85
|
+
android?: NitroAvailablePurchasesAndroidOptions | null;
|
|
95
86
|
}
|
|
96
87
|
|
|
97
88
|
// Transaction finish parameters
|
|
@@ -99,32 +90,29 @@ interface NitroAvailablePurchasesOptions {
|
|
|
99
90
|
/**
|
|
100
91
|
* iOS-specific parameters for finishing a transaction
|
|
101
92
|
*/
|
|
102
|
-
interface NitroFinishTransactionIosParams {
|
|
93
|
+
export interface NitroFinishTransactionIosParams {
|
|
103
94
|
transactionId: string;
|
|
104
95
|
}
|
|
105
96
|
|
|
106
97
|
/**
|
|
107
98
|
* Android-specific parameters for finishing a transaction
|
|
108
99
|
*/
|
|
109
|
-
interface NitroFinishTransactionAndroidParams {
|
|
100
|
+
export interface NitroFinishTransactionAndroidParams {
|
|
110
101
|
purchaseToken: string;
|
|
111
|
-
isConsumable?:
|
|
102
|
+
isConsumable?: MutationFinishTransactionArgs['isConsumable'];
|
|
112
103
|
}
|
|
113
104
|
|
|
114
105
|
/**
|
|
115
106
|
* Unified finish transaction parameters with platform-specific options
|
|
116
107
|
*/
|
|
117
|
-
interface NitroFinishTransactionParams {
|
|
118
|
-
ios?: NitroFinishTransactionIosParams;
|
|
119
|
-
android?: NitroFinishTransactionAndroidParams;
|
|
108
|
+
export interface NitroFinishTransactionParams {
|
|
109
|
+
ios?: NitroFinishTransactionIosParams | null;
|
|
110
|
+
android?: NitroFinishTransactionAndroidParams | null;
|
|
120
111
|
}
|
|
121
112
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
interface NitroDeepLinkOptionsAndroid {
|
|
126
|
-
skuAndroid?: string;
|
|
127
|
-
packageNameAndroid?: string;
|
|
113
|
+
export interface NitroDeepLinkOptionsAndroid {
|
|
114
|
+
skuAndroid?: DeepLinkOptions['skuAndroid'];
|
|
115
|
+
packageNameAndroid?: DeepLinkOptions['packageNameAndroid'];
|
|
128
116
|
}
|
|
129
117
|
|
|
130
118
|
// ╔══════════════════════════════════════════════════════════════════════════╗
|
|
@@ -136,10 +124,10 @@ interface NitroDeepLinkOptionsAndroid {
|
|
|
136
124
|
*/
|
|
137
125
|
export interface NitroSubscriptionRenewalInfo {
|
|
138
126
|
autoRenewStatus: boolean;
|
|
139
|
-
autoRenewPreference?: string;
|
|
140
|
-
expirationReason?: number;
|
|
141
|
-
gracePeriodExpirationDate?: number;
|
|
142
|
-
currentProductID?: string;
|
|
127
|
+
autoRenewPreference?: string | null;
|
|
128
|
+
expirationReason?: number | null;
|
|
129
|
+
gracePeriodExpirationDate?: number | null;
|
|
130
|
+
currentProductID?: string | null;
|
|
143
131
|
platform: string;
|
|
144
132
|
}
|
|
145
133
|
|
|
@@ -149,7 +137,7 @@ export interface NitroSubscriptionRenewalInfo {
|
|
|
149
137
|
export interface NitroSubscriptionStatus {
|
|
150
138
|
state: number;
|
|
151
139
|
platform: string;
|
|
152
|
-
renewalInfo?: NitroSubscriptionRenewalInfo;
|
|
140
|
+
renewalInfo?: NitroSubscriptionRenewalInfo | null;
|
|
153
141
|
}
|
|
154
142
|
|
|
155
143
|
/**
|
|
@@ -163,108 +151,88 @@ export interface NitroPurchaseResult {
|
|
|
163
151
|
purchaseToken?: string;
|
|
164
152
|
}
|
|
165
153
|
|
|
166
|
-
/**
|
|
167
|
-
* iOS receipt validation result
|
|
168
|
-
*/
|
|
169
154
|
export interface NitroReceiptValidationResultIOS {
|
|
170
155
|
isValid: boolean;
|
|
171
156
|
receiptData: string;
|
|
172
157
|
jwsRepresentation: string;
|
|
173
|
-
latestTransaction?: NitroPurchase;
|
|
158
|
+
latestTransaction?: NitroPurchase | null;
|
|
174
159
|
}
|
|
175
160
|
|
|
176
|
-
/**
|
|
177
|
-
* Android receipt validation result
|
|
178
|
-
*/
|
|
179
161
|
export interface NitroReceiptValidationResultAndroid {
|
|
180
|
-
autoRenewing:
|
|
181
|
-
betaProduct:
|
|
182
|
-
cancelDate:
|
|
183
|
-
cancelReason:
|
|
184
|
-
deferredDate:
|
|
185
|
-
deferredSku:
|
|
186
|
-
freeTrialEndDate:
|
|
187
|
-
gracePeriodEndDate:
|
|
188
|
-
parentProductId:
|
|
189
|
-
productId:
|
|
190
|
-
productType:
|
|
191
|
-
purchaseDate:
|
|
192
|
-
quantity:
|
|
193
|
-
receiptId:
|
|
194
|
-
renewalDate:
|
|
195
|
-
term:
|
|
196
|
-
termSku:
|
|
197
|
-
testTransaction:
|
|
162
|
+
autoRenewing: ReceiptValidationResultAndroid['autoRenewing'];
|
|
163
|
+
betaProduct: ReceiptValidationResultAndroid['betaProduct'];
|
|
164
|
+
cancelDate: ReceiptValidationResultAndroid['cancelDate'];
|
|
165
|
+
cancelReason: ReceiptValidationResultAndroid['cancelReason'];
|
|
166
|
+
deferredDate: ReceiptValidationResultAndroid['deferredDate'];
|
|
167
|
+
deferredSku: ReceiptValidationResultAndroid['deferredSku'];
|
|
168
|
+
freeTrialEndDate: ReceiptValidationResultAndroid['freeTrialEndDate'];
|
|
169
|
+
gracePeriodEndDate: ReceiptValidationResultAndroid['gracePeriodEndDate'];
|
|
170
|
+
parentProductId: ReceiptValidationResultAndroid['parentProductId'];
|
|
171
|
+
productId: ReceiptValidationResultAndroid['productId'];
|
|
172
|
+
productType: ReceiptValidationResultAndroid['productType'];
|
|
173
|
+
purchaseDate: ReceiptValidationResultAndroid['purchaseDate'];
|
|
174
|
+
quantity: ReceiptValidationResultAndroid['quantity'];
|
|
175
|
+
receiptId: ReceiptValidationResultAndroid['receiptId'];
|
|
176
|
+
renewalDate: ReceiptValidationResultAndroid['renewalDate'];
|
|
177
|
+
term: ReceiptValidationResultAndroid['term'];
|
|
178
|
+
termSku: ReceiptValidationResultAndroid['termSku'];
|
|
179
|
+
testTransaction: ReceiptValidationResultAndroid['testTransaction'];
|
|
198
180
|
}
|
|
199
181
|
|
|
200
|
-
/**
|
|
201
|
-
* Purchase data structure returned from native
|
|
202
|
-
*/
|
|
203
182
|
export interface NitroPurchase {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
purchaseStateAndroid?: number;
|
|
226
|
-
isAcknowledgedAndroid?: boolean;
|
|
227
|
-
packageNameAndroid?: string;
|
|
228
|
-
obfuscatedAccountIdAndroid?: string;
|
|
229
|
-
obfuscatedProfileIdAndroid?: string;
|
|
183
|
+
id: PurchaseCommon['id'];
|
|
184
|
+
productId: PurchaseCommon['productId'];
|
|
185
|
+
transactionDate: PurchaseCommon['transactionDate'];
|
|
186
|
+
purchaseToken?: PurchaseCommon['purchaseToken'];
|
|
187
|
+
platform: PurchaseCommon['platform'];
|
|
188
|
+
quantity: PurchaseCommon['quantity'];
|
|
189
|
+
purchaseState: PurchaseCommon['purchaseState'];
|
|
190
|
+
isAutoRenewing: PurchaseCommon['isAutoRenewing'];
|
|
191
|
+
quantityIOS?: number | null;
|
|
192
|
+
originalTransactionDateIOS?: number | null;
|
|
193
|
+
originalTransactionIdentifierIOS?: string | null;
|
|
194
|
+
appAccountToken?: string | null;
|
|
195
|
+
purchaseTokenAndroid?: string | null;
|
|
196
|
+
dataAndroid?: string | null;
|
|
197
|
+
signatureAndroid?: string | null;
|
|
198
|
+
autoRenewingAndroid?: boolean | null;
|
|
199
|
+
purchaseStateAndroid?: number | null;
|
|
200
|
+
isAcknowledgedAndroid?: boolean | null;
|
|
201
|
+
packageNameAndroid?: string | null;
|
|
202
|
+
obfuscatedAccountIdAndroid?: string | null;
|
|
203
|
+
obfuscatedProfileIdAndroid?: string | null;
|
|
230
204
|
}
|
|
231
205
|
|
|
232
|
-
/**
|
|
233
|
-
* Product data structure returned from native
|
|
234
|
-
*/
|
|
235
206
|
export interface NitroProduct {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
description: string;
|
|
207
|
+
id: ProductCommon['id'];
|
|
208
|
+
title: ProductCommon['title'];
|
|
209
|
+
description: ProductCommon['description'];
|
|
240
210
|
type: string;
|
|
241
|
-
displayName?:
|
|
242
|
-
displayPrice?:
|
|
243
|
-
currency?:
|
|
244
|
-
price?:
|
|
245
|
-
platform:
|
|
246
|
-
|
|
211
|
+
displayName?: ProductCommon['displayName'];
|
|
212
|
+
displayPrice?: ProductCommon['displayPrice'];
|
|
213
|
+
currency?: ProductCommon['currency'];
|
|
214
|
+
price?: ProductCommon['price'];
|
|
215
|
+
platform: ProductCommon['platform'];
|
|
247
216
|
// iOS specific fields
|
|
248
|
-
typeIOS?: string;
|
|
249
|
-
isFamilyShareableIOS?: boolean;
|
|
250
|
-
jsonRepresentationIOS?: string;
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
217
|
+
typeIOS?: string | null;
|
|
218
|
+
isFamilyShareableIOS?: boolean | null;
|
|
219
|
+
jsonRepresentationIOS?: string | null;
|
|
220
|
+
introductoryPriceIOS?: string | null;
|
|
221
|
+
introductoryPriceAsAmountIOS?: number | null;
|
|
222
|
+
introductoryPriceNumberOfPeriodsIOS?: number | null;
|
|
223
|
+
introductoryPricePaymentModeIOS?: string | null;
|
|
224
|
+
introductoryPriceSubscriptionPeriodIOS?: string | null;
|
|
225
|
+
subscriptionPeriodNumberIOS?: number | null;
|
|
226
|
+
subscriptionPeriodUnitIOS?: string | null;
|
|
259
227
|
// Android specific fields
|
|
260
|
-
originalPriceAndroid?: string;
|
|
261
|
-
originalPriceAmountMicrosAndroid?: number;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
subscriptionPeriodAndroid?: string;
|
|
266
|
-
freeTrialPeriodAndroid?: string;
|
|
267
|
-
subscriptionOfferDetailsAndroid?: string
|
|
228
|
+
originalPriceAndroid?: string | null;
|
|
229
|
+
originalPriceAmountMicrosAndroid?: number | null;
|
|
230
|
+
introductoryPriceCyclesAndroid?: number | null;
|
|
231
|
+
introductoryPricePeriodAndroid?: string | null;
|
|
232
|
+
introductoryPriceValueAndroid?: number | null;
|
|
233
|
+
subscriptionPeriodAndroid?: string | null;
|
|
234
|
+
freeTrialPeriodAndroid?: string | null;
|
|
235
|
+
subscriptionOfferDetailsAndroid?: string | null;
|
|
268
236
|
}
|
|
269
237
|
|
|
270
238
|
// ╔══════════════════════════════════════════════════════════════════════════╗
|