react-native-iap 14.5.0 → 14.6.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +173 -7
- package/ios/HybridRnIap.swift +24 -0
- package/ios/reactnativeiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/reactnativeiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/lib/module/index.js +166 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +93 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/type-bridge.js +2 -1
- package/lib/module/utils/type-bridge.js.map +1 -1
- package/lib/typescript/src/index.d.ts +124 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +125 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +227 -15
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JBillingProgramAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JExternalLinkLaunchModeAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JExternalLinkTypeAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +13 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +100 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +4 -0
- package/nitrogen/generated/android/c++/JNitroBillingProgramAvailabilityResultAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JNitroBillingProgramReportingDetailsAndroid.hpp +63 -0
- package/nitrogen/generated/android/c++/JNitroDiscountAmountAndroid.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroDiscountDisplayInfoAndroid.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroLaunchExternalLinkParamsAndroid.hpp +75 -0
- package/nitrogen/generated/android/c++/JNitroLimitedQuantityInfoAndroid.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroOneTimePurchaseOfferDetail.hpp +70 -3
- package/nitrogen/generated/android/c++/JNitroPreorderDetailsAndroid.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroProduct.hpp +35 -5
- package/nitrogen/generated/android/c++/JNitroPurchase.hpp +7 -3
- package/nitrogen/generated/android/c++/JNitroRentalDetailsAndroid.hpp +62 -0
- package/nitrogen/generated/android/c++/JNitroValidTimeWindowAndroid.hpp +61 -0
- package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +5 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/BillingProgramAndroid.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalLinkLaunchModeAndroid.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalLinkTypeAndroid.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +16 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingProgramAvailabilityResultAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroBillingProgramReportingDetailsAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroDiscountAmountAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroDiscountDisplayInfoAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroLaunchExternalLinkParamsAndroid.kt +45 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroLimitedQuantityInfoAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroOneTimePurchaseOfferDetail.kt +30 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPreorderDetailsAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRentalDetailsAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroValidTimeWindowAndroid.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +5 -2
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +16 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +232 -18
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +36 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +66 -0
- package/nitrogen/generated/ios/swift/BillingProgramAndroid.swift +44 -0
- package/nitrogen/generated/ios/swift/ExternalLinkLaunchModeAndroid.swift +44 -0
- package/nitrogen/generated/ios/swift/ExternalLinkTypeAndroid.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroBillingProgramAvailabilityResultAndroid.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroBillingProgramReportingDetailsAndroid.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +4 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +68 -0
- package/nitrogen/generated/ios/swift/NitroBillingProgramAvailabilityResultAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/NitroBillingProgramReportingDetailsAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/NitroDiscountAmountAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/NitroDiscountDisplayInfoAndroid.swift +70 -0
- package/nitrogen/generated/ios/swift/NitroLaunchExternalLinkParamsAndroid.swift +68 -0
- package/nitrogen/generated/ios/swift/NitroLimitedQuantityInfoAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/NitroOneTimePurchaseOfferDetail.swift +211 -2
- package/nitrogen/generated/ios/swift/NitroPreorderDetailsAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/NitroProduct.swift +26 -7
- package/nitrogen/generated/ios/swift/NitroPurchase.swift +31 -1
- package/nitrogen/generated/ios/swift/NitroRentalDetailsAndroid.swift +65 -0
- package/nitrogen/generated/ios/swift/NitroValidTimeWindowAndroid.swift +46 -0
- package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +32 -2
- package/nitrogen/generated/shared/c++/BillingProgramAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/ExternalLinkLaunchModeAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/ExternalLinkTypeAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +4 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +16 -0
- package/nitrogen/generated/shared/c++/NitroBillingProgramAvailabilityResultAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroBillingProgramReportingDetailsAndroid.hpp +81 -0
- package/nitrogen/generated/shared/c++/NitroDiscountAmountAndroid.hpp +79 -0
- package/nitrogen/generated/shared/c++/NitroDiscountDisplayInfoAndroid.hpp +81 -0
- package/nitrogen/generated/shared/c++/NitroLaunchExternalLinkParamsAndroid.hpp +95 -0
- package/nitrogen/generated/shared/c++/NitroLimitedQuantityInfoAndroid.hpp +79 -0
- package/nitrogen/generated/shared/c++/NitroOneTimePurchaseOfferDetail.hpp +55 -3
- package/nitrogen/generated/shared/c++/NitroPreorderDetailsAndroid.hpp +79 -0
- package/nitrogen/generated/shared/c++/NitroProduct.hpp +6 -5
- package/nitrogen/generated/shared/c++/NitroPurchase.hpp +6 -2
- package/nitrogen/generated/shared/c++/NitroRentalDetailsAndroid.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroValidTimeWindowAndroid.hpp +79 -0
- package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +5 -1
- package/openiap-versions.json +2 -2
- package/package.json +1 -1
- package/plugin/build/src/withIAP.d.ts +3 -0
- package/plugin/build/src/withIAP.js +81 -0
- package/plugin/build/tsconfig.tsbuildinfo +1 -0
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/src/index.ts +218 -0
- package/src/specs/RnIap.nitro.ts +161 -1
- package/src/types.ts +243 -15
- package/src/utils/type-bridge.ts +1 -0
package/src/types.ts
CHANGED
|
@@ -65,6 +65,38 @@ export interface AppTransaction {
|
|
|
65
65
|
signedDate: number;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Billing program types for external content links and external offers (Android)
|
|
70
|
+
* Available in Google Play Billing Library 8.2.0+
|
|
71
|
+
*/
|
|
72
|
+
export type BillingProgramAndroid = 'unspecified' | 'external-content-link' | 'external-offer';
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Result of checking billing program availability (Android)
|
|
76
|
+
* Available in Google Play Billing Library 8.2.0+
|
|
77
|
+
*/
|
|
78
|
+
export interface BillingProgramAvailabilityResultAndroid {
|
|
79
|
+
/** The billing program that was checked */
|
|
80
|
+
billingProgram: BillingProgramAndroid;
|
|
81
|
+
/** Whether the billing program is available for the user */
|
|
82
|
+
isAvailable: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Reporting details for transactions made outside of Google Play Billing (Android)
|
|
87
|
+
* Contains the external transaction token needed for reporting
|
|
88
|
+
* Available in Google Play Billing Library 8.2.0+
|
|
89
|
+
*/
|
|
90
|
+
export interface BillingProgramReportingDetailsAndroid {
|
|
91
|
+
/** The billing program that the reporting details are associated with */
|
|
92
|
+
billingProgram: BillingProgramAndroid;
|
|
93
|
+
/**
|
|
94
|
+
* External transaction token used to report transactions made outside of Google Play Billing.
|
|
95
|
+
* This token must be used when reporting the external transaction to Google.
|
|
96
|
+
*/
|
|
97
|
+
externalTransactionToken: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
68
100
|
export interface DeepLinkOptions {
|
|
69
101
|
/** Android package name to target (required on Android) */
|
|
70
102
|
packageNameAndroid?: (string | null);
|
|
@@ -72,6 +104,34 @@ export interface DeepLinkOptions {
|
|
|
72
104
|
skuAndroid?: (string | null);
|
|
73
105
|
}
|
|
74
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Discount amount details for one-time purchase offers (Android)
|
|
109
|
+
* Available in Google Play Billing Library 7.0+
|
|
110
|
+
*/
|
|
111
|
+
export interface DiscountAmountAndroid {
|
|
112
|
+
/** Discount amount in micro-units (1,000,000 = 1 unit of currency) */
|
|
113
|
+
discountAmountMicros: string;
|
|
114
|
+
/** Formatted discount amount with currency sign (e.g., "$4.99") */
|
|
115
|
+
formattedDiscountAmount: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Discount display information for one-time purchase offers (Android)
|
|
120
|
+
* Available in Google Play Billing Library 7.0+
|
|
121
|
+
*/
|
|
122
|
+
export interface DiscountDisplayInfoAndroid {
|
|
123
|
+
/**
|
|
124
|
+
* Absolute discount amount details
|
|
125
|
+
* Only returned for fixed amount discounts
|
|
126
|
+
*/
|
|
127
|
+
discountAmount?: (DiscountAmountAndroid | null);
|
|
128
|
+
/**
|
|
129
|
+
* Percentage discount (e.g., 33 for 33% off)
|
|
130
|
+
* Only returned for percentage-based discounts
|
|
131
|
+
*/
|
|
132
|
+
percentageDiscount?: (number | null);
|
|
133
|
+
}
|
|
134
|
+
|
|
75
135
|
export interface DiscountIOS {
|
|
76
136
|
identifier: string;
|
|
77
137
|
localizedPrice?: (string | null);
|
|
@@ -155,6 +215,40 @@ export enum ErrorCode {
|
|
|
155
215
|
UserError = 'user-error'
|
|
156
216
|
}
|
|
157
217
|
|
|
218
|
+
/**
|
|
219
|
+
* Launch mode for external link flow (Android)
|
|
220
|
+
* Determines how the external URL is launched
|
|
221
|
+
* Available in Google Play Billing Library 8.2.0+
|
|
222
|
+
*/
|
|
223
|
+
export type ExternalLinkLaunchModeAndroid = 'unspecified' | 'launch-in-external-browser-or-app' | 'caller-will-launch-link';
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Link type for external link flow (Android)
|
|
227
|
+
* Specifies the type of external link destination
|
|
228
|
+
* Available in Google Play Billing Library 8.2.0+
|
|
229
|
+
*/
|
|
230
|
+
export type ExternalLinkTypeAndroid = 'unspecified' | 'link-to-digital-content-offer' | 'link-to-app-download';
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* External offer availability result (Android)
|
|
234
|
+
* @deprecated Use BillingProgramAvailabilityResultAndroid with isBillingProgramAvailableAsync instead
|
|
235
|
+
* Available in Google Play Billing Library 6.2.0+, deprecated in 8.2.0
|
|
236
|
+
*/
|
|
237
|
+
export interface ExternalOfferAvailabilityResultAndroid {
|
|
238
|
+
/** Whether external offers are available for the user */
|
|
239
|
+
isAvailable: boolean;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* External offer reporting details (Android)
|
|
244
|
+
* @deprecated Use BillingProgramReportingDetailsAndroid with createBillingProgramReportingDetailsAsync instead
|
|
245
|
+
* Available in Google Play Billing Library 6.2.0+, deprecated in 8.2.0
|
|
246
|
+
*/
|
|
247
|
+
export interface ExternalOfferReportingDetailsAndroid {
|
|
248
|
+
/** External transaction token for reporting external offer transactions */
|
|
249
|
+
externalTransactionToken: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
158
252
|
/** Result of presenting an external purchase link (iOS 18.2+) */
|
|
159
253
|
export interface ExternalPurchaseLinkResultIOS {
|
|
160
254
|
/** Optional error message if the presentation failed */
|
|
@@ -194,6 +288,33 @@ export interface InitConnectionConfig {
|
|
|
194
288
|
alternativeBillingModeAndroid?: (AlternativeBillingModeAndroid | null);
|
|
195
289
|
}
|
|
196
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Parameters for launching an external link (Android)
|
|
293
|
+
* Used with launchExternalLink to initiate external offer or app install flows
|
|
294
|
+
* Available in Google Play Billing Library 8.2.0+
|
|
295
|
+
*/
|
|
296
|
+
export interface LaunchExternalLinkParamsAndroid {
|
|
297
|
+
/** The billing program (EXTERNAL_CONTENT_LINK or EXTERNAL_OFFER) */
|
|
298
|
+
billingProgram: BillingProgramAndroid;
|
|
299
|
+
/** The external link launch mode */
|
|
300
|
+
launchMode: ExternalLinkLaunchModeAndroid;
|
|
301
|
+
/** The type of the external link */
|
|
302
|
+
linkType: ExternalLinkTypeAndroid;
|
|
303
|
+
/** The URI where the content will be accessed from */
|
|
304
|
+
linkUri: string;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Limited quantity information for one-time purchase offers (Android)
|
|
309
|
+
* Available in Google Play Billing Library 7.0+
|
|
310
|
+
*/
|
|
311
|
+
export interface LimitedQuantityInfoAndroid {
|
|
312
|
+
/** Maximum quantity a user can purchase */
|
|
313
|
+
maximumQuantity: number;
|
|
314
|
+
/** Remaining quantity the user can still purchase */
|
|
315
|
+
remainingQuantity: number;
|
|
316
|
+
}
|
|
317
|
+
|
|
197
318
|
export interface Mutation {
|
|
198
319
|
/** Acknowledge a non-consumable purchase or subscription */
|
|
199
320
|
acknowledgePurchaseAndroid: Promise<boolean>;
|
|
@@ -310,6 +431,23 @@ export type MutationVerifyPurchaseWithProviderArgs = VerifyPurchaseWithProviderP
|
|
|
310
431
|
|
|
311
432
|
export type PaymentModeIOS = 'empty' | 'free-trial' | 'pay-as-you-go' | 'pay-up-front';
|
|
312
433
|
|
|
434
|
+
/**
|
|
435
|
+
* Pre-order details for one-time purchase products (Android)
|
|
436
|
+
* Available in Google Play Billing Library 8.1.0+
|
|
437
|
+
*/
|
|
438
|
+
export interface PreorderDetailsAndroid {
|
|
439
|
+
/**
|
|
440
|
+
* Pre-order presale end time in milliseconds since epoch.
|
|
441
|
+
* This is when the presale period ends and the product will be released.
|
|
442
|
+
*/
|
|
443
|
+
preorderPresaleEndTimeMillis: string;
|
|
444
|
+
/**
|
|
445
|
+
* Pre-order release time in milliseconds since epoch.
|
|
446
|
+
* This is when the product will be available to users who pre-ordered.
|
|
447
|
+
*/
|
|
448
|
+
preorderReleaseTimeMillis: string;
|
|
449
|
+
}
|
|
450
|
+
|
|
313
451
|
export interface PricingPhaseAndroid {
|
|
314
452
|
billingCycleCount: number;
|
|
315
453
|
billingPeriod: string;
|
|
@@ -333,7 +471,11 @@ export interface ProductAndroid extends ProductCommon {
|
|
|
333
471
|
displayPrice: string;
|
|
334
472
|
id: string;
|
|
335
473
|
nameAndroid: string;
|
|
336
|
-
|
|
474
|
+
/**
|
|
475
|
+
* One-time purchase offer details including discounts (Android)
|
|
476
|
+
* Returns all eligible offers. Available in Google Play Billing Library 7.0+
|
|
477
|
+
*/
|
|
478
|
+
oneTimePurchaseOfferDetailsAndroid?: (ProductAndroidOneTimePurchaseOfferDetail[] | null);
|
|
337
479
|
platform: 'android';
|
|
338
480
|
price?: (number | null);
|
|
339
481
|
subscriptionOfferDetailsAndroid?: (ProductSubscriptionAndroidOfferDetails[] | null);
|
|
@@ -341,10 +483,41 @@ export interface ProductAndroid extends ProductCommon {
|
|
|
341
483
|
type: 'in-app';
|
|
342
484
|
}
|
|
343
485
|
|
|
486
|
+
/**
|
|
487
|
+
* One-time purchase offer details (Android)
|
|
488
|
+
* Available in Google Play Billing Library 7.0+
|
|
489
|
+
*/
|
|
344
490
|
export interface ProductAndroidOneTimePurchaseOfferDetail {
|
|
491
|
+
/**
|
|
492
|
+
* Discount display information
|
|
493
|
+
* Only available for discounted offers
|
|
494
|
+
*/
|
|
495
|
+
discountDisplayInfo?: (DiscountDisplayInfoAndroid | null);
|
|
345
496
|
formattedPrice: string;
|
|
497
|
+
/**
|
|
498
|
+
* Full (non-discounted) price in micro-units
|
|
499
|
+
* Only available for discounted offers
|
|
500
|
+
*/
|
|
501
|
+
fullPriceMicros?: (string | null);
|
|
502
|
+
/** Limited quantity information */
|
|
503
|
+
limitedQuantityInfo?: (LimitedQuantityInfoAndroid | null);
|
|
504
|
+
/** Offer ID */
|
|
505
|
+
offerId?: (string | null);
|
|
506
|
+
/** List of offer tags */
|
|
507
|
+
offerTags: string[];
|
|
508
|
+
/** Offer token for use in BillingFlowParams when purchasing */
|
|
509
|
+
offerToken: string;
|
|
510
|
+
/**
|
|
511
|
+
* Pre-order details for products available for pre-order
|
|
512
|
+
* Available in Google Play Billing Library 8.1.0+
|
|
513
|
+
*/
|
|
514
|
+
preorderDetailsAndroid?: (PreorderDetailsAndroid | null);
|
|
346
515
|
priceAmountMicros: string;
|
|
347
516
|
priceCurrencyCode: string;
|
|
517
|
+
/** Rental details for rental offers */
|
|
518
|
+
rentalDetailsAndroid?: (RentalDetailsAndroid | null);
|
|
519
|
+
/** Valid time window for the offer */
|
|
520
|
+
validTimeWindow?: (ValidTimeWindowAndroid | null);
|
|
348
521
|
}
|
|
349
522
|
|
|
350
523
|
export interface ProductCommon {
|
|
@@ -397,7 +570,11 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
|
|
|
397
570
|
displayPrice: string;
|
|
398
571
|
id: string;
|
|
399
572
|
nameAndroid: string;
|
|
400
|
-
|
|
573
|
+
/**
|
|
574
|
+
* One-time purchase offer details including discounts (Android)
|
|
575
|
+
* Returns all eligible offers. Available in Google Play Billing Library 7.0+
|
|
576
|
+
*/
|
|
577
|
+
oneTimePurchaseOfferDetailsAndroid?: (ProductAndroidOneTimePurchaseOfferDetail[] | null);
|
|
401
578
|
platform: 'android';
|
|
402
579
|
price?: (number | null);
|
|
403
580
|
subscriptionOfferDetailsAndroid: ProductSubscriptionAndroidOfferDetails[];
|
|
@@ -454,13 +631,18 @@ export interface PurchaseAndroid extends PurchaseCommon {
|
|
|
454
631
|
ids?: (string[] | null);
|
|
455
632
|
isAcknowledgedAndroid?: (boolean | null);
|
|
456
633
|
isAutoRenewing: boolean;
|
|
634
|
+
/**
|
|
635
|
+
* Whether the subscription is suspended (Android)
|
|
636
|
+
* A suspended subscription means the user's payment method failed and they need to fix it.
|
|
637
|
+
* Users should be directed to the subscription center to resolve the issue.
|
|
638
|
+
* Do NOT grant entitlements for suspended subscriptions.
|
|
639
|
+
* Available in Google Play Billing Library 8.1.0+
|
|
640
|
+
*/
|
|
641
|
+
isSuspendedAndroid?: (boolean | null);
|
|
457
642
|
obfuscatedAccountIdAndroid?: (string | null);
|
|
458
643
|
obfuscatedProfileIdAndroid?: (string | null);
|
|
459
644
|
packageNameAndroid?: (string | null);
|
|
460
|
-
/**
|
|
461
|
-
* @deprecated Use store instead
|
|
462
|
-
* @deprecated Use store instead
|
|
463
|
-
*/
|
|
645
|
+
/** @deprecated Use store instead */
|
|
464
646
|
platform: IapPlatform;
|
|
465
647
|
productId: string;
|
|
466
648
|
purchaseState: PurchaseState;
|
|
@@ -484,10 +666,7 @@ export interface PurchaseCommon {
|
|
|
484
666
|
id: string;
|
|
485
667
|
ids?: (string[] | null);
|
|
486
668
|
isAutoRenewing: boolean;
|
|
487
|
-
/**
|
|
488
|
-
* @deprecated Use store instead
|
|
489
|
-
* @deprecated Use store instead
|
|
490
|
-
*/
|
|
669
|
+
/** @deprecated Use store instead */
|
|
491
670
|
platform: IapPlatform;
|
|
492
671
|
productId: string;
|
|
493
672
|
purchaseState: PurchaseState;
|
|
@@ -522,10 +701,7 @@ export interface PurchaseIOS extends PurchaseCommon {
|
|
|
522
701
|
originalTransactionDateIOS?: (number | null);
|
|
523
702
|
originalTransactionIdentifierIOS?: (string | null);
|
|
524
703
|
ownershipTypeIOS?: (string | null);
|
|
525
|
-
/**
|
|
526
|
-
* @deprecated Use store instead
|
|
527
|
-
* @deprecated Use store instead
|
|
528
|
-
*/
|
|
704
|
+
/** @deprecated Use store instead */
|
|
529
705
|
platform: IapPlatform;
|
|
530
706
|
productId: string;
|
|
531
707
|
purchaseState: PurchaseState;
|
|
@@ -687,6 +863,20 @@ export interface RenewalInfoIOS {
|
|
|
687
863
|
willAutoRenew: boolean;
|
|
688
864
|
}
|
|
689
865
|
|
|
866
|
+
/**
|
|
867
|
+
* Rental details for one-time purchase products that can be rented (Android)
|
|
868
|
+
* Available in Google Play Billing Library 7.0+
|
|
869
|
+
*/
|
|
870
|
+
export interface RentalDetailsAndroid {
|
|
871
|
+
/**
|
|
872
|
+
* Rental expiration period in ISO 8601 format
|
|
873
|
+
* Time after rental period ends when user can still extend
|
|
874
|
+
*/
|
|
875
|
+
rentalExpirationPeriod?: (string | null);
|
|
876
|
+
/** Rental period in ISO 8601 format (e.g., P7D for 7 days) */
|
|
877
|
+
rentalPeriod: string;
|
|
878
|
+
}
|
|
879
|
+
|
|
690
880
|
export interface RequestPurchaseAndroidProps {
|
|
691
881
|
/** Personalized offer flag */
|
|
692
882
|
isOfferPersonalized?: (boolean | null);
|
|
@@ -749,12 +939,20 @@ export interface RequestSubscriptionAndroidProps {
|
|
|
749
939
|
obfuscatedProfileIdAndroid?: (string | null);
|
|
750
940
|
/** Purchase token for upgrades/downgrades */
|
|
751
941
|
purchaseTokenAndroid?: (string | null);
|
|
752
|
-
/**
|
|
942
|
+
/**
|
|
943
|
+
* Replacement mode for subscription changes
|
|
944
|
+
* @deprecated Use subscriptionProductReplacementParams instead for item-level replacement (8.1.0+)
|
|
945
|
+
*/
|
|
753
946
|
replacementModeAndroid?: (number | null);
|
|
754
947
|
/** List of subscription SKUs */
|
|
755
948
|
skus: string[];
|
|
756
949
|
/** Subscription offers */
|
|
757
950
|
subscriptionOffers?: (AndroidSubscriptionOfferInput[] | null);
|
|
951
|
+
/**
|
|
952
|
+
* Product-level replacement parameters (8.1.0+)
|
|
953
|
+
* Use this instead of replacementModeAndroid for item-level replacement
|
|
954
|
+
*/
|
|
955
|
+
subscriptionProductReplacementParams?: (SubscriptionProductReplacementParamsAndroid | null);
|
|
758
956
|
}
|
|
759
957
|
|
|
760
958
|
export interface RequestSubscriptionIosProps {
|
|
@@ -844,6 +1042,25 @@ export interface SubscriptionPeriodValueIOS {
|
|
|
844
1042
|
value: number;
|
|
845
1043
|
}
|
|
846
1044
|
|
|
1045
|
+
/**
|
|
1046
|
+
* Product-level subscription replacement parameters (Android)
|
|
1047
|
+
* Used with setSubscriptionProductReplacementParams in BillingFlowParams.ProductDetailsParams
|
|
1048
|
+
* Available in Google Play Billing Library 8.1.0+
|
|
1049
|
+
*/
|
|
1050
|
+
export interface SubscriptionProductReplacementParamsAndroid {
|
|
1051
|
+
/** The old product ID that needs to be replaced */
|
|
1052
|
+
oldProductId: string;
|
|
1053
|
+
/** The replacement mode for this product change */
|
|
1054
|
+
replacementMode: SubscriptionReplacementModeAndroid;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Replacement mode for subscription changes (Android)
|
|
1059
|
+
* These modes determine how the subscription replacement affects billing.
|
|
1060
|
+
* Available in Google Play Billing Library 8.1.0+
|
|
1061
|
+
*/
|
|
1062
|
+
export type SubscriptionReplacementModeAndroid = 'unknown-replacement-mode' | 'with-time-proration' | 'charge-prorated-price' | 'charge-full-price' | 'without-proration' | 'deferred' | 'keep-existing';
|
|
1063
|
+
|
|
847
1064
|
export interface SubscriptionStatusIOS {
|
|
848
1065
|
renewalInfo?: (RenewalInfoIOS | null);
|
|
849
1066
|
state: string;
|
|
@@ -860,6 +1077,17 @@ export interface UserChoiceBillingDetails {
|
|
|
860
1077
|
products: string[];
|
|
861
1078
|
}
|
|
862
1079
|
|
|
1080
|
+
/**
|
|
1081
|
+
* Valid time window for when an offer is available (Android)
|
|
1082
|
+
* Available in Google Play Billing Library 7.0+
|
|
1083
|
+
*/
|
|
1084
|
+
export interface ValidTimeWindowAndroid {
|
|
1085
|
+
/** End time in milliseconds since epoch */
|
|
1086
|
+
endTimeMillis: string;
|
|
1087
|
+
/** Start time in milliseconds since epoch */
|
|
1088
|
+
startTimeMillis: string;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
863
1091
|
export interface VerifyPurchaseAndroidOptions {
|
|
864
1092
|
accessToken: string;
|
|
865
1093
|
isSub?: (boolean | null);
|
package/src/utils/type-bridge.ts
CHANGED
|
@@ -478,6 +478,7 @@ export function convertNitroPurchaseToPurchase(
|
|
|
478
478
|
developerPayloadAndroid: toNullableString(
|
|
479
479
|
nitroPurchase.developerPayloadAndroid,
|
|
480
480
|
),
|
|
481
|
+
isSuspendedAndroid: toNullableBoolean(nitroPurchase.isSuspendedAndroid),
|
|
481
482
|
};
|
|
482
483
|
|
|
483
484
|
return androidPurchase;
|