react-native-iap 15.2.3 → 15.3.0
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 +31 -51
- package/android/build.gradle +92 -22
- package/android/gradle.properties +5 -1
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +24 -8
- package/android/src/main/java/com/margelo/nitro/iap/RnIapLog.kt +3 -1
- package/ios/HybridRnIap.swift +172 -73
- package/lib/module/hooks/useIAP.js +1 -1
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +138 -165
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts +22 -16
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +61 -90
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +5 -16
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +63 -49
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitro.json +0 -1
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +11 -6
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +2 -2
- package/nitrogen/generated/android/c++/JPurchaseUpdatedListenerOptions.hpp +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +4 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseUpdatedListenerOptions.kt +38 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +9 -4
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +8 -12
- package/nitrogen/generated/ios/swift/PurchaseUpdatedListenerOptions.swift +61 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +5 -2
- package/nitrogen/generated/shared/c++/PurchaseUpdatedListenerOptions.hpp +85 -0
- package/openiap-versions.json +3 -3
- package/package.json +4 -6
- package/src/hooks/useIAP.ts +23 -15
- package/src/index.ts +198 -215
- package/src/specs/RnIap.nitro.ts +10 -18
- package/src/types.ts +66 -49
package/src/specs/RnIap.nitro.ts
CHANGED
|
@@ -35,11 +35,13 @@ import type {
|
|
|
35
35
|
ExternalPurchaseCustomLinkTokenTypeIOS,
|
|
36
36
|
ExternalPurchaseLinkResultIOS,
|
|
37
37
|
ExternalPurchaseNoticeResultIOS,
|
|
38
|
+
DeveloperProvidedBillingDetailsAndroid,
|
|
38
39
|
MutationFinishTransactionArgs,
|
|
39
40
|
ProductCommon,
|
|
40
41
|
PromotionalOfferJwsInputIOS,
|
|
41
42
|
PurchaseCommon,
|
|
42
43
|
PurchaseOptions,
|
|
44
|
+
PurchaseUpdatedListenerOptions,
|
|
43
45
|
VerifyPurchaseAppleOptions,
|
|
44
46
|
VerifyPurchaseGoogleOptions,
|
|
45
47
|
VerifyPurchaseHorizonOptions,
|
|
@@ -146,6 +148,8 @@ export interface NitroReceiptValidationHorizonOptions {
|
|
|
146
148
|
userId: VerifyPurchaseHorizonOptions['userId'];
|
|
147
149
|
}
|
|
148
150
|
|
|
151
|
+
export type NitroPurchaseUpdatedListenerOptions = PurchaseUpdatedListenerOptions;
|
|
152
|
+
|
|
149
153
|
export interface NitroReceiptValidationParams {
|
|
150
154
|
apple?: NitroReceiptValidationAppleOptions | null;
|
|
151
155
|
google?: NitroReceiptValidationGoogleOptions | null;
|
|
@@ -422,19 +426,6 @@ export interface NitroBillingProgramReportingDetailsAndroid {
|
|
|
422
426
|
externalTransactionToken: string;
|
|
423
427
|
}
|
|
424
428
|
|
|
425
|
-
/**
|
|
426
|
-
* Details provided when user selects developer billing option (Android 8.3.0+)
|
|
427
|
-
* Received via DeveloperProvidedBillingListener callback in External Payments flow
|
|
428
|
-
*/
|
|
429
|
-
export interface DeveloperProvidedBillingDetailsAndroid {
|
|
430
|
-
/**
|
|
431
|
-
* External transaction token used to report transactions made through developer billing.
|
|
432
|
-
* This token must be used when reporting the external transaction to Google Play.
|
|
433
|
-
* Must be reported within 24 hours of the transaction.
|
|
434
|
-
*/
|
|
435
|
-
externalTransactionToken: string;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
429
|
/**
|
|
439
430
|
* Discount amount details for one-time purchase offers (Android)
|
|
440
431
|
*/
|
|
@@ -725,7 +716,10 @@ export interface RnIap extends HybridObject<{ios: 'swift'; android: 'kotlin'}> {
|
|
|
725
716
|
* Add a listener for purchase updates
|
|
726
717
|
* @param listener - Function to call when a purchase is updated
|
|
727
718
|
*/
|
|
728
|
-
addPurchaseUpdatedListener(
|
|
719
|
+
addPurchaseUpdatedListener(
|
|
720
|
+
listener: (purchase: NitroPurchase) => void,
|
|
721
|
+
options?: NitroPurchaseUpdatedListenerOptions,
|
|
722
|
+
): number;
|
|
729
723
|
|
|
730
724
|
/**
|
|
731
725
|
* Add a listener for purchase errors
|
|
@@ -737,11 +731,9 @@ export interface RnIap extends HybridObject<{ios: 'swift'; android: 'kotlin'}> {
|
|
|
737
731
|
|
|
738
732
|
/**
|
|
739
733
|
* Remove a purchase updated listener
|
|
740
|
-
* @param
|
|
734
|
+
* @param token - Token returned from addPurchaseUpdatedListener
|
|
741
735
|
*/
|
|
742
|
-
removePurchaseUpdatedListener(
|
|
743
|
-
listener: (purchase: NitroPurchase) => void,
|
|
744
|
-
): void;
|
|
736
|
+
removePurchaseUpdatedListener(token: number): void;
|
|
745
737
|
|
|
746
738
|
/**
|
|
747
739
|
* Remove a purchase error listener
|
package/src/types.ts
CHANGED
|
@@ -587,12 +587,12 @@ export interface LimitedQuantityInfoAndroid {
|
|
|
587
587
|
export interface Mutation {
|
|
588
588
|
/**
|
|
589
589
|
* Acknowledge a non-consumable purchase. Required within 3 days or Google auto-refunds.
|
|
590
|
-
* See: https://
|
|
590
|
+
* See: https://openiap.dev/docs/apis/android/acknowledge-purchase-android
|
|
591
591
|
*/
|
|
592
592
|
acknowledgePurchaseAndroid: Promise<boolean>;
|
|
593
593
|
/**
|
|
594
594
|
* Present the refund request sheet (iOS 15+). See also Features → Refund.
|
|
595
|
-
* See: https://
|
|
595
|
+
* See: https://openiap.dev/docs/apis/ios/begin-refund-request-ios
|
|
596
596
|
*/
|
|
597
597
|
beginRefundRequestIOS?: Promise<(string | null)>;
|
|
598
598
|
/**
|
|
@@ -600,17 +600,17 @@ export interface Mutation {
|
|
|
600
600
|
*
|
|
601
601
|
* Returns true if available, false otherwise.
|
|
602
602
|
* Throws OpenIapError.NotPrepared if billing client not ready.
|
|
603
|
-
* See: https://
|
|
603
|
+
* See: https://openiap.dev/docs/apis/android/check-alternative-billing-availability-android
|
|
604
604
|
*/
|
|
605
605
|
checkAlternativeBillingAvailabilityAndroid: Promise<boolean>;
|
|
606
606
|
/**
|
|
607
607
|
* Clear pending transactions in the queue (sandbox helper).
|
|
608
|
-
* See: https://
|
|
608
|
+
* See: https://openiap.dev/docs/apis/ios/clear-transaction-ios
|
|
609
609
|
*/
|
|
610
610
|
clearTransactionIOS: Promise<boolean>;
|
|
611
611
|
/**
|
|
612
612
|
* Consume a consumable purchase so it can be re-bought.
|
|
613
|
-
* See: https://
|
|
613
|
+
* See: https://openiap.dev/docs/apis/android/consume-purchase-android
|
|
614
614
|
*/
|
|
615
615
|
consumePurchaseAndroid: Promise<boolean>;
|
|
616
616
|
/**
|
|
@@ -620,7 +620,7 @@ export interface Mutation {
|
|
|
620
620
|
*
|
|
621
621
|
* Returns token string, or null if creation failed.
|
|
622
622
|
* Throws OpenIapError.NotPrepared if billing client not ready.
|
|
623
|
-
* See: https://
|
|
623
|
+
* See: https://openiap.dev/docs/apis/android/create-alternative-billing-token-android
|
|
624
624
|
*/
|
|
625
625
|
createAlternativeBillingTokenAndroid?: Promise<(string | null)>;
|
|
626
626
|
/**
|
|
@@ -629,27 +629,27 @@ export interface Mutation {
|
|
|
629
629
|
*
|
|
630
630
|
* Returns external transaction token needed for reporting external transactions.
|
|
631
631
|
* Throws OpenIapError.NotPrepared if billing client not ready.
|
|
632
|
-
* See: https://
|
|
632
|
+
* See: https://openiap.dev/docs/apis/android/create-billing-program-reporting-details-android
|
|
633
633
|
*/
|
|
634
634
|
createBillingProgramReportingDetailsAndroid: Promise<BillingProgramReportingDetailsAndroid>;
|
|
635
635
|
/**
|
|
636
636
|
* Open the platform's subscription management UI.
|
|
637
|
-
* See: https://
|
|
637
|
+
* See: https://openiap.dev/docs/apis/deep-link-to-subscriptions
|
|
638
638
|
*/
|
|
639
639
|
deepLinkToSubscriptions: Promise<void>;
|
|
640
640
|
/**
|
|
641
641
|
* Close the store connection and release resources.
|
|
642
|
-
* See: https://
|
|
642
|
+
* See: https://openiap.dev/docs/apis/end-connection
|
|
643
643
|
*/
|
|
644
644
|
endConnection: Promise<boolean>;
|
|
645
645
|
/**
|
|
646
646
|
* Complete a transaction after server-side verification. Required on Android within 3 days.
|
|
647
|
-
* See: https://
|
|
647
|
+
* See: https://openiap.dev/docs/apis/finish-transaction
|
|
648
648
|
*/
|
|
649
649
|
finishTransaction: Promise<void>;
|
|
650
650
|
/**
|
|
651
651
|
* Initialize the store connection. Call before any IAP API.
|
|
652
|
-
* See: https://
|
|
652
|
+
* See: https://openiap.dev/docs/apis/init-connection
|
|
653
653
|
*/
|
|
654
654
|
initConnection: Promise<boolean>;
|
|
655
655
|
/**
|
|
@@ -659,7 +659,7 @@ export interface Mutation {
|
|
|
659
659
|
* Available in Google Play Billing Library 8.2.0+.
|
|
660
660
|
* Returns availability result with isAvailable flag.
|
|
661
661
|
* Throws OpenIapError.NotPrepared if billing client not ready.
|
|
662
|
-
* See: https://
|
|
662
|
+
* See: https://openiap.dev/docs/apis/android/is-billing-program-available-android
|
|
663
663
|
*/
|
|
664
664
|
isBillingProgramAvailableAndroid: Promise<BillingProgramAvailabilityResultAndroid>;
|
|
665
665
|
/**
|
|
@@ -668,29 +668,29 @@ export interface Mutation {
|
|
|
668
668
|
*
|
|
669
669
|
* Shows Play Store dialog and optionally launches external URL.
|
|
670
670
|
* Throws OpenIapError.NotPrepared if billing client not ready.
|
|
671
|
-
* See: https://
|
|
671
|
+
* See: https://openiap.dev/docs/apis/android/launch-external-link-android
|
|
672
672
|
*/
|
|
673
673
|
launchExternalLinkAndroid: Promise<boolean>;
|
|
674
674
|
/**
|
|
675
675
|
* Show the App Store offer code redemption sheet.
|
|
676
|
-
* See: https://
|
|
676
|
+
* See: https://openiap.dev/docs/apis/ios/present-code-redemption-sheet-ios
|
|
677
677
|
*/
|
|
678
678
|
presentCodeRedemptionSheetIOS: Promise<boolean>;
|
|
679
679
|
/**
|
|
680
680
|
* Present an external purchase link, StoreKit External (iOS 16+).
|
|
681
|
-
* See: https://
|
|
681
|
+
* See: https://openiap.dev/docs/apis/ios/present-external-purchase-link-ios
|
|
682
682
|
*/
|
|
683
683
|
presentExternalPurchaseLinkIOS: Promise<ExternalPurchaseLinkResultIOS>;
|
|
684
684
|
/**
|
|
685
685
|
* Present the external purchase notice sheet (iOS 17.4+).
|
|
686
686
|
* Uses ExternalPurchase.presentNoticeSheet() which returns a token when the user continues.
|
|
687
687
|
* Reference: https://developer.apple.com/documentation/storekit/externalpurchase/presentnoticesheet()
|
|
688
|
-
* See: https://
|
|
688
|
+
* See: https://openiap.dev/docs/apis/ios/present-external-purchase-notice-sheet-ios
|
|
689
689
|
*/
|
|
690
690
|
presentExternalPurchaseNoticeSheetIOS: Promise<ExternalPurchaseNoticeResultIOS>;
|
|
691
691
|
/**
|
|
692
692
|
* Initiate a purchase or subscription flow; rely on events for final state.
|
|
693
|
-
* See: https://
|
|
693
|
+
* See: https://openiap.dev/docs/apis/request-purchase
|
|
694
694
|
*/
|
|
695
695
|
requestPurchase?: Promise<(Purchase | Purchase[] | null)>;
|
|
696
696
|
/**
|
|
@@ -699,13 +699,13 @@ export interface Mutation {
|
|
|
699
699
|
* @deprecated Use promotedProductListenerIOS to receive the productId,
|
|
700
700
|
* then call requestPurchase with that SKU instead. In StoreKit 2,
|
|
701
701
|
* promoted products can be purchased directly via the standard purchase flow.
|
|
702
|
-
* See: https://
|
|
702
|
+
* See: https://openiap.dev/docs/apis/ios/request-purchase-on-promoted-product-ios
|
|
703
703
|
* @deprecated Use promotedProductListenerIOS + requestPurchase instead
|
|
704
704
|
*/
|
|
705
705
|
requestPurchaseOnPromotedProductIOS: Promise<boolean>;
|
|
706
706
|
/**
|
|
707
707
|
* Restore non-consumable and active subscription purchases.
|
|
708
|
-
* See: https://
|
|
708
|
+
* See: https://openiap.dev/docs/apis/restore-purchases
|
|
709
709
|
*/
|
|
710
710
|
restorePurchases: Promise<void>;
|
|
711
711
|
/**
|
|
@@ -714,29 +714,29 @@ export interface Mutation {
|
|
|
714
714
|
*
|
|
715
715
|
* Returns true if user accepted, false if user canceled.
|
|
716
716
|
* Throws OpenIapError.NotPrepared if billing client not ready.
|
|
717
|
-
* See: https://
|
|
717
|
+
* See: https://openiap.dev/docs/apis/android/show-alternative-billing-dialog-android
|
|
718
718
|
*/
|
|
719
719
|
showAlternativeBillingDialogAndroid: Promise<boolean>;
|
|
720
720
|
/**
|
|
721
721
|
* Present the disclosure sheet required before linking out via ExternalPurchaseCustomLink (iOS 18.1+).
|
|
722
722
|
* Call this after a deliberate customer interaction before linking out to external purchases.
|
|
723
723
|
* Reference: https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/shownotice(type:)
|
|
724
|
-
* See: https://
|
|
724
|
+
* See: https://openiap.dev/docs/apis/ios/show-external-purchase-custom-link-notice-ios
|
|
725
725
|
*/
|
|
726
726
|
showExternalPurchaseCustomLinkNoticeIOS: Promise<ExternalPurchaseCustomLinkNoticeResultIOS>;
|
|
727
727
|
/**
|
|
728
728
|
* Present the manage-subscriptions sheet and return changed purchases (iOS 15+).
|
|
729
|
-
* See: https://
|
|
729
|
+
* See: https://openiap.dev/docs/apis/ios/show-manage-subscriptions-ios
|
|
730
730
|
*/
|
|
731
731
|
showManageSubscriptionsIOS: Promise<PurchaseIOS[]>;
|
|
732
732
|
/**
|
|
733
733
|
* Force sync transactions with the App Store (iOS 15+).
|
|
734
|
-
* See: https://
|
|
734
|
+
* See: https://openiap.dev/docs/apis/ios/sync-ios
|
|
735
735
|
*/
|
|
736
736
|
syncIOS: Promise<boolean>;
|
|
737
737
|
/**
|
|
738
738
|
* Deprecated. Validate purchase receipts with the configured providers — use verifyPurchase instead.
|
|
739
|
-
* See: https://
|
|
739
|
+
* See: https://openiap.dev/docs/features/validation#verify-purchase
|
|
740
740
|
* @deprecated Use verifyPurchase
|
|
741
741
|
*/
|
|
742
742
|
validateReceipt: Promise<VerifyPurchaseResult>;
|
|
@@ -746,14 +746,14 @@ export interface Mutation {
|
|
|
746
746
|
* + receipt/JWS metadata, VerifyPurchaseResultAndroid carries Play Store
|
|
747
747
|
* receipt fields (no isValid), and VerifyPurchaseResultHorizon uses success.
|
|
748
748
|
* Inspect the concrete variant before reading fields.
|
|
749
|
-
* See: https://
|
|
749
|
+
* See: https://openiap.dev/docs/features/validation#verify-purchase
|
|
750
750
|
*/
|
|
751
751
|
verifyPurchase: Promise<VerifyPurchaseResult>;
|
|
752
752
|
/**
|
|
753
753
|
* Verify via a managed provider without standing up your own server. The
|
|
754
754
|
* PurchaseVerificationProvider enum currently exposes only IAPKit; platform
|
|
755
755
|
* availability may differ by implementation.
|
|
756
|
-
* See: https://
|
|
756
|
+
* See: https://openiap.dev/docs/features/validation#verify-purchase-with-provider
|
|
757
757
|
*/
|
|
758
758
|
verifyPurchaseWithProvider: Promise<VerifyPurchaseWithProviderResult>;
|
|
759
759
|
}
|
|
@@ -1292,28 +1292,37 @@ export interface PurchaseOptions {
|
|
|
1292
1292
|
|
|
1293
1293
|
export type PurchaseState = 'pending' | 'purchased' | 'unknown';
|
|
1294
1294
|
|
|
1295
|
+
export interface PurchaseUpdatedListenerOptions {
|
|
1296
|
+
/**
|
|
1297
|
+
* iOS only. Defaults to true. When false, listener callbacks also receive
|
|
1298
|
+
* StoreKit replay events for a transaction ID that was already emitted during
|
|
1299
|
+
* the current connection session. Android ignores this option.
|
|
1300
|
+
*/
|
|
1301
|
+
dedupeTransactionIOS?: (boolean | null);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1295
1304
|
export type PurchaseVerificationProvider = 'iapkit';
|
|
1296
1305
|
|
|
1297
1306
|
export interface Query {
|
|
1298
1307
|
/**
|
|
1299
1308
|
* Check eligibility for the external purchase notice sheet (iOS 17.4+).
|
|
1300
1309
|
* Uses ExternalPurchase.canPresent.
|
|
1301
|
-
* See: https://
|
|
1310
|
+
* See: https://openiap.dev/docs/apis/ios/can-present-external-purchase-notice-ios
|
|
1302
1311
|
*/
|
|
1303
1312
|
canPresentExternalPurchaseNoticeIOS: Promise<boolean>;
|
|
1304
1313
|
/**
|
|
1305
1314
|
* Get the user's current entitlement for a product, using StoreKit 2 (iOS 15+).
|
|
1306
|
-
* See: https://
|
|
1315
|
+
* See: https://openiap.dev/docs/apis/ios/current-entitlement-ios
|
|
1307
1316
|
*/
|
|
1308
1317
|
currentEntitlementIOS?: Promise<(PurchaseIOS | null)>;
|
|
1309
1318
|
/**
|
|
1310
1319
|
* Fetch products or subscriptions from the store.
|
|
1311
|
-
* See: https://
|
|
1320
|
+
* See: https://openiap.dev/docs/apis/fetch-products
|
|
1312
1321
|
*/
|
|
1313
1322
|
fetchProducts: Promise<(ProductOrSubscription[] | Product[] | ProductSubscription[] | null)>;
|
|
1314
1323
|
/**
|
|
1315
1324
|
* Get details of all currently active subscriptions (filters by subscriptionIds when provided).
|
|
1316
|
-
* See: https://
|
|
1325
|
+
* See: https://openiap.dev/docs/apis/get-active-subscriptions
|
|
1317
1326
|
*/
|
|
1318
1327
|
getActiveSubscriptions: Promise<ActiveSubscription[]>;
|
|
1319
1328
|
/**
|
|
@@ -1321,92 +1330,92 @@ export interface Query {
|
|
|
1321
1330
|
* Requires the SK2ConsumableTransactionHistory Info.plist key in the host app
|
|
1322
1331
|
* for finished consumables to be included (iOS 18+).
|
|
1323
1332
|
* Unlike getAvailablePurchases, always returns the iOS-specific PurchaseIOS shape.
|
|
1324
|
-
* See: https://
|
|
1333
|
+
* See: https://openiap.dev/docs/apis/ios/get-all-transactions-ios
|
|
1325
1334
|
*/
|
|
1326
1335
|
getAllTransactionsIOS: Promise<PurchaseIOS[]>;
|
|
1327
1336
|
/**
|
|
1328
1337
|
* Fetch the app transaction (iOS 16+).
|
|
1329
|
-
* See: https://
|
|
1338
|
+
* See: https://openiap.dev/docs/apis/ios/get-app-transaction-ios
|
|
1330
1339
|
*/
|
|
1331
1340
|
getAppTransactionIOS?: Promise<(AppTransaction | null)>;
|
|
1332
1341
|
/**
|
|
1333
1342
|
* List active purchases for the current user.
|
|
1334
|
-
* See: https://
|
|
1343
|
+
* See: https://openiap.dev/docs/apis/get-available-purchases
|
|
1335
1344
|
*/
|
|
1336
1345
|
getAvailablePurchases: Promise<Purchase[]>;
|
|
1337
1346
|
/**
|
|
1338
1347
|
* Fetch a token for Apple's External Purchase Server reporting API (iOS 18.1+).
|
|
1339
1348
|
* Use this token to report transactions made through ExternalPurchaseCustomLink.
|
|
1340
1349
|
* Reference: https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/token(for:)
|
|
1341
|
-
* See: https://
|
|
1350
|
+
* See: https://openiap.dev/docs/apis/ios/get-external-purchase-custom-link-token-ios
|
|
1342
1351
|
*/
|
|
1343
1352
|
getExternalPurchaseCustomLinkTokenIOS: Promise<ExternalPurchaseCustomLinkTokenResultIOS>;
|
|
1344
1353
|
/**
|
|
1345
1354
|
* List unfinished StoreKit transactions in the queue.
|
|
1346
|
-
* See: https://
|
|
1355
|
+
* See: https://openiap.dev/docs/apis/ios/get-pending-transactions-ios
|
|
1347
1356
|
*/
|
|
1348
1357
|
getPendingTransactionsIOS: Promise<PurchaseIOS[]>;
|
|
1349
1358
|
/**
|
|
1350
1359
|
* Read the App Store-promoted product, if any (iOS 11+).
|
|
1351
|
-
* See: https://
|
|
1360
|
+
* See: https://openiap.dev/docs/apis/ios/get-promoted-product-ios
|
|
1352
1361
|
*/
|
|
1353
1362
|
getPromotedProductIOS?: Promise<(ProductIOS | null)>;
|
|
1354
1363
|
/**
|
|
1355
1364
|
* Get base64-encoded receipt data (legacy validation).
|
|
1356
|
-
* See: https://
|
|
1365
|
+
* See: https://openiap.dev/docs/apis/ios/get-receipt-data-ios
|
|
1357
1366
|
*/
|
|
1358
1367
|
getReceiptDataIOS?: Promise<(string | null)>;
|
|
1359
1368
|
/**
|
|
1360
1369
|
* Return the user's storefront country code.
|
|
1361
|
-
* See: https://
|
|
1370
|
+
* See: https://openiap.dev/docs/apis/get-storefront
|
|
1362
1371
|
*/
|
|
1363
1372
|
getStorefront: Promise<string>;
|
|
1364
1373
|
/**
|
|
1365
1374
|
* Deprecated. Get the current App Store storefront country code — use cross-platform getStorefront instead.
|
|
1366
|
-
* See: https://
|
|
1375
|
+
* See: https://openiap.dev/docs/apis/ios/get-storefront-ios
|
|
1367
1376
|
* @deprecated Use getStorefront
|
|
1368
1377
|
*/
|
|
1369
1378
|
getStorefrontIOS: Promise<string>;
|
|
1370
1379
|
/**
|
|
1371
1380
|
* Return the JWS string for a transaction (StoreKit 2).
|
|
1372
|
-
* See: https://
|
|
1381
|
+
* See: https://openiap.dev/docs/apis/ios/get-transaction-jws-ios
|
|
1373
1382
|
*/
|
|
1374
1383
|
getTransactionJwsIOS?: Promise<(string | null)>;
|
|
1375
1384
|
/**
|
|
1376
1385
|
* Check whether the user has any active subscription.
|
|
1377
|
-
* See: https://
|
|
1386
|
+
* See: https://openiap.dev/docs/apis/has-active-subscriptions
|
|
1378
1387
|
*/
|
|
1379
1388
|
hasActiveSubscriptions: Promise<boolean>;
|
|
1380
1389
|
/**
|
|
1381
1390
|
* Check eligibility for the custom-link variant of external purchase (iOS 18.1+).
|
|
1382
1391
|
* Returns true if the app can use custom external purchase links.
|
|
1383
1392
|
* Reference: https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/iseligible
|
|
1384
|
-
* See: https://
|
|
1393
|
+
* See: https://openiap.dev/docs/apis/ios/is-eligible-for-external-purchase-custom-link-ios
|
|
1385
1394
|
*/
|
|
1386
1395
|
isEligibleForExternalPurchaseCustomLinkIOS: Promise<boolean>;
|
|
1387
1396
|
/**
|
|
1388
1397
|
* Check intro-offer eligibility for a subscription group.
|
|
1389
|
-
* See: https://
|
|
1398
|
+
* See: https://openiap.dev/docs/apis/ios/is-eligible-for-intro-offer-ios
|
|
1390
1399
|
*/
|
|
1391
1400
|
isEligibleForIntroOfferIOS: Promise<boolean>;
|
|
1392
1401
|
/**
|
|
1393
1402
|
* Check whether a transaction's JWS verification passed (StoreKit 2).
|
|
1394
|
-
* See: https://
|
|
1403
|
+
* See: https://openiap.dev/docs/apis/ios/is-transaction-verified-ios
|
|
1395
1404
|
*/
|
|
1396
1405
|
isTransactionVerifiedIOS: Promise<boolean>;
|
|
1397
1406
|
/**
|
|
1398
1407
|
* Get the latest verified transaction for a product, using StoreKit 2.
|
|
1399
|
-
* See: https://
|
|
1408
|
+
* See: https://openiap.dev/docs/apis/ios/latest-transaction-ios
|
|
1400
1409
|
*/
|
|
1401
1410
|
latestTransactionIOS?: Promise<(PurchaseIOS | null)>;
|
|
1402
1411
|
/**
|
|
1403
1412
|
* Get subscription status objects from StoreKit 2 (iOS 15+).
|
|
1404
|
-
* See: https://
|
|
1413
|
+
* See: https://openiap.dev/docs/apis/ios/subscription-status-ios
|
|
1405
1414
|
*/
|
|
1406
1415
|
subscriptionStatusIOS: Promise<SubscriptionStatusIOS[]>;
|
|
1407
1416
|
/**
|
|
1408
1417
|
* Deprecated. Legacy App Store receipt validation — use verifyPurchase instead.
|
|
1409
|
-
* See: https://
|
|
1418
|
+
* See: https://openiap.dev/docs/apis/ios/validate-receipt-ios
|
|
1410
1419
|
* @deprecated Use verifyPurchase
|
|
1411
1420
|
*/
|
|
1412
1421
|
validateReceiptIOS: Promise<VerifyPurchaseResultIOS>;
|
|
@@ -1734,7 +1743,12 @@ export interface Subscription {
|
|
|
1734
1743
|
promotedProductIOS: string;
|
|
1735
1744
|
/** Fires when a purchase fails or is cancelled */
|
|
1736
1745
|
purchaseError: PurchaseError;
|
|
1737
|
-
/**
|
|
1746
|
+
/**
|
|
1747
|
+
* Fires when a purchase completes successfully or a pending purchase resolves
|
|
1748
|
+
* Options can opt iOS listeners into duplicate StoreKit transaction replays
|
|
1749
|
+
* for diagnostics; default listeners receive one event per transaction ID
|
|
1750
|
+
* during a single connection session.
|
|
1751
|
+
*/
|
|
1738
1752
|
purchaseUpdated: Purchase;
|
|
1739
1753
|
/**
|
|
1740
1754
|
* Fires when an active subscription enters a billing-issue state that needs user action
|
|
@@ -1758,6 +1772,9 @@ export interface Subscription {
|
|
|
1758
1772
|
}
|
|
1759
1773
|
|
|
1760
1774
|
|
|
1775
|
+
|
|
1776
|
+
export type SubscriptionPurchaseUpdatedArgs = (PurchaseUpdatedListenerOptions | null) | undefined;
|
|
1777
|
+
|
|
1761
1778
|
export interface SubscriptionInfoIOS {
|
|
1762
1779
|
introductoryOffer?: (SubscriptionOfferIOS | null);
|
|
1763
1780
|
promotionalOffers?: (SubscriptionOfferIOS[] | null);
|
|
@@ -2218,7 +2235,7 @@ export type SubscriptionArgsMap = {
|
|
|
2218
2235
|
developerProvidedBillingAndroid: never;
|
|
2219
2236
|
promotedProductIOS: never;
|
|
2220
2237
|
purchaseError: never;
|
|
2221
|
-
purchaseUpdated:
|
|
2238
|
+
purchaseUpdated: SubscriptionPurchaseUpdatedArgs;
|
|
2222
2239
|
subscriptionBillingIssue: never;
|
|
2223
2240
|
userChoiceBillingAndroid: never;
|
|
2224
2241
|
};
|