@capgo/native-purchases 8.9.8 → 8.9.10
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 +13 -1
- package/android/src/main/java/ee/forgr/nativepurchases/NativePurchasesPlugin.java +10 -11
- package/dist/docs.json +4 -4
- package/dist/esm/definitions.d.ts +4 -4
- package/dist/esm/definitions.js.map +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NativePurchasesPlugin/NativePurchasesPlugin+TransactionFinishing.swift +1 -1
- package/ios/Sources/NativePurchasesPlugin/NativePurchasesPlugin.swift +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,18 @@ Sell in-app purchases and subscriptions in your Capacitor app with StoreKit on i
|
|
|
16
16
|
<img src="https://raw.githubusercontent.com/Cap-go/capacitor-native-purchases/main/assets/github-social-preview.png" alt="@capgo/native-purchases for Capacitor apps" width="300" />
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
+
## Built and maintained with AI
|
|
20
|
+
|
|
21
|
+
We build, improve and fix our plugins with heavy use of AI, so issues usually get fixed in under a day and pull requests get feedback the same day. A human still reviews and merges 50+ pull requests daily.
|
|
22
|
+
|
|
23
|
+
- Most plugin issues get a fix pull request the same day, often within a couple of hours, and are usually resolved in one to two days.
|
|
24
|
+
- Every pull request goes through our AI review system, usually within minutes.
|
|
25
|
+
- Our AI pre-checks tests, code review, conventions and security, then a human validates and merges.
|
|
26
|
+
- A human, Martin, reviews and merges 50+ pull requests every day.
|
|
27
|
+
- In the last 90 days, 95% of plugin issues were resolved.
|
|
28
|
+
|
|
29
|
+
[Learn more about how we build with AI](https://capgo.app/docs/plugins/ai-engineering/)
|
|
30
|
+
|
|
19
31
|
## Key features
|
|
20
32
|
|
|
21
33
|
- **Products**: `getProducts()` and `getProduct()` return localized prices and details.
|
|
@@ -2412,7 +2424,7 @@ which is useful for determining if users are entitled to features from earlier b
|
|
|
2412
2424
|
| **`isInIntroPricePeriod`** | <code>boolean</code> | Whether the transaction is in an introductory price period. Introductory pricing is a discounted rate, different from a free trial. - `true`: Currently using introductory pricing - `false`: Not in intro period | | 1.0.0 |
|
|
2413
2425
|
| **`isInGracePeriod`** | <code>boolean</code> | Whether the transaction is in a grace period. Grace period allows users to fix payment issues while maintaining access. You typically want to continue providing access during this time. - `true`: Subscription payment failed but user still has access - `false`: Not in grace period | | 1.0.0 |
|
|
2414
2426
|
| **`needsFinish`** | <code>boolean</code> | Whether the StoreKit transaction still needs to be finished with `finishTransaction()`. Present when the transaction is returned from `getUnfinishedTransactions()` or from `transactionUpdated` while `autoFinishTransactions` is `false`. | | 8.9.0 |
|
|
2415
|
-
| **`verificationError`** | <code>string</code> | Why StoreKit could not verify this transaction. Treat the transaction as untrusted and do not grant entitlements from it. Present only on unverified entries returned by `getUnfinishedTransactions({ includeUnverified: true })`. | | 8.
|
|
2427
|
+
| **`verificationError`** | <code>string</code> | Why StoreKit could not verify this transaction. Treat the transaction as untrusted and do not grant entitlements from it. Present only on unverified entries returned by `getUnfinishedTransactions({ includeUnverified: true })`. | | 8.9.7 |
|
|
2416
2428
|
|
|
2417
2429
|
|
|
2418
2430
|
#### TransactionCommitmentInfo
|
|
@@ -103,7 +103,7 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
103
103
|
return SubscriptionOfferPurchaseResult.ok(selected.getOfferToken(), selected.getBasePlanId());
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
private final String pluginVersion = "8.9.
|
|
106
|
+
private final String pluginVersion = "8.9.10";
|
|
107
107
|
public static final String TAG = "NativePurchases";
|
|
108
108
|
private static final int BILLING_CONNECTION_MAX_ATTEMPTS = 2;
|
|
109
109
|
private static final long BILLING_SETUP_TIMEOUT_SECONDS = 5;
|
|
@@ -214,6 +214,14 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Maps the {@code productType} passed to purchaseProduct to the value it was bought as.
|
|
219
|
+
* Matches purchaseProduct, which defaults to inapp and treats anything else as a subscription.
|
|
220
|
+
*/
|
|
221
|
+
static String responseProductType(String requestedProductType) {
|
|
222
|
+
return requestedProductType == null || requestedProductType.equals("inapp") ? "inapp" : "subs";
|
|
223
|
+
}
|
|
224
|
+
|
|
217
225
|
private static String formatUtcIso8601(long timeMillis) {
|
|
218
226
|
java.text.SimpleDateFormat purchaseDateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", java.util.Locale.US);
|
|
219
227
|
purchaseDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("UTC"));
|
|
@@ -511,7 +519,7 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
511
519
|
ret.put("productIdentifier", purchase.getProducts().get(0));
|
|
512
520
|
ret.put("purchaseDate", formatUtcIso8601(purchase.getPurchaseTime()));
|
|
513
521
|
ret.put("quantity", purchase.getQuantity());
|
|
514
|
-
ret.put("productType",
|
|
522
|
+
ret.put("productType", responseProductType(purchaseCall != null ? purchaseCall.getString("productType") : null));
|
|
515
523
|
ret.put("orderId", purchase.getOrderId());
|
|
516
524
|
ret.put("purchaseToken", purchase.getPurchaseToken());
|
|
517
525
|
ret.put("isAcknowledged", purchase.isAcknowledged());
|
|
@@ -523,15 +531,6 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
523
531
|
// This would require additional Google Play API calls to get detailed subscription status
|
|
524
532
|
ret.put("willCancel", null); // Default to null, would need API call to determine actual cancellation date
|
|
525
533
|
|
|
526
|
-
// For subscriptions, try to get additional information
|
|
527
|
-
if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED && purchase.getProducts().get(0).contains("sub")) {
|
|
528
|
-
// Note: Android doesn't provide direct expiration date in Purchase object
|
|
529
|
-
// This would need to be calculated based on subscription period or fetched from Google Play API
|
|
530
|
-
ret.put("productType", "subs");
|
|
531
|
-
// For subscriptions, we can't get expiration date directly from Purchase object
|
|
532
|
-
// This would require additional Google Play API calls to get subscription details
|
|
533
|
-
}
|
|
534
|
-
|
|
535
534
|
NativePurchasesLog.d(TAG, "Resolving purchase call for product: " + purchase.getProducts().get(0));
|
|
536
535
|
if (purchaseCall != null) {
|
|
537
536
|
purchaseCall.resolve(ret);
|
package/dist/docs.json
CHANGED
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
},
|
|
457
457
|
{
|
|
458
458
|
"name": "param",
|
|
459
|
-
"text": "options.allowUnverified Finish the transaction even if StoreKit could not verify it. Defaults to `false`."
|
|
459
|
+
"text": "options.allowUnverified Finish the transaction even if StoreKit could not verify it. Defaults to `false`. Since 8.9.7."
|
|
460
460
|
},
|
|
461
461
|
{
|
|
462
462
|
"name": "since",
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
"tags": [
|
|
490
490
|
{
|
|
491
491
|
"name": "param",
|
|
492
|
-
"text": "options.includeUnverified Also return unfinished transactions StoreKit could not verify. Defaults to `false`."
|
|
492
|
+
"text": "options.includeUnverified Also return unfinished transactions StoreKit could not verify. Defaults to `false`. Since 8.9.7."
|
|
493
493
|
},
|
|
494
494
|
{
|
|
495
495
|
"name": "since",
|
|
@@ -805,7 +805,7 @@
|
|
|
805
805
|
"name": "platform"
|
|
806
806
|
},
|
|
807
807
|
{
|
|
808
|
-
"text": "android
|
|
808
|
+
"text": "android The Google Play purchase token (same value as `purchaseToken`), not the `GPA.` order ID in `orderId`",
|
|
809
809
|
"name": "platform"
|
|
810
810
|
}
|
|
811
811
|
],
|
|
@@ -1438,7 +1438,7 @@
|
|
|
1438
1438
|
"name": "verificationError",
|
|
1439
1439
|
"tags": [
|
|
1440
1440
|
{
|
|
1441
|
-
"text": "8.
|
|
1441
|
+
"text": "8.9.7",
|
|
1442
1442
|
"name": "since"
|
|
1443
1443
|
},
|
|
1444
1444
|
{
|
|
@@ -126,7 +126,7 @@ export interface Transaction {
|
|
|
126
126
|
*
|
|
127
127
|
* @since 1.0.0
|
|
128
128
|
* @platform ios Numeric string (e.g., "2000001043762129")
|
|
129
|
-
* @platform android
|
|
129
|
+
* @platform android The Google Play purchase token (same value as `purchaseToken`), not the `GPA.` order ID in `orderId`
|
|
130
130
|
*/
|
|
131
131
|
readonly transactionId: string;
|
|
132
132
|
/**
|
|
@@ -568,7 +568,7 @@ export interface Transaction {
|
|
|
568
568
|
*
|
|
569
569
|
* Present only on unverified entries returned by `getUnfinishedTransactions({ includeUnverified: true })`.
|
|
570
570
|
*
|
|
571
|
-
* @since 8.
|
|
571
|
+
* @since 8.9.7
|
|
572
572
|
* @platform ios Present when StoreKit reports the transaction as unverified
|
|
573
573
|
* @platform android Not available (Play Billing has no client-side unverified state)
|
|
574
574
|
*/
|
|
@@ -1408,7 +1408,7 @@ export interface NativePurchasesPlugin {
|
|
|
1408
1408
|
* `allowUnverified` has no effect because Play Billing has no client-side unverified state.
|
|
1409
1409
|
*
|
|
1410
1410
|
* @param options.transactionId Transaction ID from the `Transaction` object (numeric string on iOS, purchase token on Android).
|
|
1411
|
-
* @param options.allowUnverified Finish the transaction even if StoreKit could not verify it. Defaults to `false`.
|
|
1411
|
+
* @param options.allowUnverified Finish the transaction even if StoreKit could not verify it. Defaults to `false`. Since 8.9.7.
|
|
1412
1412
|
* @since 8.9.0
|
|
1413
1413
|
* @platform ios Finishes the transaction with StoreKit 2
|
|
1414
1414
|
* @platform android Acknowledges the purchase with Google Play
|
|
@@ -1432,7 +1432,7 @@ export interface NativePurchasesPlugin {
|
|
|
1432
1432
|
* to `finishTransaction({ transactionId, allowUnverified: true })` to clear them. Android has no
|
|
1433
1433
|
* client-side unverified state, so the option does not change its results.
|
|
1434
1434
|
*
|
|
1435
|
-
* @param options.includeUnverified Also return unfinished transactions StoreKit could not verify. Defaults to `false`.
|
|
1435
|
+
* @param options.includeUnverified Also return unfinished transactions StoreKit could not verify. Defaults to `false`. Since 8.9.7.
|
|
1436
1436
|
* @since 8.9.0
|
|
1437
1437
|
*/
|
|
1438
1438
|
getUnfinishedTransactions(options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,qFAAoB,CAAA;IACpB,iEAAU,CAAA;IACV,uEAAa,CAAA;IACb,iEAAU,CAAA;IACV,iEAAU,CAAA;IACV,qEAAY,CAAA;AACd,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,CAAN,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB;;OAEG;IACH,gCAAe,CAAA;IAEf;;OAEG;IACH,8BAAa,CAAA;AACf,CAAC,EAVW,aAAa,KAAb,aAAa,QAUxB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAyBX;AAzBD,WAAY,eAAe;IACzB;;OAEG;IACH,uEAAa,CAAA;IAEb;;OAEG;IACH,qFAAoB,CAAA;IAEpB;;OAEG;IACH,iFAAkB,CAAA;IAElB;;OAEG;IACH,mFAAmB,CAAA;IAEnB;;OAEG;IACH,+FAAyB,CAAA;AAC3B,CAAC,EAzBW,eAAe,KAAf,eAAe,QAyB1B;AACD,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,qIAAiD,CAAA;IAEjD;;;OAGG;IACH,qGAAiC,CAAA;IAEjC;;;;OAIG;IACH,iHAAuC,CAAA;IAEvC;;;OAGG;IACH,iGAA+B,CAAA;IAE/B;;;OAGG;IACH,2DAAY,CAAA;AACd,CAAC,EA3BW,cAAc,KAAd,cAAc,QA2BzB;AAED,MAAM,CAAN,IAAY,YA6CX;AA7CD,WAAY,YAAY;IACtB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,qCAAqB,CAAA;IAErB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,2CAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;AACnB,CAAC,EA7CW,YAAY,KAAZ,YAAY,QA6CvB;AAED,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAClC;;OAEG;IACH,+HAAoC,CAAA;IACpC;;OAEG;IACH,qIAAuC,CAAA;IACvC;;OAEG;IACH,iIAAqC,CAAA;AACvC,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport enum ATTRIBUTION_NETWORK {\n APPLE_SEARCH_ADS = 0,\n ADJUST = 1,\n APPSFLYER = 2,\n BRANCH = 3,\n TENJIN = 4,\n FACEBOOK = 5,\n}\n\nexport enum PURCHASE_TYPE {\n /**\n * A type of SKU for in-app products.\n */\n INAPP = 'inapp',\n\n /**\n * A type of SKU for subscriptions.\n */\n SUBS = 'subs',\n}\n\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport enum BILLING_FEATURE {\n /**\n * Purchase/query for subscriptions.\n */\n SUBSCRIPTIONS,\n\n /**\n * Subscriptions update/replace.\n */\n SUBSCRIPTIONS_UPDATE,\n\n /**\n * Purchase/query for in-app items on VR.\n */\n IN_APP_ITEMS_ON_VR,\n\n /**\n * Purchase/query for subscriptions on VR.\n */\n SUBSCRIPTIONS_ON_VR,\n\n /**\n * Launch a price change confirmation flow.\n */\n PRICE_CHANGE_CONFIRMATION,\n}\nexport enum PRORATION_MODE {\n UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,\n\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n IMMEDIATE_WITH_TIME_PRORATION = 1,\n\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,\n\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n IMMEDIATE_WITHOUT_PRORATION = 3,\n\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n DEFERRED = 4,\n}\n\nexport enum PACKAGE_TYPE {\n /**\n * A package that was defined with a custom identifier.\n */\n UNKNOWN = 'UNKNOWN',\n\n /**\n * A package that was defined with a custom identifier.\n */\n CUSTOM = 'CUSTOM',\n\n /**\n * A package configured with the predefined lifetime identifier.\n */\n LIFETIME = 'LIFETIME',\n\n /**\n * A package configured with the predefined annual identifier.\n */\n ANNUAL = 'ANNUAL',\n\n /**\n * A package configured with the predefined six month identifier.\n */\n SIX_MONTH = 'SIX_MONTH',\n\n /**\n * A package configured with the predefined three month identifier.\n */\n THREE_MONTH = 'THREE_MONTH',\n\n /**\n * A package configured with the predefined two month identifier.\n */\n TWO_MONTH = 'TWO_MONTH',\n\n /**\n * A package configured with the predefined monthly identifier.\n */\n MONTHLY = 'MONTHLY',\n\n /**\n * A package configured with the predefined weekly identifier.\n */\n WEEKLY = 'WEEKLY',\n}\n\nexport enum INTRO_ELIGIBILITY_STATUS {\n /**\n * doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS_UNKNOWN = 0,\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_INELIGIBLE = 1,\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_ELIGIBLE = 2,\n}\n\nexport interface Transaction {\n /**\n * Unique identifier for the transaction.\n *\n * @since 1.0.0\n * @platform ios Numeric string (e.g., \"2000001043762129\")\n * @platform android Alphanumeric string (e.g., \"GPA.1234-5678-9012-34567\")\n */\n readonly transactionId: string;\n /**\n * Receipt data for validation (base64 encoded StoreKit receipt).\n *\n * **This is the full verified receipt payload from Apple StoreKit.**\n * Send this to your backend for server-side validation with Apple's receipt verification API.\n * The receipt remains available even after refund - server validation is required to detect refunded transactions.\n *\n * **For backend validation:**\n * - Use Apple's receipt verification API: https://buy.itunes.apple.com/verifyReceipt (production)\n * - Or sandbox: https://sandbox.itunes.apple.com/verifyReceipt\n * - This contains all transaction data needed for validation\n *\n * **Note:** Apple recommends migrating to App Store Server API v2 with `jwsRepresentation` for new implementations.\n * The legacy receipt verification API continues to work but may be deprecated in the future.\n *\n * @since 1.0.0\n * @platform ios Always present\n * @platform android Not available (use purchaseToken instead)\n * @example\n * ```typescript\n * const transaction = await NativePurchases.purchaseProduct({ ... });\n * if (transaction.receipt) {\n * // Send to your backend for validation\n * await fetch('/api/validate-receipt', {\n * method: 'POST',\n * body: JSON.stringify({ receipt: transaction.receipt })\n * });\n * }\n * ```\n */\n readonly receipt?: string;\n /**\n * StoreKit 2 JSON Web Signature (JWS) payload describing the verified transaction.\n *\n * **This is the full verified receipt in JWS format (StoreKit 2).**\n * Send this to your backend when using Apple's App Store Server API v2 instead of raw receipts.\n * Only available when the transaction originated from StoreKit 2 APIs (e.g. Transaction.updates).\n *\n * **For backend validation:**\n * - Use Apple's App Store Server API v2 to decode and verify the JWS\n * - This is the modern alternative to the legacy receipt format\n * - Contains signed transaction information from Apple\n *\n * @since 7.13.2\n * @platform ios Present for StoreKit 2 transactions (iOS 15+)\n * @platform android Not available\n * @example\n * ```typescript\n * const transaction = await NativePurchases.purchaseProduct({ ... });\n * if (transaction.jwsRepresentation) {\n * // Send to your backend for validation with App Store Server API v2\n * await fetch('/api/validate-jws', {\n * method: 'POST',\n * body: JSON.stringify({ jws: transaction.jwsRepresentation })\n * });\n * }\n * ```\n */\n readonly jwsRepresentation?: string;\n /**\n * An optional obfuscated identifier that uniquely associates the transaction with a user account in your app.\n *\n * PURPOSE:\n * - Fraud detection: Helps platforms detect irregular activity (e.g., many devices purchasing on the same account)\n * - User linking: Links purchases to in-game characters, avatars, or in-app profiles\n *\n * PLATFORM DIFFERENCES:\n * - iOS: Must be a valid UUID format (e.g., \"550e8400-e29b-41d4-a716-446655440000\")\n * Apple's StoreKit 2 requires UUID format for the appAccountToken parameter\n * - Android: Can be any obfuscated string (max 64 chars), maps to Google Play's ObfuscatedAccountId\n * Google recommends using encryption or one-way hash\n *\n * SECURITY REQUIREMENTS (especially for Android):\n * - DO NOT store Personally Identifiable Information (PII) like emails in cleartext\n * - Use encryption or a one-way hash to generate an obfuscated identifier\n * - Maximum length: 64 characters (both platforms)\n * - Storing PII in cleartext will result in purchases being blocked by Google Play\n *\n * IMPLEMENTATION EXAMPLE:\n * ```typescript\n * // For iOS: Generate a deterministic UUID from user ID\n * import { v5 as uuidv5 } from 'uuid';\n * const NAMESPACE = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; // Your app's namespace UUID\n * const appAccountToken = uuidv5(userId, NAMESPACE);\n *\n * // For Android: Can also use UUID or any hashed value\n * // The same UUID approach works for both platforms\n * ```\n */\n readonly appAccountToken?: string | null;\n /**\n * Product identifier associated with the transaction.\n *\n * @since 1.0.0\n * @platform ios Always present\n * @platform android Always present\n */\n readonly productIdentifier: string;\n /**\n * Purchase date of the transaction in ISO 8601 format.\n *\n * @since 1.0.0\n * @example \"2025-10-28T06:03:19Z\"\n * @platform ios Always present\n * @platform android Always present\n */\n readonly purchaseDate: string;\n /**\n * Indicates whether this transaction is the result of a subscription upgrade.\n *\n * Useful for understanding when StoreKit generated the transaction because\n * the customer moved from a lower tier to a higher tier plan.\n *\n * @since 7.13.2\n * @platform ios Present for auto-renewable subscriptions (iOS 15+)\n * @platform android Not available\n */\n readonly isUpgraded?: boolean;\n /**\n * Original purchase date of the transaction in ISO 8601 format.\n *\n * For subscription renewals, this shows the date of the original subscription purchase,\n * while purchaseDate shows the date of the current renewal.\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions only\n * @platform android Not available\n */\n readonly originalPurchaseDate?: string;\n /**\n * Expiration date of the transaction in ISO 8601 format.\n *\n * Check this date to determine if a subscription is still valid.\n * Compare with current date: if expirationDate > now, subscription is active.\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions only\n * @platform android Not available (query Google Play Developer API instead)\n */\n readonly expirationDate?: string;\n /**\n * Whether the subscription is still active/valid.\n *\n * For iOS subscriptions, check if isActive === true to verify an active subscription.\n * For expired or refunded iOS subscriptions, this will be false.\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions only (true if expiration date is in the future)\n * @platform android Not available (check purchaseState === \"1\" instead)\n */\n readonly isActive?: boolean;\n /**\n * Date the transaction was revoked/refunded, in ISO 8601 format.\n *\n * Present when Apple revokes access due to an issue (e.g., refund or developer issue).\n *\n * @since 7.13.2\n * @platform ios Present for revoked transactions (iOS 15+)\n * @platform android Not available\n */\n readonly revocationDate?: string;\n /**\n * Reason why Apple revoked the transaction.\n *\n * Possible values:\n * - `\"developerIssue\"`: Developer-initiated refund or issue\n * - `\"other\"`: Apple-initiated (customer refund, billing problem, etc.)\n * - `\"unknown\"`: StoreKit didn't report a specific reason\n *\n * @since 7.13.2\n * @platform ios Present for revoked transactions (iOS 15+)\n * @platform android Not available\n */\n readonly revocationReason?: 'developerIssue' | 'other' | 'unknown';\n /**\n * Whether the subscription will be cancelled at the end of the billing cycle.\n *\n * - `true`: User has cancelled but subscription remains active until expiration\n * - `false`: Subscription will auto-renew\n * - `null`: Status unknown or not available\n *\n * @since 1.0.0\n * @default null\n * @platform ios Present for subscriptions only (boolean or null)\n * @platform android Always null (use Google Play Developer API for cancellation status)\n */\n readonly willCancel: boolean | null;\n /**\n * Current subscription state reported by StoreKit.\n *\n * Possible values:\n * - `\"subscribed\"`: Auto-renewing and in good standing\n * - `\"expired\"`: Lapsed with no access\n * - `\"revoked\"`: Access removed due to refund or issue\n * - `\"inGracePeriod\"`: Payment issue but still in grace access window\n * - `\"inBillingRetryPeriod\"`: StoreKit retrying failed billing\n * - `\"unknown\"`: StoreKit did not report a state\n *\n * @since 7.13.2\n * @platform ios Present for auto-renewable subscriptions (iOS 15+)\n * @platform android Not available\n */\n readonly subscriptionState?:\n | 'subscribed'\n | 'expired'\n | 'revoked'\n | 'inGracePeriod'\n | 'inBillingRetryPeriod'\n | 'unknown';\n /**\n * StoreKit billing plan type for auto-renewable subscriptions.\n *\n * - `\"upFront\"`: Standard subscription billing for the full billing period.\n * - `\"monthly\"`: Monthly billing with a 12-month commitment.\n * - `\"unknown\"`: StoreKit returned a future or unsupported value.\n *\n * @since 8.3.8\n * @platform ios Present for StoreKit transactions that include billing plan metadata.\n * @platform android Not available\n */\n readonly billingPlanType?: SubscriptionBillingPlanType;\n /**\n * Commitment metadata for monthly subscriptions with a 12-month commitment.\n *\n * Use `expirationDate` here only to display commitment progress. Continue using\n * the top-level `expirationDate` to decide whether the current billing period\n * grants entitlement access.\n *\n * @since 8.3.8\n * @platform ios Present for monthly commitment subscription transactions.\n * @platform android Not available\n */\n readonly commitmentInfo?: TransactionCommitmentInfo;\n /**\n * StoreKit renewal metadata for auto-renewable subscriptions.\n *\n * `willAutoRenew` here describes the next billing period. For monthly\n * commitment subscriptions, `commitmentInfo.willAutoRenew` describes whether\n * the next 12-month commitment renews after the current commitment ends.\n *\n * @since 8.3.8\n * @platform ios Present for verified subscription renewal info.\n * @platform android Not available\n */\n readonly renewalInfo?: SubscriptionRenewalInfo;\n /**\n * Currency code associated with StoreKit transaction pricing metadata.\n *\n * @since 8.3.8\n * @platform ios Present when StoreKit includes currency in the transaction payload.\n * @platform android Not available\n */\n readonly currencyCode?: string;\n /**\n * Purchase state of the transaction (numeric string value).\n *\n * **Android Values:**\n * - `\"1\"`: Purchase completed and valid (PURCHASED state)\n * - `\"0\"`: Payment pending (PENDING state, e.g., cash payment processing)\n * - Other numeric values: Various other states\n *\n * Always check `purchaseState === \"1\"` on Android to verify a valid purchase.\n * Refunded purchases typically disappear from getPurchases() rather than showing a different state.\n *\n * @since 1.0.0\n * @platform ios Not available (use isActive for subscriptions or receipt validation for IAP)\n * @platform android Always present\n */\n readonly purchaseState?: string;\n /**\n * Order ID associated with the transaction.\n *\n * Use this for server-side verification on Android. This is the Google Play order ID.\n *\n * @since 1.0.0\n * @example \"GPA.1234-5678-9012-34567\"\n * @platform ios Not available\n * @platform android Always present\n */\n readonly orderId?: string;\n /**\n * Purchase token associated with the transaction.\n *\n * **This is the full verified purchase token from Google Play.**\n * Send this to your backend for server-side validation with Google Play Developer API.\n * This is the Android equivalent of iOS's receipt field.\n *\n * **For backend validation:**\n * - Use Google Play Developer API v3 to verify the purchase\n * - API endpoint: androidpublisher.purchases.products.get() or purchases.subscriptions.get()\n * - This token contains all data needed for validation with Google servers\n * - Can also be used for subscription status checks and cancellation detection\n *\n * @since 1.0.0\n * @platform ios Not available (use receipt instead)\n * @platform android Always present\n * @example\n * ```typescript\n * const transaction = await NativePurchases.purchaseProduct({ ... });\n * if (transaction.purchaseToken) {\n * // Send to your backend for validation\n * await fetch('/api/validate-purchase', {\n * method: 'POST',\n * body: JSON.stringify({\n * purchaseToken: transaction.purchaseToken,\n * productId: transaction.productIdentifier\n * })\n * });\n * }\n * ```\n */\n readonly purchaseToken?: string;\n /**\n * Whether the purchase has been acknowledged.\n *\n * Purchases must be acknowledged within 3 days or they will be refunded.\n * By default, this plugin automatically acknowledges purchases unless you set\n * `autoAcknowledgePurchases: false` in purchaseProduct().\n *\n * @since 1.0.0\n * @platform ios Not available\n * @platform android Always present (should be true after successful purchase or manual acknowledgment)\n */\n readonly isAcknowledged?: boolean;\n /**\n * Quantity purchased.\n *\n * @since 1.0.0\n * @default 1\n * @platform ios 1 or higher (as specified in purchaseProduct call)\n * @platform android Always 1 (Google Play doesn't support quantity > 1)\n */\n readonly quantity?: number;\n /**\n * Product type.\n *\n * - `\"inapp\"`: One-time in-app purchase\n * - `\"subs\"`: Subscription\n *\n * @since 1.0.0\n * @platform ios Always present\n * @platform android Always present\n */\n readonly productType?: string;\n /**\n * Indicates how the user obtained access to the product.\n *\n * - `\"purchased\"`: The user purchased the product directly\n * - `\"familyShared\"`: The user has access through Family Sharing (another family member purchased it)\n *\n * This property is useful for:\n * - Detecting family sharing usage for analytics\n * - Implementing different features/limits for family-shared vs. directly purchased products\n * - Understanding your user acquisition channels\n *\n * @since 7.12.8\n * @platform ios Always present (iOS 15.0+, StoreKit 2)\n * @platform android Not available\n */\n readonly ownershipType?: 'purchased' | 'familyShared';\n /**\n * Indicates the server environment where the transaction was processed.\n *\n * - `\"Sandbox\"`: Transaction belongs to testing in the sandbox environment\n * - `\"Production\"`: Transaction belongs to a customer in the production environment\n * - `\"Xcode\"`: Transaction from StoreKit Testing in Xcode\n *\n * This property is useful for:\n * - Debugging and identifying test vs. production purchases\n * - Analytics and reporting (filtering out sandbox transactions)\n * - Server-side validation (knowing which Apple endpoint to use)\n * - Preventing test purchases from affecting production metrics\n *\n * @since 7.12.8\n * @platform ios Present on iOS 16.0+ only (not available on iOS 15)\n * @platform android Not available\n */\n readonly environment?: 'Sandbox' | 'Production' | 'Xcode';\n /**\n * Reason StoreKit generated the transaction.\n *\n * - `\"purchase\"`: Initial purchase that user made manually\n * - `\"renewal\"`: Automatically generated renewal for an auto-renewable subscription\n * - `\"unknown\"`: StoreKit did not return a reason\n *\n * @since 7.13.2\n * @platform ios Present on iOS 17.0+ (StoreKit 2 transactions)\n * @platform android Not available\n */\n readonly transactionReason?: 'purchase' | 'renewal' | 'unknown';\n /**\n * Whether the transaction is in a trial period.\n *\n * - `true`: Currently in free trial period\n * - `false`: Not in trial period\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions with trial offers\n * @platform android Present for subscriptions with trial offers\n */\n readonly isTrialPeriod?: boolean;\n /**\n * Whether the transaction is in an introductory price period.\n *\n * Introductory pricing is a discounted rate, different from a free trial.\n *\n * - `true`: Currently using introductory pricing\n * - `false`: Not in intro period\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions with intro pricing\n * @platform android Present for subscriptions with intro pricing\n */\n readonly isInIntroPricePeriod?: boolean;\n /**\n * Whether the transaction is in a grace period.\n *\n * Grace period allows users to fix payment issues while maintaining access.\n * You typically want to continue providing access during this time.\n *\n * - `true`: Subscription payment failed but user still has access\n * - `false`: Not in grace period\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions in grace period\n * @platform android Present for subscriptions in grace period\n */\n readonly isInGracePeriod?: boolean;\n /**\n * Whether the StoreKit transaction still needs to be finished with `finishTransaction()`.\n *\n * Present when the transaction is returned from `getUnfinishedTransactions()` or from\n * `transactionUpdated` while `autoFinishTransactions` is `false`.\n *\n * @since 8.9.0\n * @platform ios Present when the transaction is unfinished in StoreKit 2\n * @platform android Not available (use `isAcknowledged === false` instead)\n */\n readonly needsFinish?: boolean;\n /**\n * Why StoreKit could not verify this transaction. Treat the transaction as untrusted and do not\n * grant entitlements from it.\n *\n * Present only on unverified entries returned by `getUnfinishedTransactions({ includeUnverified: true })`.\n *\n * @since 8.10.0\n * @platform ios Present when StoreKit reports the transaction as unverified\n * @platform android Not available (Play Billing has no client-side unverified state)\n */\n readonly verificationError?: string;\n}\n\nexport interface TransactionVerificationFailedEvent {\n /**\n * Identifier of the transaction that failed verification.\n *\n * @since 7.13.2\n * @platform ios Present when StoreKit reports an unverified transaction\n * @platform android Not available\n */\n readonly transactionId: string;\n /**\n * Localized error message describing why verification failed.\n *\n * @since 7.13.2\n * @platform ios Always present\n * @platform android Not available\n */\n readonly error: string;\n}\n\n/**\n * Represents the App Transaction information from StoreKit 2.\n * This provides details about when the user originally downloaded or purchased the app,\n * which is useful for determining if users are entitled to features from earlier business models.\n *\n * @see https://developer.apple.com/documentation/storekit/supporting-business-model-changes-by-using-the-app-transaction\n * @since 7.16.0\n */\nexport interface AppTransaction {\n /**\n * The app version that the user originally purchased or downloaded.\n *\n * Use this to determine if users who originally downloaded an earlier version\n * should be entitled to features that were previously free or included.\n *\n * For iOS: This is the `CFBundleShortVersionString` (e.g., \"1.0.0\")\n * For Android: This is the `versionName` from Google Play (e.g., \"1.0.0\")\n *\n * @example \"1.0.0\"\n * @since 7.16.0\n * @platform ios Always present (iOS 16+)\n * @platform android Always present\n */\n readonly originalAppVersion: string;\n\n /**\n * The date when the user originally purchased or downloaded the app.\n * ISO 8601 format.\n *\n * @example \"2023-06-15T10:30:00Z\"\n * @since 7.16.0\n * @platform ios Always present (iOS 16+)\n * @platform android Always present\n */\n readonly originalPurchaseDate: string;\n\n /**\n * The bundle identifier of the app.\n *\n * @example \"com.example.myapp\"\n * @since 7.16.0\n * @platform ios Always present (iOS 16+)\n * @platform android Always present (package name)\n */\n readonly bundleId: string;\n\n /**\n * The current app version installed on the device.\n *\n * @example \"2.0.0\"\n * @since 7.16.0\n * @platform ios Always present\n * @platform android Always present\n */\n readonly appVersion: string;\n\n /**\n * The server environment where the app was originally purchased.\n *\n * @since 7.16.0\n * @platform ios Present (iOS 16+)\n * @platform android Not available (always null)\n */\n readonly environment?: 'Sandbox' | 'Production' | 'Xcode' | null;\n\n /**\n * The JWS (JSON Web Signature) representation of the app transaction.\n * Can be sent to your backend for server-side verification.\n *\n * @since 7.16.0\n * @platform ios Present (iOS 16+)\n * @platform android Not available\n */\n readonly jwsRepresentation?: string;\n}\n\nexport interface SubscriptionPeriod {\n /**\n * The Subscription Period number of unit.\n */\n readonly numberOfUnits: number;\n /**\n * The Subscription Period unit.\n */\n readonly unit: number;\n /**\n * Human-readable subscription period unit.\n *\n * @since 8.3.8\n */\n readonly unitString?: 'day' | 'week' | 'month' | 'year' | 'unknown';\n}\n\nexport type SubscriptionBillingPlanType = 'upFront' | 'monthly' | 'unknown';\n\nexport interface ProductCommitmentInfo {\n /**\n * Total commitment price in the local currency.\n */\n readonly price?: number;\n /**\n * Formatted total commitment price.\n */\n readonly priceString?: string;\n /**\n * Full commitment period.\n */\n readonly period?: SubscriptionPeriod;\n}\n\nexport interface SubscriptionPricingTerms {\n /**\n * Billing plan represented by this pricing entry.\n */\n readonly billingPlanType?: SubscriptionBillingPlanType;\n /**\n * Total commitment details for this billing plan.\n */\n readonly commitmentInfo?: ProductCommitmentInfo;\n /**\n * Formatted price for each billing period.\n */\n readonly billingDisplayPrice?: string;\n /**\n * Numeric price for each billing period.\n */\n readonly billingPrice?: number;\n /**\n * Duration of each billing period.\n */\n readonly billingPeriod?: SubscriptionPeriod;\n /**\n * StoreKit subscription offers that apply to this billing plan.\n */\n readonly subscriptionOffers?: StoreKitSubscriptionOffer[];\n}\n\nexport interface StoreKitSubscriptionOffer {\n /**\n * StoreKit offer identifier.\n */\n readonly identifier?: string;\n /**\n * StoreKit offer type.\n */\n readonly type?: string;\n /**\n * Offer price in the local currency.\n */\n readonly price?: number;\n /**\n * Formatted offer price.\n */\n readonly priceString?: string;\n /**\n * Offer billing period.\n */\n readonly period?: SubscriptionPeriod;\n /**\n * Number of periods the offer applies to.\n */\n readonly periodCount?: number;\n /**\n * StoreKit offer payment mode.\n */\n readonly paymentMode?: string;\n}\n\nexport interface TransactionCommitmentInfo {\n /**\n * Current billing period number within the commitment.\n */\n readonly billingPeriodNumber?: number;\n /**\n * Total number of billing periods in the commitment.\n */\n readonly totalBillingPeriods?: number;\n /**\n * End of the full commitment, in ISO 8601 format.\n */\n readonly expirationDate?: string;\n /**\n * Total commitment price in the local currency.\n */\n readonly price?: number;\n}\n\nexport interface RenewalCommitmentInfo {\n /**\n * Product StoreKit will renew into after the commitment ends.\n */\n readonly autoRenewProductId?: string;\n /**\n * Whether the subscription renews into another commitment after the current commitment ends.\n */\n readonly willAutoRenew?: boolean;\n /**\n * Billing plan StoreKit will use for the next commitment or renewal.\n */\n readonly renewalBillingPlanType?: SubscriptionBillingPlanType;\n /**\n * Renewal date for the next commitment or renewal, in ISO 8601 format.\n */\n readonly renewalDate?: string;\n /**\n * Renewal price in the local currency.\n */\n readonly renewalPrice?: number;\n}\n\nexport interface SubscriptionRenewalInfo {\n /**\n * Whether the next billing period will renew.\n */\n readonly willAutoRenew?: boolean;\n /**\n * Product StoreKit will renew into for the next billing period.\n */\n readonly autoRenewProductId?: string;\n /**\n * Billing plan StoreKit will use for the next billing period.\n */\n readonly renewalBillingPlanType?: SubscriptionBillingPlanType;\n /**\n * Next billing period renewal date, in ISO 8601 format.\n */\n readonly renewalDate?: string;\n /**\n * Next billing period renewal price in the local currency.\n */\n readonly renewalPrice?: number;\n /**\n * Currency code for renewal pricing metadata.\n */\n readonly currencyCode?: string;\n /**\n * Commitment renewal metadata for monthly subscriptions with a 12-month commitment.\n */\n readonly commitmentInfo?: RenewalCommitmentInfo;\n}\n\nexport interface SKProductDiscount {\n /**\n * The Product discount identifier.\n */\n readonly identifier: string;\n /**\n * The Product discount type.\n *\n * iOS values: 0 = introductory, 1 = promotional, 2 = win-back.\n */\n readonly type: number;\n /**\n * The Product discount price.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * The Product discount currency symbol.\n */\n readonly currencySymbol: string;\n /**\n * The Product discount currency code.\n */\n readonly currencyCode: string;\n /**\n * The Product discount paymentMode.\n */\n readonly paymentMode: number;\n /**\n * The Product discount number Of Periods.\n */\n readonly numberOfPeriods: number;\n /**\n * The Product discount subscription period.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n}\n\n/**\n * Android one-time product discount display metadata.\n *\n * @platform android Populated for discounted one-time purchase offers when available.\n * @platform ios Not available\n */\nexport interface OneTimePurchaseOfferDiscount {\n /**\n * Percentage discount off the full price.\n */\n readonly percentageDiscount?: number;\n /**\n * Absolute discount amount in micro-units (1,000,000 micro-units = 1 currency unit).\n */\n readonly discountAmountMicros?: number;\n}\n\nexport interface Product {\n /**\n * Product Id.\n *\n * Android subscriptions note:\n * - `identifier` is the base plan ID (`offerDetails.getBasePlanId()`).\n * - `planIdentifier` is the subscription product ID (`productDetails.getProductId()`).\n *\n * Android one-time products note:\n * - `identifier` is the Google Play product ID (`productDetails.getProductId()`).\n * - When multiple offers exist, `getProducts()` returns one entry per eligible offer.\n *\n * If you group/filter Android subscription results by `identifier`, you are grouping by base plan.\n */\n readonly identifier: string;\n /**\n * Description of the product.\n */\n readonly description: string;\n /**\n * Title of the product.\n */\n readonly title: string;\n /**\n * Price of the product in the local currency.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n *\n * Android subscriptions: set from the standard recurring pricing phase (see\n * `ProductPayloadMapper`). When the offer has an introductory phase, `introductoryPrice`\n * describes that phase, so a pre purchase message should include both or defer confirmation\n * to the store sheet.\n */\n readonly priceString: string;\n /**\n * Currency code for price and original price.\n */\n readonly currencyCode: string;\n /**\n * Currency symbol for price and original price.\n */\n readonly currencySymbol: string;\n /**\n * Boolean indicating if the product is sharable with family\n */\n readonly isFamilyShareable: boolean;\n /**\n * Group identifier for the product.\n */\n readonly subscriptionGroupIdentifier: string;\n /**\n * Android subscriptions only: Google Play product identifier tied to the offer/base plan set.\n */\n readonly planIdentifier?: string;\n /**\n * Android: offer token required when purchasing a specific subscription or one-time offer.\n *\n * Pass it to `purchaseProduct({ offerToken })` to buy this exact offer. It belongs to the\n * query that returned it and goes stale, so read it from the same `getProducts()` /\n * `getProduct()` call you purchase from.\n */\n readonly offerToken?: string;\n /**\n * Android: offer identifier (null/undefined for base offers).\n */\n readonly offerId?: string | null;\n /**\n * Android one-time products only: purchase option identifier (for example `buy-option`).\n *\n * @platform android Present on one-time purchase offers when available.\n * @platform ios Not available\n */\n readonly purchaseOptionId?: string;\n /**\n * Android one-time products only: full price before discount, in the local currency.\n *\n * @platform android Present on discounted one-time purchase offers when available.\n * @platform ios Not available\n */\n readonly fullPrice?: number;\n /**\n * Android one-time products only: discount metadata for discounted offers.\n *\n * @platform android Present on discounted one-time purchase offers when available.\n * @platform ios Not available\n */\n readonly discountDisplayInfo?: OneTimePurchaseOfferDiscount;\n /**\n * iOS subscriptions only: StoreKit pricing terms by billing plan.\n *\n * For subscriptions with a monthly billing plan and 12-month commitment, this\n * includes both the standard up-front plan and the monthly commitment plan.\n * Display both `billingDisplayPrice` and `commitmentInfo.priceString` before\n * starting a monthly commitment purchase.\n *\n * @since 8.3.8\n * @platform ios Present on supported StoreKit subscription products.\n * @platform android Not available\n */\n readonly pricingTerms?: SubscriptionPricingTerms[];\n /**\n * Recurring billing period for subscription products.\n *\n * @platform ios From StoreKit `subscription.subscriptionPeriod`.\n * @platform android From the standard pricing phase billing period when recurrence is\n * infinite recurring, or finite recurring on installment offers (`ProductPayloadMapper.applySubscriptionPricing`).\n * Omitted for prepaid (non-recurring) phases.\n */\n readonly subscriptionPeriod?: SubscriptionPeriod;\n /**\n * Android subscriptions only: committed payment count for installment base plans when Play\n * exposes it on the offer.\n *\n * @platform android From `InstallmentPlanDetails.getInstallmentPlanCommitmentPaymentsCount()`.\n * @platform ios Not available\n */\n readonly subscriptionBillingCycles?: number;\n /**\n * Introductory price for this product line when the store exposes it. Pair with `priceString`\n * for full subscription offer wording before purchase. iOS: from StoreKit introductory offers\n * when available. Android base subscription offers (`offerId` null): from the first pricing\n * phase when multiple phases exist (intro then recurring). Android promotional offer lines\n * (`offerId` set): null; phase pricing is not exposed on `Product`, so defer price confirmation\n * to Play checkout instead of using `priceString` alone. Mapping matches `ProductPayloadMapper`.\n */\n readonly introductoryPrice: SKProductDiscount | null;\n /**\n * Whether the current store account is eligible for an introductory offer on this subscription.\n *\n * @platform ios Set from StoreKit `isEligibleForIntroOffer` when the product has an introductory offer.\n * @platform android Always `INTRO_ELIGIBILITY_STATUS_UNKNOWN` (Google Play filters ineligible offers in billing).\n * @since 8.8.3\n */\n readonly introEligibility?: INTRO_ELIGIBILITY_STATUS;\n /**\n * The Product discounts list.\n *\n * @platform ios Populated from StoreKit promotional offers when available.\n * @platform android On base subscription offers (`offerId` null), lists promotional offers on\n * the same base plan. A promotional offer line itself returns an empty array; its pricing\n * phases are not mapped here or on `introductoryPrice`.\n */\n readonly discounts: SKProductDiscount[];\n}\n\nexport interface NativePurchasesPlugin {\n /**\n * Configure plugin-wide purchase finishing behavior.\n *\n * Call this as early as possible (ideally before other NativePurchases APIs). You can also set\n * `autoFinishTransactions` in `capacitor.config` under `plugins.NativePurchases` so iOS applies\n * the value before the native `transactionUpdated` listener starts.\n *\n * **`autoFinishTransactions` (default `true`)**\n *\n * - **iOS (StoreKit 2)**: When `true`, the plugin finishes transactions automatically for\n * `transactionUpdated`, `restorePurchases`, and `purchaseProduct` (when\n * `autoAcknowledgePurchases` is also true). When `false`, transactions stay unfinished until you call\n * `finishTransaction()` (or `acknowledgePurchase()` with the transaction ID).\n * - **Android**: When `true`, `restorePurchases()` may auto-acknowledge unacknowledged purchases\n * (recovery flow). When `false`, recovery does not acknowledge; use `acknowledgePurchase()`.\n * `purchaseProduct()` auto-acknowledges only when both `autoFinishTransactions` and\n * `autoAcknowledgePurchases` are true.\n *\n * **`autoAcknowledgePurchases`** applies only to the `purchaseProduct()` call and does not change\n * how the iOS `transactionUpdated` listener finishes transactions. Use this method (or config) for that.\n *\n * @param options.autoFinishTransactions When false, manual finishing/acknowledgment is required for the flows above.\n * @since 8.9.0\n *\n * @example\n * ```typescript\n * // capacitor.config.ts\n * export default {\n * plugins: {\n * NativePurchases: {\n * autoFinishTransactions: false,\n * },\n * },\n * };\n *\n * // Optional runtime override (affects subsequent native operations)\n * await NativePurchases.configure({ autoFinishTransactions: false });\n * ```\n */\n configure(options?: { autoFinishTransactions?: boolean }): Promise<void>;\n\n /**\n * Restores a user's previous and links their appUserIDs to any user's also using those .\n */\n restorePurchases(): Promise<void>;\n\n /**\n * Gets the App Transaction information, which provides details about when the user\n * originally downloaded or purchased the app.\n *\n * This is useful for implementing business model changes where you want to\n * grandfather users who originally downloaded an earlier version of the app.\n *\n * **Use Case Example:**\n * If your app was originally free but you're adding a subscription, you can use\n * `originalAppVersion` to check if users downloaded before the subscription was added\n * and give them free access.\n *\n * **Platform Notes:**\n * - **iOS**: Requires iOS 16.0+. Uses StoreKit 2's `AppTransaction.shared`.\n * - **Android**: Uses Google Play's install referrer data when available.\n *\n * @returns {Promise<{ appTransaction: AppTransaction }>} The app transaction info\n * @throws An error if the app transaction cannot be retrieved (iOS 15 or earlier)\n * @since 7.16.0\n *\n * @example\n * ```typescript\n * const { appTransaction } = await NativePurchases.getAppTransaction();\n *\n * // Check if user downloaded before version 2.0.0 (when subscription was added)\n * if (compareVersions(appTransaction.originalAppVersion, '2.0.0') < 0) {\n * // User gets free access - they downloaded before subscriptions\n * grantFreeAccess();\n * }\n * ```\n *\n * @see https://developer.apple.com/documentation/storekit/supporting-business-model-changes-by-using-the-app-transaction\n */\n getAppTransaction(): Promise<{ appTransaction: AppTransaction }>;\n\n /**\n * Compares the original app version from the App Transaction against a target version\n * to determine if the user is entitled to features from an earlier business model.\n *\n * This is a utility method that performs the version comparison natively, which can be\n * more reliable than JavaScript-based comparison for semantic versioning.\n *\n * **Use Case:**\n * Check if the user's original download version is older than a specific version\n * to determine if they should be grandfathered into free features.\n *\n * **Platform Differences:**\n * - iOS: Uses build number (CFBundleVersion) from AppTransaction. Requires iOS 16+.\n * - Android: Uses version name from PackageInfo (current installed version, not original).\n *\n * @param options - The comparison options\n * @param options.targetVersion - The Android version name to compare against (e.g., \"2.0.0\"). Used on Android only.\n * @param options.targetBuildNumber - The iOS build number to compare against (e.g., \"42\"). Used on iOS only.\n * @returns {Promise<{ isOlderVersion: boolean; originalAppVersion: string }>}\n * - `isOlderVersion`: true if the user's original version is older than target\n * - `originalAppVersion`: The user's original app version/build number for reference\n * @throws An error if the app transaction cannot be retrieved\n * @since 7.16.0\n *\n * @example\n * ```typescript\n * // Check if user downloaded before version 2.0.0/build 42 (when subscription was added)\n * const result = await NativePurchases.isEntitledToOldBusinessModel({\n * targetVersion: '2.0.0',\n * targetBuildNumber: '42'\n * });\n *\n * if (result.isOlderVersion) {\n * console.log(`User downloaded v${result.originalAppVersion}, granting free access`);\n * grantFreeAccess();\n * }\n * ```\n */\n isEntitledToOldBusinessModel(options: {\n targetVersion?: string;\n targetBuildNumber?: string;\n }): Promise<{ isOlderVersion: boolean; originalAppVersion: string }>;\n\n /**\n * Started purchase process for the given product.\n *\n * On Android, `offerToken` selects which offer is charged. If the token is\n * missing from the product details returned by the plugin's query, the plugin\n * rejects the purchase instead of selecting another offer. Other failures can\n * also reject the purchase. Google Play may still show a different checkout,\n * for example if the offer stops being eligible after the query, so the final\n * price is not guaranteed.\n * Offer tokens come from a specific product query and go stale, so read\n * one from the same `getProducts()` / `getProduct()` call you purchase\n * from.\n *\n * For a **subscription** (`productType: 'subs'`) the order is: an explicit\n * `offerToken`, then the first offer whose base plan matches\n * `planIdentifier`, then the first offer the store returned.\n * `planIdentifier` is the **base plan id**, which `getProducts()` reports\n * as `Product.identifier`, not `Product.planIdentifier`, which holds the\n * Play product id. It is required unless an `offerToken` is given, since\n * a token already identifies one offer on its own.\n *\n * For a **one-time product** (`productType: 'inapp'`) there is no base\n * plan, so `planIdentifier` plays no part, and an `offerToken` selects one\n * of the product's purchase offers. Without a token no offer token is set\n * at all whenever the product still has a backward-compatible purchase\n * option, which leaves the choice to Play: it charges whichever buy\n * purchase option is marked backward-compatible, which is the first\n * *created* one by default and another only if one was marked\n * `legacyCompatible`. Either way it need not be the first offer\n * `getProducts()` returned. Only for a product with no backward-compatible\n * option does the first offer in the list get used. So pass the token\n * whenever a specific one-time offer matters.\n *\n * @param options - The product to purchase\n * @param options.productIdentifier - The product identifier of the product you want to purchase.\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @param options.planIdentifier - Only Android, the identifier of the base plan you want to purchase from Google Play Console, the value `getProducts()` reports as `Product.identifier` for a subscription, not `Product.planIdentifier`. Required for Android subscriptions unless `offerToken` is given; ignored for one-time products and on iOS.\n * @param options.offerToken - Only Android, the offer token for the selected subscription or one-time product offer. Use the `offerToken` returned by `getProducts()` / `getProduct()`. For a subscription it takes precedence over `planIdentifier`, since it names one specific offer, and makes `planIdentifier` optional. When the token is absent from the plugin query result the purchase is rejected instead of falling back to another offer. Google Play may still change what the user can buy after the query. Offer tokens come from a specific product query and go stale, so read one from the same query you purchase from. Omit it to keep the previous behaviour.\n * @param options.quantity - Only iOS, the number of items you wish to purchase. Will use 1 by default.\n * @param options.billingPlanType - Only iOS, the StoreKit subscription billing plan to purchase. Use `\"monthly\"` for a monthly subscription with a 12-month commitment. Requires iOS 26.4+ and Xcode 26.5 SDK support.\n * @param options.appAccountToken - Optional identifier uniquely associated with the user's account in your app.\n * PLATFORM REQUIREMENTS:\n * - iOS: Must be a valid UUID format (StoreKit 2 requirement)\n * - Android: Can be any obfuscated string (max 64 chars), maps to ObfuscatedAccountId\n * SECURITY: DO NOT use PII like emails in cleartext - use UUID or hashed value.\n * RECOMMENDED: Use UUID v5 with deterministic generation for cross-platform compatibility.\n * @param options.isConsumable - Only Android, when true the purchase token is consumed after granting entitlement (for consumable in-app items). Defaults to false.\n * @param options.autoAcknowledgePurchases - When false, this purchase is not auto-finished/acknowledged when\n * `autoFinishTransactions` is also true. Does not disable auto-finishing on\n * the iOS `transactionUpdated` listener; use `configure({ autoFinishTransactions: false })`\n * for manual finishing across purchase and recovery flows. Defaults to true.\n * - **Android**: Must acknowledge within 3 days or Google Play will refund\n * - **iOS**: Unfinished transactions remain in the queue and may block future purchases\n */\n purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier?: string;\n offerToken?: string;\n productType?: PURCHASE_TYPE;\n quantity?: number;\n billingPlanType?: 'monthly' | 'upFront';\n appAccountToken?: string;\n isConsumable?: boolean;\n autoAcknowledgePurchases?: boolean;\n }): Promise<Transaction>;\n\n /**\n * Gets the product info associated with a list of product identifiers.\n *\n * @param options - The product identifiers you wish to retrieve information for\n * @param options.productIdentifiers - Array of product identifiers\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProducts(options: { productIdentifiers: string[]; productType?: PURCHASE_TYPE }): Promise<{ products: Product[] }>;\n\n /**\n * Gets the product info for a single product identifier.\n *\n * **⚠️ Warning:** Do not call `getProduct` concurrently using `Promise.all`.\n * The underlying native billing client does not support concurrent product\n * queries, and doing so causes a race condition that may result in errors\n * or missing data. To fetch multiple products at once, use `getProducts`\n * instead — it accepts an array of identifiers and is race-condition-free.\n *\n * @example\n * // ❌ Avoid: causes race condition\n * const [a, b] = await Promise.all([\n * NativePurchases.getProduct({ productIdentifier: 'id1' }),\n * NativePurchases.getProduct({ productIdentifier: 'id2' }),\n * ]);\n *\n * // ✅ Correct: use getProducts for multiple identifiers\n * const { products } = await NativePurchases.getProducts({ productIdentifiers: ['id1', 'id2'] });\n *\n * @param options - The product identifier you wish to retrieve information for\n * @param options.productIdentifier - The product identifier\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProduct(options: { productIdentifier: string; productType?: PURCHASE_TYPE }): Promise<{ product: Product }>;\n\n /**\n * Check if billing is supported for the current device.\n *\n *\n */\n isBillingSupported(): Promise<{ isBillingSupported: boolean }>;\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n\n /**\n * Gets all the user's purchases (both in-app purchases and subscriptions).\n * This method queries the platform's purchase history for the current user.\n *\n * @param options - Optional parameters for filtering purchases\n * @param options.productType - Only Android, filter by product type (inapp or subs). If not specified, returns both types.\n * @param options.appAccountToken - Optional filter to restrict results to purchases that used the provided account token.\n * Must be the same identifier used during purchase (UUID format for iOS, any obfuscated string for Android).\n * iOS: UUID format required. Android: Maps to ObfuscatedAccountId.\n * @param options.onlyCurrentEntitlements - iOS only. When `false` (default), uses `Transaction.all` which returns every\n * transaction ever recorded on the device. When `true`, uses\n * `Transaction.currentEntitlements` which is scoped to the signed-in Apple ID\n * and only includes currently active entitlements. Set to `true` to prevent\n * cross-account purchase leakage on shared or refurbished devices.\n * @returns {Promise<{ purchases: Transaction[] }>} Promise that resolves with array of user's purchases\n * @throws An error if the purchase query fails\n * @since 7.2.0\n */\n getPurchases(options?: {\n productType?: PURCHASE_TYPE;\n appAccountToken?: string;\n onlyCurrentEntitlements?: boolean;\n }): Promise<{ purchases: Transaction[] }>;\n\n /**\n * Opens the platform's native subscription management page.\n * This allows users to view, modify, or cancel their subscriptions.\n *\n * - iOS: Opens the App Store subscription management page for the current app\n * - Android: Opens the Google Play subscription management page\n *\n * @returns {Promise<void>} Promise that resolves when the management page is opened\n * @throws An error if the subscription management page cannot be opened\n * @since 7.10.0\n */\n manageSubscriptions(): Promise<void>;\n\n /**\n * Presents the App Store offer code redemption sheet so users can redeem a subscription offer code in your app.\n *\n * iOS: Uses StoreKit's `AppStore.presentOfferCodeRedeemSheet(in:)` to display the system redemption UI (iOS 16.0+).\n *\n * @returns {Promise<void>} Promise that resolves when the redemption sheet is presented\n * @throws An error if the offer code redemption sheet cannot be presented\n * @since 8.6.0\n * @platform ios\n *\n * @see https://developer.apple.com/documentation/storekit/appstore/presentoffercoderedeemsheet(in:)\n */\n presentOfferCodeRedeemSheet(): Promise<void>;\n\n /**\n * Manually acknowledge/finish a purchase transaction.\n *\n * Call this when automatic finishing or acknowledgment is disabled, for example\n * `purchaseProduct({ autoAcknowledgePurchases: false })`, `configure({ autoFinishTransactions: false })`\n * (Android recovery or iOS updates), or when a returned transaction has `needsFinish: true`.\n *\n * **Platform Behavior:**\n * - **Android**: Acknowledges the purchase with Google Play. Must be called within 3 days or the purchase will be refunded.\n * - **iOS**: Finishes the transaction with StoreKit 2. Unfinished transactions remain in the queue and may block future purchases.\n *\n * **Acknowledgment Options:**\n *\n * **1. Client-side (this method)**: Call from your app after validation\n * ```typescript\n * await NativePurchases.acknowledgePurchase({\n * purchaseToken: transaction.purchaseToken // Android: purchaseToken, iOS: transactionId\n * });\n * ```\n *\n * **2. Server-side (Android only, recommended for security)**: Use Google Play Developer API v3\n * - Endpoint: `POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge`\n * - Requires OAuth 2.0 authentication with appropriate scopes\n * - See: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/acknowledge\n * - For subscriptions: Use `/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge` instead\n * - Note: iOS has no server-side finish API\n *\n * **When to use manual acknowledgment:**\n * - Server-side validation: Verify the purchase with your backend before acknowledging\n * - Entitlement delivery: Ensure user receives content/features before acknowledging\n * - Multi-step workflows: Complete all steps before final acknowledgment\n * - Security: Prevent client-side manipulation by handling acknowledgment server-side (Android only)\n *\n * @param options - The purchase to acknowledge\n * @param options.purchaseToken - The purchase token (Android) or transaction ID as string (iOS) from the Transaction object\n * @returns {Promise<void>} Promise that resolves when the purchase is acknowledged/finished\n * @throws An error if acknowledgment/finishing fails or transaction not found\n * @platform android Acknowledges the purchase with Google Play\n * @platform ios Finishes the transaction with StoreKit 2\n * @since 7.14.0\n *\n * @example\n * ```typescript\n * // Client-side acknowledgment\n * const transaction = await NativePurchases.purchaseProduct({\n * productIdentifier: 'premium_feature',\n * autoAcknowledgePurchases: false\n * });\n *\n * // Validate with your backend\n * const isValid = await fetch('/api/validate-purchase', {\n * method: 'POST',\n * body: JSON.stringify({ purchaseToken: transaction.purchaseToken })\n * });\n *\n * if (isValid) {\n * // Option 1: Acknowledge from client\n * await NativePurchases.acknowledgePurchase({\n * purchaseToken: transaction.purchaseToken\n * });\n *\n * // Option 2: Or let your backend acknowledge via Google Play API\n * // Your backend calls Google Play Developer API\n * }\n * ```\n */\n acknowledgePurchase(options: { purchaseToken: string }): Promise<void>;\n\n /**\n * Finish a StoreKit 2 transaction on iOS after you validate delivery on your backend.\n *\n * Equivalent to `acknowledgePurchase({ purchaseToken: transactionId })` on iOS. Safe to call more\n * than once; finishing an already finished transaction resolves successfully.\n *\n * A transaction StoreKit could not verify is rejected unless `allowUnverified` is `true`. Finishing\n * one only removes it from the queue so StoreKit stops re-delivering it; never grant entitlements from it.\n *\n * **Android**: Acknowledges the purchase, using `transactionId` as the purchase token. Use\n * `consumePurchase({ purchaseToken })` instead for consumables that must be purchasable again.\n * `allowUnverified` has no effect because Play Billing has no client-side unverified state.\n *\n * @param options.transactionId Transaction ID from the `Transaction` object (numeric string on iOS, purchase token on Android).\n * @param options.allowUnverified Finish the transaction even if StoreKit could not verify it. Defaults to `false`.\n * @since 8.9.0\n * @platform ios Finishes the transaction with StoreKit 2\n * @platform android Acknowledges the purchase with Google Play\n */\n finishTransaction(options: { transactionId: string; allowUnverified?: boolean }): Promise<void>;\n\n /**\n * Returns transactions that still need finishing on iOS, or unacknowledged purchases on Android.\n *\n * Use on app launch when `autoFinishTransactions` is `false` to recover work after a restart.\n *\n * **Android recovery:** After validation, call `consumePurchase({ purchaseToken })` for consumable\n * in-app products (acknowledges and consumes). Call `acknowledgePurchase({ purchaseToken })` for\n * non-consumables and subscriptions. Includes only purchases in the `PURCHASED` state that are not\n * yet acknowledged. Pending purchases are excluded until Google Play marks them purchased.\n *\n * **Unverified transactions:** With `includeUnverified: true`, iOS also returns transactions StoreKit\n * could not verify, each with `verificationError` set. Do not grant entitlements from those; pass them\n * to `finishTransaction({ transactionId, allowUnverified: true })` to clear them. Android has no\n * client-side unverified state, so the option does not change its results.\n *\n * @param options.includeUnverified Also return unfinished transactions StoreKit could not verify. Defaults to `false`.\n * @since 8.9.0\n */\n getUnfinishedTransactions(options?: { includeUnverified?: boolean }): Promise<{ transactions: Transaction[] }>;\n\n /**\n * Consume an in-app purchase on Android.\n *\n * Consuming a purchase does two things:\n * 1. Acknowledges the purchase (so you don't need to call acknowledgePurchase separately)\n * 2. Removes ownership, allowing the user to buy the same product again\n *\n * Use this for consumable products like virtual currency, extra lives, or credits.\n *\n * **Important:** In Google Play Billing Library 8.x, consumed purchases can no longer\n * be queried via getPurchases(). Once consumed, the purchase is gone.\n *\n * Android only — iOS does not have a separate consume concept.\n * On iOS and web, this method rejects with an error.\n *\n * @param options - The purchase to consume\n * @param options.purchaseToken - The purchase token from the Transaction object\n * @returns {Promise<void>} Promise that resolves when the purchase is consumed\n * @throws Error if consumption fails, token is invalid, or called on iOS/web\n * @platform android\n * @since 8.2.0\n *\n * @example\n * ```typescript\n * const transaction = await NativePurchases.purchaseProduct({\n * productIdentifier: 'coins_100',\n * isConsumable: false,\n * autoAcknowledgePurchases: false\n * });\n *\n * // Validate with your backend first\n * const isValid = await validateWithServer(transaction.purchaseToken);\n *\n * if (isValid) {\n * // Grant the coins, then consume to allow re-purchase\n * await NativePurchases.consumePurchase({\n * purchaseToken: transaction.purchaseToken!\n * });\n * }\n * ```\n */\n consumePurchase(options: { purchaseToken: string }): Promise<void>;\n\n /**\n * Get the user's current App Store / Google Play storefront — the country\n * their store account is registered to.\n *\n * iOS: reads StoreKit 2 `Storefront.current`. `countryCode` is ISO 3166-1\n * **alpha-3** (e.g. `\"USA\"`) and `storefrontId` is the Apple-defined\n * storefront identifier.\n * Android: reads Google Play Billing `getBillingConfigAsync()`. `countryCode`\n * is ISO 3166-1 **alpha-2** (e.g. `\"US\"`); `storefrontId` is omitted (Google\n * Play has no storefront-id concept).\n *\n * Contract note (future-major default candidate): `countryCode` is returned in\n * each store's native format and is intentionally NOT normalized across\n * platforms today (iOS alpha-3 vs Android alpha-2), to stay faithful to the\n * platform APIs. Normalizing both to a single scheme (e.g. ISO 3166-1 alpha-2)\n * is a candidate default change for the next Capacitor major, deferred so it\n * can be adopted deliberately rather than as a mid-major breaking change.\n *\n * Resolves a `countryCode` of `\"\"` (it does not reject) when the storefront\n * can't be determined on either platform — e.g. apps distributed via iOS\n * alternative distribution, or Google Play billing being unavailable.\n *\n * Useful for region-dependent logic such as localized offers/pricing and\n * gating external-purchase entitlements, whose eligibility the platforms key\n * to the storefront country. Read it live rather than caching, since the user\n * can change their store region.\n *\n * @returns {Promise<{ countryCode: string; storefrontId?: string }>} the current storefront\n * @since 8.5.0\n *\n * @example\n * ```typescript\n * const { countryCode } = await NativePurchases.getStorefront();\n * if (countryCode === 'USA' || countryCode === 'US') {\n * // show US-specific payment options\n * }\n * ```\n */\n getStorefront(): Promise<{ countryCode: string; storefrontId?: string }>;\n\n /**\n * Listen for StoreKit transaction updates delivered by Apple's Transaction.updates.\n * Fires on app launch if there are unfinished transactions, and for any updates afterward.\n *\n * When `autoFinishTransactions` is `true` (default), the plugin finishes each verified transaction\n * before emitting the event. When `false`, the event includes `needsFinish: true` and you must call\n * `finishTransaction()` after backend validation.\n *\n * iOS only.\n */\n addListener(\n eventName: 'transactionUpdated',\n listenerFunc: (transaction: Transaction) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for StoreKit transaction verification failures delivered by Apple's Transaction.updates.\n * Fires when the verification result is unverified.\n * iOS only.\n */\n addListener(\n eventName: 'transactionVerificationFailed',\n listenerFunc: (payload: TransactionVerificationFailedEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n /** Remove all registered listeners */\n removeAllListeners(): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,qFAAoB,CAAA;IACpB,iEAAU,CAAA;IACV,uEAAa,CAAA;IACb,iEAAU,CAAA;IACV,iEAAU,CAAA;IACV,qEAAY,CAAA;AACd,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,CAAN,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB;;OAEG;IACH,gCAAe,CAAA;IAEf;;OAEG;IACH,8BAAa,CAAA;AACf,CAAC,EAVW,aAAa,KAAb,aAAa,QAUxB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAyBX;AAzBD,WAAY,eAAe;IACzB;;OAEG;IACH,uEAAa,CAAA;IAEb;;OAEG;IACH,qFAAoB,CAAA;IAEpB;;OAEG;IACH,iFAAkB,CAAA;IAElB;;OAEG;IACH,mFAAmB,CAAA;IAEnB;;OAEG;IACH,+FAAyB,CAAA;AAC3B,CAAC,EAzBW,eAAe,KAAf,eAAe,QAyB1B;AACD,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,qIAAiD,CAAA;IAEjD;;;OAGG;IACH,qGAAiC,CAAA;IAEjC;;;;OAIG;IACH,iHAAuC,CAAA;IAEvC;;;OAGG;IACH,iGAA+B,CAAA;IAE/B;;;OAGG;IACH,2DAAY,CAAA;AACd,CAAC,EA3BW,cAAc,KAAd,cAAc,QA2BzB;AAED,MAAM,CAAN,IAAY,YA6CX;AA7CD,WAAY,YAAY;IACtB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,qCAAqB,CAAA;IAErB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,2CAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;AACnB,CAAC,EA7CW,YAAY,KAAZ,YAAY,QA6CvB;AAED,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAClC;;OAEG;IACH,+HAAoC,CAAA;IACpC;;OAEG;IACH,qIAAuC,CAAA;IACvC;;OAEG;IACH,iIAAqC,CAAA;AACvC,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport enum ATTRIBUTION_NETWORK {\n APPLE_SEARCH_ADS = 0,\n ADJUST = 1,\n APPSFLYER = 2,\n BRANCH = 3,\n TENJIN = 4,\n FACEBOOK = 5,\n}\n\nexport enum PURCHASE_TYPE {\n /**\n * A type of SKU for in-app products.\n */\n INAPP = 'inapp',\n\n /**\n * A type of SKU for subscriptions.\n */\n SUBS = 'subs',\n}\n\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport enum BILLING_FEATURE {\n /**\n * Purchase/query for subscriptions.\n */\n SUBSCRIPTIONS,\n\n /**\n * Subscriptions update/replace.\n */\n SUBSCRIPTIONS_UPDATE,\n\n /**\n * Purchase/query for in-app items on VR.\n */\n IN_APP_ITEMS_ON_VR,\n\n /**\n * Purchase/query for subscriptions on VR.\n */\n SUBSCRIPTIONS_ON_VR,\n\n /**\n * Launch a price change confirmation flow.\n */\n PRICE_CHANGE_CONFIRMATION,\n}\nexport enum PRORATION_MODE {\n UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,\n\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n IMMEDIATE_WITH_TIME_PRORATION = 1,\n\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,\n\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n IMMEDIATE_WITHOUT_PRORATION = 3,\n\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n DEFERRED = 4,\n}\n\nexport enum PACKAGE_TYPE {\n /**\n * A package that was defined with a custom identifier.\n */\n UNKNOWN = 'UNKNOWN',\n\n /**\n * A package that was defined with a custom identifier.\n */\n CUSTOM = 'CUSTOM',\n\n /**\n * A package configured with the predefined lifetime identifier.\n */\n LIFETIME = 'LIFETIME',\n\n /**\n * A package configured with the predefined annual identifier.\n */\n ANNUAL = 'ANNUAL',\n\n /**\n * A package configured with the predefined six month identifier.\n */\n SIX_MONTH = 'SIX_MONTH',\n\n /**\n * A package configured with the predefined three month identifier.\n */\n THREE_MONTH = 'THREE_MONTH',\n\n /**\n * A package configured with the predefined two month identifier.\n */\n TWO_MONTH = 'TWO_MONTH',\n\n /**\n * A package configured with the predefined monthly identifier.\n */\n MONTHLY = 'MONTHLY',\n\n /**\n * A package configured with the predefined weekly identifier.\n */\n WEEKLY = 'WEEKLY',\n}\n\nexport enum INTRO_ELIGIBILITY_STATUS {\n /**\n * doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS_UNKNOWN = 0,\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_INELIGIBLE = 1,\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_ELIGIBLE = 2,\n}\n\nexport interface Transaction {\n /**\n * Unique identifier for the transaction.\n *\n * @since 1.0.0\n * @platform ios Numeric string (e.g., \"2000001043762129\")\n * @platform android The Google Play purchase token (same value as `purchaseToken`), not the `GPA.` order ID in `orderId`\n */\n readonly transactionId: string;\n /**\n * Receipt data for validation (base64 encoded StoreKit receipt).\n *\n * **This is the full verified receipt payload from Apple StoreKit.**\n * Send this to your backend for server-side validation with Apple's receipt verification API.\n * The receipt remains available even after refund - server validation is required to detect refunded transactions.\n *\n * **For backend validation:**\n * - Use Apple's receipt verification API: https://buy.itunes.apple.com/verifyReceipt (production)\n * - Or sandbox: https://sandbox.itunes.apple.com/verifyReceipt\n * - This contains all transaction data needed for validation\n *\n * **Note:** Apple recommends migrating to App Store Server API v2 with `jwsRepresentation` for new implementations.\n * The legacy receipt verification API continues to work but may be deprecated in the future.\n *\n * @since 1.0.0\n * @platform ios Always present\n * @platform android Not available (use purchaseToken instead)\n * @example\n * ```typescript\n * const transaction = await NativePurchases.purchaseProduct({ ... });\n * if (transaction.receipt) {\n * // Send to your backend for validation\n * await fetch('/api/validate-receipt', {\n * method: 'POST',\n * body: JSON.stringify({ receipt: transaction.receipt })\n * });\n * }\n * ```\n */\n readonly receipt?: string;\n /**\n * StoreKit 2 JSON Web Signature (JWS) payload describing the verified transaction.\n *\n * **This is the full verified receipt in JWS format (StoreKit 2).**\n * Send this to your backend when using Apple's App Store Server API v2 instead of raw receipts.\n * Only available when the transaction originated from StoreKit 2 APIs (e.g. Transaction.updates).\n *\n * **For backend validation:**\n * - Use Apple's App Store Server API v2 to decode and verify the JWS\n * - This is the modern alternative to the legacy receipt format\n * - Contains signed transaction information from Apple\n *\n * @since 7.13.2\n * @platform ios Present for StoreKit 2 transactions (iOS 15+)\n * @platform android Not available\n * @example\n * ```typescript\n * const transaction = await NativePurchases.purchaseProduct({ ... });\n * if (transaction.jwsRepresentation) {\n * // Send to your backend for validation with App Store Server API v2\n * await fetch('/api/validate-jws', {\n * method: 'POST',\n * body: JSON.stringify({ jws: transaction.jwsRepresentation })\n * });\n * }\n * ```\n */\n readonly jwsRepresentation?: string;\n /**\n * An optional obfuscated identifier that uniquely associates the transaction with a user account in your app.\n *\n * PURPOSE:\n * - Fraud detection: Helps platforms detect irregular activity (e.g., many devices purchasing on the same account)\n * - User linking: Links purchases to in-game characters, avatars, or in-app profiles\n *\n * PLATFORM DIFFERENCES:\n * - iOS: Must be a valid UUID format (e.g., \"550e8400-e29b-41d4-a716-446655440000\")\n * Apple's StoreKit 2 requires UUID format for the appAccountToken parameter\n * - Android: Can be any obfuscated string (max 64 chars), maps to Google Play's ObfuscatedAccountId\n * Google recommends using encryption or one-way hash\n *\n * SECURITY REQUIREMENTS (especially for Android):\n * - DO NOT store Personally Identifiable Information (PII) like emails in cleartext\n * - Use encryption or a one-way hash to generate an obfuscated identifier\n * - Maximum length: 64 characters (both platforms)\n * - Storing PII in cleartext will result in purchases being blocked by Google Play\n *\n * IMPLEMENTATION EXAMPLE:\n * ```typescript\n * // For iOS: Generate a deterministic UUID from user ID\n * import { v5 as uuidv5 } from 'uuid';\n * const NAMESPACE = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; // Your app's namespace UUID\n * const appAccountToken = uuidv5(userId, NAMESPACE);\n *\n * // For Android: Can also use UUID or any hashed value\n * // The same UUID approach works for both platforms\n * ```\n */\n readonly appAccountToken?: string | null;\n /**\n * Product identifier associated with the transaction.\n *\n * @since 1.0.0\n * @platform ios Always present\n * @platform android Always present\n */\n readonly productIdentifier: string;\n /**\n * Purchase date of the transaction in ISO 8601 format.\n *\n * @since 1.0.0\n * @example \"2025-10-28T06:03:19Z\"\n * @platform ios Always present\n * @platform android Always present\n */\n readonly purchaseDate: string;\n /**\n * Indicates whether this transaction is the result of a subscription upgrade.\n *\n * Useful for understanding when StoreKit generated the transaction because\n * the customer moved from a lower tier to a higher tier plan.\n *\n * @since 7.13.2\n * @platform ios Present for auto-renewable subscriptions (iOS 15+)\n * @platform android Not available\n */\n readonly isUpgraded?: boolean;\n /**\n * Original purchase date of the transaction in ISO 8601 format.\n *\n * For subscription renewals, this shows the date of the original subscription purchase,\n * while purchaseDate shows the date of the current renewal.\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions only\n * @platform android Not available\n */\n readonly originalPurchaseDate?: string;\n /**\n * Expiration date of the transaction in ISO 8601 format.\n *\n * Check this date to determine if a subscription is still valid.\n * Compare with current date: if expirationDate > now, subscription is active.\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions only\n * @platform android Not available (query Google Play Developer API instead)\n */\n readonly expirationDate?: string;\n /**\n * Whether the subscription is still active/valid.\n *\n * For iOS subscriptions, check if isActive === true to verify an active subscription.\n * For expired or refunded iOS subscriptions, this will be false.\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions only (true if expiration date is in the future)\n * @platform android Not available (check purchaseState === \"1\" instead)\n */\n readonly isActive?: boolean;\n /**\n * Date the transaction was revoked/refunded, in ISO 8601 format.\n *\n * Present when Apple revokes access due to an issue (e.g., refund or developer issue).\n *\n * @since 7.13.2\n * @platform ios Present for revoked transactions (iOS 15+)\n * @platform android Not available\n */\n readonly revocationDate?: string;\n /**\n * Reason why Apple revoked the transaction.\n *\n * Possible values:\n * - `\"developerIssue\"`: Developer-initiated refund or issue\n * - `\"other\"`: Apple-initiated (customer refund, billing problem, etc.)\n * - `\"unknown\"`: StoreKit didn't report a specific reason\n *\n * @since 7.13.2\n * @platform ios Present for revoked transactions (iOS 15+)\n * @platform android Not available\n */\n readonly revocationReason?: 'developerIssue' | 'other' | 'unknown';\n /**\n * Whether the subscription will be cancelled at the end of the billing cycle.\n *\n * - `true`: User has cancelled but subscription remains active until expiration\n * - `false`: Subscription will auto-renew\n * - `null`: Status unknown or not available\n *\n * @since 1.0.0\n * @default null\n * @platform ios Present for subscriptions only (boolean or null)\n * @platform android Always null (use Google Play Developer API for cancellation status)\n */\n readonly willCancel: boolean | null;\n /**\n * Current subscription state reported by StoreKit.\n *\n * Possible values:\n * - `\"subscribed\"`: Auto-renewing and in good standing\n * - `\"expired\"`: Lapsed with no access\n * - `\"revoked\"`: Access removed due to refund or issue\n * - `\"inGracePeriod\"`: Payment issue but still in grace access window\n * - `\"inBillingRetryPeriod\"`: StoreKit retrying failed billing\n * - `\"unknown\"`: StoreKit did not report a state\n *\n * @since 7.13.2\n * @platform ios Present for auto-renewable subscriptions (iOS 15+)\n * @platform android Not available\n */\n readonly subscriptionState?:\n 'subscribed' | 'expired' | 'revoked' | 'inGracePeriod' | 'inBillingRetryPeriod' | 'unknown';\n /**\n * StoreKit billing plan type for auto-renewable subscriptions.\n *\n * - `\"upFront\"`: Standard subscription billing for the full billing period.\n * - `\"monthly\"`: Monthly billing with a 12-month commitment.\n * - `\"unknown\"`: StoreKit returned a future or unsupported value.\n *\n * @since 8.3.8\n * @platform ios Present for StoreKit transactions that include billing plan metadata.\n * @platform android Not available\n */\n readonly billingPlanType?: SubscriptionBillingPlanType;\n /**\n * Commitment metadata for monthly subscriptions with a 12-month commitment.\n *\n * Use `expirationDate` here only to display commitment progress. Continue using\n * the top-level `expirationDate` to decide whether the current billing period\n * grants entitlement access.\n *\n * @since 8.3.8\n * @platform ios Present for monthly commitment subscription transactions.\n * @platform android Not available\n */\n readonly commitmentInfo?: TransactionCommitmentInfo;\n /**\n * StoreKit renewal metadata for auto-renewable subscriptions.\n *\n * `willAutoRenew` here describes the next billing period. For monthly\n * commitment subscriptions, `commitmentInfo.willAutoRenew` describes whether\n * the next 12-month commitment renews after the current commitment ends.\n *\n * @since 8.3.8\n * @platform ios Present for verified subscription renewal info.\n * @platform android Not available\n */\n readonly renewalInfo?: SubscriptionRenewalInfo;\n /**\n * Currency code associated with StoreKit transaction pricing metadata.\n *\n * @since 8.3.8\n * @platform ios Present when StoreKit includes currency in the transaction payload.\n * @platform android Not available\n */\n readonly currencyCode?: string;\n /**\n * Purchase state of the transaction (numeric string value).\n *\n * **Android Values:**\n * - `\"1\"`: Purchase completed and valid (PURCHASED state)\n * - `\"0\"`: Payment pending (PENDING state, e.g., cash payment processing)\n * - Other numeric values: Various other states\n *\n * Always check `purchaseState === \"1\"` on Android to verify a valid purchase.\n * Refunded purchases typically disappear from getPurchases() rather than showing a different state.\n *\n * @since 1.0.0\n * @platform ios Not available (use isActive for subscriptions or receipt validation for IAP)\n * @platform android Always present\n */\n readonly purchaseState?: string;\n /**\n * Order ID associated with the transaction.\n *\n * Use this for server-side verification on Android. This is the Google Play order ID.\n *\n * @since 1.0.0\n * @example \"GPA.1234-5678-9012-34567\"\n * @platform ios Not available\n * @platform android Always present\n */\n readonly orderId?: string;\n /**\n * Purchase token associated with the transaction.\n *\n * **This is the full verified purchase token from Google Play.**\n * Send this to your backend for server-side validation with Google Play Developer API.\n * This is the Android equivalent of iOS's receipt field.\n *\n * **For backend validation:**\n * - Use Google Play Developer API v3 to verify the purchase\n * - API endpoint: androidpublisher.purchases.products.get() or purchases.subscriptions.get()\n * - This token contains all data needed for validation with Google servers\n * - Can also be used for subscription status checks and cancellation detection\n *\n * @since 1.0.0\n * @platform ios Not available (use receipt instead)\n * @platform android Always present\n * @example\n * ```typescript\n * const transaction = await NativePurchases.purchaseProduct({ ... });\n * if (transaction.purchaseToken) {\n * // Send to your backend for validation\n * await fetch('/api/validate-purchase', {\n * method: 'POST',\n * body: JSON.stringify({\n * purchaseToken: transaction.purchaseToken,\n * productId: transaction.productIdentifier\n * })\n * });\n * }\n * ```\n */\n readonly purchaseToken?: string;\n /**\n * Whether the purchase has been acknowledged.\n *\n * Purchases must be acknowledged within 3 days or they will be refunded.\n * By default, this plugin automatically acknowledges purchases unless you set\n * `autoAcknowledgePurchases: false` in purchaseProduct().\n *\n * @since 1.0.0\n * @platform ios Not available\n * @platform android Always present (should be true after successful purchase or manual acknowledgment)\n */\n readonly isAcknowledged?: boolean;\n /**\n * Quantity purchased.\n *\n * @since 1.0.0\n * @default 1\n * @platform ios 1 or higher (as specified in purchaseProduct call)\n * @platform android Always 1 (Google Play doesn't support quantity > 1)\n */\n readonly quantity?: number;\n /**\n * Product type.\n *\n * - `\"inapp\"`: One-time in-app purchase\n * - `\"subs\"`: Subscription\n *\n * @since 1.0.0\n * @platform ios Always present\n * @platform android Always present\n */\n readonly productType?: string;\n /**\n * Indicates how the user obtained access to the product.\n *\n * - `\"purchased\"`: The user purchased the product directly\n * - `\"familyShared\"`: The user has access through Family Sharing (another family member purchased it)\n *\n * This property is useful for:\n * - Detecting family sharing usage for analytics\n * - Implementing different features/limits for family-shared vs. directly purchased products\n * - Understanding your user acquisition channels\n *\n * @since 7.12.8\n * @platform ios Always present (iOS 15.0+, StoreKit 2)\n * @platform android Not available\n */\n readonly ownershipType?: 'purchased' | 'familyShared';\n /**\n * Indicates the server environment where the transaction was processed.\n *\n * - `\"Sandbox\"`: Transaction belongs to testing in the sandbox environment\n * - `\"Production\"`: Transaction belongs to a customer in the production environment\n * - `\"Xcode\"`: Transaction from StoreKit Testing in Xcode\n *\n * This property is useful for:\n * - Debugging and identifying test vs. production purchases\n * - Analytics and reporting (filtering out sandbox transactions)\n * - Server-side validation (knowing which Apple endpoint to use)\n * - Preventing test purchases from affecting production metrics\n *\n * @since 7.12.8\n * @platform ios Present on iOS 16.0+ only (not available on iOS 15)\n * @platform android Not available\n */\n readonly environment?: 'Sandbox' | 'Production' | 'Xcode';\n /**\n * Reason StoreKit generated the transaction.\n *\n * - `\"purchase\"`: Initial purchase that user made manually\n * - `\"renewal\"`: Automatically generated renewal for an auto-renewable subscription\n * - `\"unknown\"`: StoreKit did not return a reason\n *\n * @since 7.13.2\n * @platform ios Present on iOS 17.0+ (StoreKit 2 transactions)\n * @platform android Not available\n */\n readonly transactionReason?: 'purchase' | 'renewal' | 'unknown';\n /**\n * Whether the transaction is in a trial period.\n *\n * - `true`: Currently in free trial period\n * - `false`: Not in trial period\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions with trial offers\n * @platform android Present for subscriptions with trial offers\n */\n readonly isTrialPeriod?: boolean;\n /**\n * Whether the transaction is in an introductory price period.\n *\n * Introductory pricing is a discounted rate, different from a free trial.\n *\n * - `true`: Currently using introductory pricing\n * - `false`: Not in intro period\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions with intro pricing\n * @platform android Present for subscriptions with intro pricing\n */\n readonly isInIntroPricePeriod?: boolean;\n /**\n * Whether the transaction is in a grace period.\n *\n * Grace period allows users to fix payment issues while maintaining access.\n * You typically want to continue providing access during this time.\n *\n * - `true`: Subscription payment failed but user still has access\n * - `false`: Not in grace period\n *\n * @since 1.0.0\n * @platform ios Present for subscriptions in grace period\n * @platform android Present for subscriptions in grace period\n */\n readonly isInGracePeriod?: boolean;\n /**\n * Whether the StoreKit transaction still needs to be finished with `finishTransaction()`.\n *\n * Present when the transaction is returned from `getUnfinishedTransactions()` or from\n * `transactionUpdated` while `autoFinishTransactions` is `false`.\n *\n * @since 8.9.0\n * @platform ios Present when the transaction is unfinished in StoreKit 2\n * @platform android Not available (use `isAcknowledged === false` instead)\n */\n readonly needsFinish?: boolean;\n /**\n * Why StoreKit could not verify this transaction. Treat the transaction as untrusted and do not\n * grant entitlements from it.\n *\n * Present only on unverified entries returned by `getUnfinishedTransactions({ includeUnverified: true })`.\n *\n * @since 8.9.7\n * @platform ios Present when StoreKit reports the transaction as unverified\n * @platform android Not available (Play Billing has no client-side unverified state)\n */\n readonly verificationError?: string;\n}\n\nexport interface TransactionVerificationFailedEvent {\n /**\n * Identifier of the transaction that failed verification.\n *\n * @since 7.13.2\n * @platform ios Present when StoreKit reports an unverified transaction\n * @platform android Not available\n */\n readonly transactionId: string;\n /**\n * Localized error message describing why verification failed.\n *\n * @since 7.13.2\n * @platform ios Always present\n * @platform android Not available\n */\n readonly error: string;\n}\n\n/**\n * Represents the App Transaction information from StoreKit 2.\n * This provides details about when the user originally downloaded or purchased the app,\n * which is useful for determining if users are entitled to features from earlier business models.\n *\n * @see https://developer.apple.com/documentation/storekit/supporting-business-model-changes-by-using-the-app-transaction\n * @since 7.16.0\n */\nexport interface AppTransaction {\n /**\n * The app version that the user originally purchased or downloaded.\n *\n * Use this to determine if users who originally downloaded an earlier version\n * should be entitled to features that were previously free or included.\n *\n * For iOS: This is the `CFBundleShortVersionString` (e.g., \"1.0.0\")\n * For Android: This is the `versionName` from Google Play (e.g., \"1.0.0\")\n *\n * @example \"1.0.0\"\n * @since 7.16.0\n * @platform ios Always present (iOS 16+)\n * @platform android Always present\n */\n readonly originalAppVersion: string;\n\n /**\n * The date when the user originally purchased or downloaded the app.\n * ISO 8601 format.\n *\n * @example \"2023-06-15T10:30:00Z\"\n * @since 7.16.0\n * @platform ios Always present (iOS 16+)\n * @platform android Always present\n */\n readonly originalPurchaseDate: string;\n\n /**\n * The bundle identifier of the app.\n *\n * @example \"com.example.myapp\"\n * @since 7.16.0\n * @platform ios Always present (iOS 16+)\n * @platform android Always present (package name)\n */\n readonly bundleId: string;\n\n /**\n * The current app version installed on the device.\n *\n * @example \"2.0.0\"\n * @since 7.16.0\n * @platform ios Always present\n * @platform android Always present\n */\n readonly appVersion: string;\n\n /**\n * The server environment where the app was originally purchased.\n *\n * @since 7.16.0\n * @platform ios Present (iOS 16+)\n * @platform android Not available (always null)\n */\n readonly environment?: 'Sandbox' | 'Production' | 'Xcode' | null;\n\n /**\n * The JWS (JSON Web Signature) representation of the app transaction.\n * Can be sent to your backend for server-side verification.\n *\n * @since 7.16.0\n * @platform ios Present (iOS 16+)\n * @platform android Not available\n */\n readonly jwsRepresentation?: string;\n}\n\nexport interface SubscriptionPeriod {\n /**\n * The Subscription Period number of unit.\n */\n readonly numberOfUnits: number;\n /**\n * The Subscription Period unit.\n */\n readonly unit: number;\n /**\n * Human-readable subscription period unit.\n *\n * @since 8.3.8\n */\n readonly unitString?: 'day' | 'week' | 'month' | 'year' | 'unknown';\n}\n\nexport type SubscriptionBillingPlanType = 'upFront' | 'monthly' | 'unknown';\n\nexport interface ProductCommitmentInfo {\n /**\n * Total commitment price in the local currency.\n */\n readonly price?: number;\n /**\n * Formatted total commitment price.\n */\n readonly priceString?: string;\n /**\n * Full commitment period.\n */\n readonly period?: SubscriptionPeriod;\n}\n\nexport interface SubscriptionPricingTerms {\n /**\n * Billing plan represented by this pricing entry.\n */\n readonly billingPlanType?: SubscriptionBillingPlanType;\n /**\n * Total commitment details for this billing plan.\n */\n readonly commitmentInfo?: ProductCommitmentInfo;\n /**\n * Formatted price for each billing period.\n */\n readonly billingDisplayPrice?: string;\n /**\n * Numeric price for each billing period.\n */\n readonly billingPrice?: number;\n /**\n * Duration of each billing period.\n */\n readonly billingPeriod?: SubscriptionPeriod;\n /**\n * StoreKit subscription offers that apply to this billing plan.\n */\n readonly subscriptionOffers?: StoreKitSubscriptionOffer[];\n}\n\nexport interface StoreKitSubscriptionOffer {\n /**\n * StoreKit offer identifier.\n */\n readonly identifier?: string;\n /**\n * StoreKit offer type.\n */\n readonly type?: string;\n /**\n * Offer price in the local currency.\n */\n readonly price?: number;\n /**\n * Formatted offer price.\n */\n readonly priceString?: string;\n /**\n * Offer billing period.\n */\n readonly period?: SubscriptionPeriod;\n /**\n * Number of periods the offer applies to.\n */\n readonly periodCount?: number;\n /**\n * StoreKit offer payment mode.\n */\n readonly paymentMode?: string;\n}\n\nexport interface TransactionCommitmentInfo {\n /**\n * Current billing period number within the commitment.\n */\n readonly billingPeriodNumber?: number;\n /**\n * Total number of billing periods in the commitment.\n */\n readonly totalBillingPeriods?: number;\n /**\n * End of the full commitment, in ISO 8601 format.\n */\n readonly expirationDate?: string;\n /**\n * Total commitment price in the local currency.\n */\n readonly price?: number;\n}\n\nexport interface RenewalCommitmentInfo {\n /**\n * Product StoreKit will renew into after the commitment ends.\n */\n readonly autoRenewProductId?: string;\n /**\n * Whether the subscription renews into another commitment after the current commitment ends.\n */\n readonly willAutoRenew?: boolean;\n /**\n * Billing plan StoreKit will use for the next commitment or renewal.\n */\n readonly renewalBillingPlanType?: SubscriptionBillingPlanType;\n /**\n * Renewal date for the next commitment or renewal, in ISO 8601 format.\n */\n readonly renewalDate?: string;\n /**\n * Renewal price in the local currency.\n */\n readonly renewalPrice?: number;\n}\n\nexport interface SubscriptionRenewalInfo {\n /**\n * Whether the next billing period will renew.\n */\n readonly willAutoRenew?: boolean;\n /**\n * Product StoreKit will renew into for the next billing period.\n */\n readonly autoRenewProductId?: string;\n /**\n * Billing plan StoreKit will use for the next billing period.\n */\n readonly renewalBillingPlanType?: SubscriptionBillingPlanType;\n /**\n * Next billing period renewal date, in ISO 8601 format.\n */\n readonly renewalDate?: string;\n /**\n * Next billing period renewal price in the local currency.\n */\n readonly renewalPrice?: number;\n /**\n * Currency code for renewal pricing metadata.\n */\n readonly currencyCode?: string;\n /**\n * Commitment renewal metadata for monthly subscriptions with a 12-month commitment.\n */\n readonly commitmentInfo?: RenewalCommitmentInfo;\n}\n\nexport interface SKProductDiscount {\n /**\n * The Product discount identifier.\n */\n readonly identifier: string;\n /**\n * The Product discount type.\n *\n * iOS values: 0 = introductory, 1 = promotional, 2 = win-back.\n */\n readonly type: number;\n /**\n * The Product discount price.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * The Product discount currency symbol.\n */\n readonly currencySymbol: string;\n /**\n * The Product discount currency code.\n */\n readonly currencyCode: string;\n /**\n * The Product discount paymentMode.\n */\n readonly paymentMode: number;\n /**\n * The Product discount number Of Periods.\n */\n readonly numberOfPeriods: number;\n /**\n * The Product discount subscription period.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n}\n\n/**\n * Android one-time product discount display metadata.\n *\n * @platform android Populated for discounted one-time purchase offers when available.\n * @platform ios Not available\n */\nexport interface OneTimePurchaseOfferDiscount {\n /**\n * Percentage discount off the full price.\n */\n readonly percentageDiscount?: number;\n /**\n * Absolute discount amount in micro-units (1,000,000 micro-units = 1 currency unit).\n */\n readonly discountAmountMicros?: number;\n}\n\nexport interface Product {\n /**\n * Product Id.\n *\n * Android subscriptions note:\n * - `identifier` is the base plan ID (`offerDetails.getBasePlanId()`).\n * - `planIdentifier` is the subscription product ID (`productDetails.getProductId()`).\n *\n * Android one-time products note:\n * - `identifier` is the Google Play product ID (`productDetails.getProductId()`).\n * - When multiple offers exist, `getProducts()` returns one entry per eligible offer.\n *\n * If you group/filter Android subscription results by `identifier`, you are grouping by base plan.\n */\n readonly identifier: string;\n /**\n * Description of the product.\n */\n readonly description: string;\n /**\n * Title of the product.\n */\n readonly title: string;\n /**\n * Price of the product in the local currency.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n *\n * Android subscriptions: set from the standard recurring pricing phase (see\n * `ProductPayloadMapper`). When the offer has an introductory phase, `introductoryPrice`\n * describes that phase, so a pre purchase message should include both or defer confirmation\n * to the store sheet.\n */\n readonly priceString: string;\n /**\n * Currency code for price and original price.\n */\n readonly currencyCode: string;\n /**\n * Currency symbol for price and original price.\n */\n readonly currencySymbol: string;\n /**\n * Boolean indicating if the product is sharable with family\n */\n readonly isFamilyShareable: boolean;\n /**\n * Group identifier for the product.\n */\n readonly subscriptionGroupIdentifier: string;\n /**\n * Android subscriptions only: Google Play product identifier tied to the offer/base plan set.\n */\n readonly planIdentifier?: string;\n /**\n * Android: offer token required when purchasing a specific subscription or one-time offer.\n *\n * Pass it to `purchaseProduct({ offerToken })` to buy this exact offer. It belongs to the\n * query that returned it and goes stale, so read it from the same `getProducts()` /\n * `getProduct()` call you purchase from.\n */\n readonly offerToken?: string;\n /**\n * Android: offer identifier (null/undefined for base offers).\n */\n readonly offerId?: string | null;\n /**\n * Android one-time products only: purchase option identifier (for example `buy-option`).\n *\n * @platform android Present on one-time purchase offers when available.\n * @platform ios Not available\n */\n readonly purchaseOptionId?: string;\n /**\n * Android one-time products only: full price before discount, in the local currency.\n *\n * @platform android Present on discounted one-time purchase offers when available.\n * @platform ios Not available\n */\n readonly fullPrice?: number;\n /**\n * Android one-time products only: discount metadata for discounted offers.\n *\n * @platform android Present on discounted one-time purchase offers when available.\n * @platform ios Not available\n */\n readonly discountDisplayInfo?: OneTimePurchaseOfferDiscount;\n /**\n * iOS subscriptions only: StoreKit pricing terms by billing plan.\n *\n * For subscriptions with a monthly billing plan and 12-month commitment, this\n * includes both the standard up-front plan and the monthly commitment plan.\n * Display both `billingDisplayPrice` and `commitmentInfo.priceString` before\n * starting a monthly commitment purchase.\n *\n * @since 8.3.8\n * @platform ios Present on supported StoreKit subscription products.\n * @platform android Not available\n */\n readonly pricingTerms?: SubscriptionPricingTerms[];\n /**\n * Recurring billing period for subscription products.\n *\n * @platform ios From StoreKit `subscription.subscriptionPeriod`.\n * @platform android From the standard pricing phase billing period when recurrence is\n * infinite recurring, or finite recurring on installment offers (`ProductPayloadMapper.applySubscriptionPricing`).\n * Omitted for prepaid (non-recurring) phases.\n */\n readonly subscriptionPeriod?: SubscriptionPeriod;\n /**\n * Android subscriptions only: committed payment count for installment base plans when Play\n * exposes it on the offer.\n *\n * @platform android From `InstallmentPlanDetails.getInstallmentPlanCommitmentPaymentsCount()`.\n * @platform ios Not available\n */\n readonly subscriptionBillingCycles?: number;\n /**\n * Introductory price for this product line when the store exposes it. Pair with `priceString`\n * for full subscription offer wording before purchase. iOS: from StoreKit introductory offers\n * when available. Android base subscription offers (`offerId` null): from the first pricing\n * phase when multiple phases exist (intro then recurring). Android promotional offer lines\n * (`offerId` set): null; phase pricing is not exposed on `Product`, so defer price confirmation\n * to Play checkout instead of using `priceString` alone. Mapping matches `ProductPayloadMapper`.\n */\n readonly introductoryPrice: SKProductDiscount | null;\n /**\n * Whether the current store account is eligible for an introductory offer on this subscription.\n *\n * @platform ios Set from StoreKit `isEligibleForIntroOffer` when the product has an introductory offer.\n * @platform android Always `INTRO_ELIGIBILITY_STATUS_UNKNOWN` (Google Play filters ineligible offers in billing).\n * @since 8.8.3\n */\n readonly introEligibility?: INTRO_ELIGIBILITY_STATUS;\n /**\n * The Product discounts list.\n *\n * @platform ios Populated from StoreKit promotional offers when available.\n * @platform android On base subscription offers (`offerId` null), lists promotional offers on\n * the same base plan. A promotional offer line itself returns an empty array; its pricing\n * phases are not mapped here or on `introductoryPrice`.\n */\n readonly discounts: SKProductDiscount[];\n}\n\nexport interface NativePurchasesPlugin {\n /**\n * Configure plugin-wide purchase finishing behavior.\n *\n * Call this as early as possible (ideally before other NativePurchases APIs). You can also set\n * `autoFinishTransactions` in `capacitor.config` under `plugins.NativePurchases` so iOS applies\n * the value before the native `transactionUpdated` listener starts.\n *\n * **`autoFinishTransactions` (default `true`)**\n *\n * - **iOS (StoreKit 2)**: When `true`, the plugin finishes transactions automatically for\n * `transactionUpdated`, `restorePurchases`, and `purchaseProduct` (when\n * `autoAcknowledgePurchases` is also true). When `false`, transactions stay unfinished until you call\n * `finishTransaction()` (or `acknowledgePurchase()` with the transaction ID).\n * - **Android**: When `true`, `restorePurchases()` may auto-acknowledge unacknowledged purchases\n * (recovery flow). When `false`, recovery does not acknowledge; use `acknowledgePurchase()`.\n * `purchaseProduct()` auto-acknowledges only when both `autoFinishTransactions` and\n * `autoAcknowledgePurchases` are true.\n *\n * **`autoAcknowledgePurchases`** applies only to the `purchaseProduct()` call and does not change\n * how the iOS `transactionUpdated` listener finishes transactions. Use this method (or config) for that.\n *\n * @param options.autoFinishTransactions When false, manual finishing/acknowledgment is required for the flows above.\n * @since 8.9.0\n *\n * @example\n * ```typescript\n * // capacitor.config.ts\n * export default {\n * plugins: {\n * NativePurchases: {\n * autoFinishTransactions: false,\n * },\n * },\n * };\n *\n * // Optional runtime override (affects subsequent native operations)\n * await NativePurchases.configure({ autoFinishTransactions: false });\n * ```\n */\n configure(options?: { autoFinishTransactions?: boolean }): Promise<void>;\n\n /**\n * Restores a user's previous and links their appUserIDs to any user's also using those .\n */\n restorePurchases(): Promise<void>;\n\n /**\n * Gets the App Transaction information, which provides details about when the user\n * originally downloaded or purchased the app.\n *\n * This is useful for implementing business model changes where you want to\n * grandfather users who originally downloaded an earlier version of the app.\n *\n * **Use Case Example:**\n * If your app was originally free but you're adding a subscription, you can use\n * `originalAppVersion` to check if users downloaded before the subscription was added\n * and give them free access.\n *\n * **Platform Notes:**\n * - **iOS**: Requires iOS 16.0+. Uses StoreKit 2's `AppTransaction.shared`.\n * - **Android**: Uses Google Play's install referrer data when available.\n *\n * @returns {Promise<{ appTransaction: AppTransaction }>} The app transaction info\n * @throws An error if the app transaction cannot be retrieved (iOS 15 or earlier)\n * @since 7.16.0\n *\n * @example\n * ```typescript\n * const { appTransaction } = await NativePurchases.getAppTransaction();\n *\n * // Check if user downloaded before version 2.0.0 (when subscription was added)\n * if (compareVersions(appTransaction.originalAppVersion, '2.0.0') < 0) {\n * // User gets free access - they downloaded before subscriptions\n * grantFreeAccess();\n * }\n * ```\n *\n * @see https://developer.apple.com/documentation/storekit/supporting-business-model-changes-by-using-the-app-transaction\n */\n getAppTransaction(): Promise<{ appTransaction: AppTransaction }>;\n\n /**\n * Compares the original app version from the App Transaction against a target version\n * to determine if the user is entitled to features from an earlier business model.\n *\n * This is a utility method that performs the version comparison natively, which can be\n * more reliable than JavaScript-based comparison for semantic versioning.\n *\n * **Use Case:**\n * Check if the user's original download version is older than a specific version\n * to determine if they should be grandfathered into free features.\n *\n * **Platform Differences:**\n * - iOS: Uses build number (CFBundleVersion) from AppTransaction. Requires iOS 16+.\n * - Android: Uses version name from PackageInfo (current installed version, not original).\n *\n * @param options - The comparison options\n * @param options.targetVersion - The Android version name to compare against (e.g., \"2.0.0\"). Used on Android only.\n * @param options.targetBuildNumber - The iOS build number to compare against (e.g., \"42\"). Used on iOS only.\n * @returns {Promise<{ isOlderVersion: boolean; originalAppVersion: string }>}\n * - `isOlderVersion`: true if the user's original version is older than target\n * - `originalAppVersion`: The user's original app version/build number for reference\n * @throws An error if the app transaction cannot be retrieved\n * @since 7.16.0\n *\n * @example\n * ```typescript\n * // Check if user downloaded before version 2.0.0/build 42 (when subscription was added)\n * const result = await NativePurchases.isEntitledToOldBusinessModel({\n * targetVersion: '2.0.0',\n * targetBuildNumber: '42'\n * });\n *\n * if (result.isOlderVersion) {\n * console.log(`User downloaded v${result.originalAppVersion}, granting free access`);\n * grantFreeAccess();\n * }\n * ```\n */\n isEntitledToOldBusinessModel(options: {\n targetVersion?: string;\n targetBuildNumber?: string;\n }): Promise<{ isOlderVersion: boolean; originalAppVersion: string }>;\n\n /**\n * Started purchase process for the given product.\n *\n * On Android, `offerToken` selects which offer is charged. If the token is\n * missing from the product details returned by the plugin's query, the plugin\n * rejects the purchase instead of selecting another offer. Other failures can\n * also reject the purchase. Google Play may still show a different checkout,\n * for example if the offer stops being eligible after the query, so the final\n * price is not guaranteed.\n * Offer tokens come from a specific product query and go stale, so read\n * one from the same `getProducts()` / `getProduct()` call you purchase\n * from.\n *\n * For a **subscription** (`productType: 'subs'`) the order is: an explicit\n * `offerToken`, then the first offer whose base plan matches\n * `planIdentifier`, then the first offer the store returned.\n * `planIdentifier` is the **base plan id**, which `getProducts()` reports\n * as `Product.identifier`, not `Product.planIdentifier`, which holds the\n * Play product id. It is required unless an `offerToken` is given, since\n * a token already identifies one offer on its own.\n *\n * For a **one-time product** (`productType: 'inapp'`) there is no base\n * plan, so `planIdentifier` plays no part, and an `offerToken` selects one\n * of the product's purchase offers. Without a token no offer token is set\n * at all whenever the product still has a backward-compatible purchase\n * option, which leaves the choice to Play: it charges whichever buy\n * purchase option is marked backward-compatible, which is the first\n * *created* one by default and another only if one was marked\n * `legacyCompatible`. Either way it need not be the first offer\n * `getProducts()` returned. Only for a product with no backward-compatible\n * option does the first offer in the list get used. So pass the token\n * whenever a specific one-time offer matters.\n *\n * @param options - The product to purchase\n * @param options.productIdentifier - The product identifier of the product you want to purchase.\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @param options.planIdentifier - Only Android, the identifier of the base plan you want to purchase from Google Play Console, the value `getProducts()` reports as `Product.identifier` for a subscription, not `Product.planIdentifier`. Required for Android subscriptions unless `offerToken` is given; ignored for one-time products and on iOS.\n * @param options.offerToken - Only Android, the offer token for the selected subscription or one-time product offer. Use the `offerToken` returned by `getProducts()` / `getProduct()`. For a subscription it takes precedence over `planIdentifier`, since it names one specific offer, and makes `planIdentifier` optional. When the token is absent from the plugin query result the purchase is rejected instead of falling back to another offer. Google Play may still change what the user can buy after the query. Offer tokens come from a specific product query and go stale, so read one from the same query you purchase from. Omit it to keep the previous behaviour.\n * @param options.quantity - Only iOS, the number of items you wish to purchase. Will use 1 by default.\n * @param options.billingPlanType - Only iOS, the StoreKit subscription billing plan to purchase. Use `\"monthly\"` for a monthly subscription with a 12-month commitment. Requires iOS 26.4+ and Xcode 26.5 SDK support.\n * @param options.appAccountToken - Optional identifier uniquely associated with the user's account in your app.\n * PLATFORM REQUIREMENTS:\n * - iOS: Must be a valid UUID format (StoreKit 2 requirement)\n * - Android: Can be any obfuscated string (max 64 chars), maps to ObfuscatedAccountId\n * SECURITY: DO NOT use PII like emails in cleartext - use UUID or hashed value.\n * RECOMMENDED: Use UUID v5 with deterministic generation for cross-platform compatibility.\n * @param options.isConsumable - Only Android, when true the purchase token is consumed after granting entitlement (for consumable in-app items). Defaults to false.\n * @param options.autoAcknowledgePurchases - When false, this purchase is not auto-finished/acknowledged when\n * `autoFinishTransactions` is also true. Does not disable auto-finishing on\n * the iOS `transactionUpdated` listener; use `configure({ autoFinishTransactions: false })`\n * for manual finishing across purchase and recovery flows. Defaults to true.\n * - **Android**: Must acknowledge within 3 days or Google Play will refund\n * - **iOS**: Unfinished transactions remain in the queue and may block future purchases\n */\n purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier?: string;\n offerToken?: string;\n productType?: PURCHASE_TYPE;\n quantity?: number;\n billingPlanType?: 'monthly' | 'upFront';\n appAccountToken?: string;\n isConsumable?: boolean;\n autoAcknowledgePurchases?: boolean;\n }): Promise<Transaction>;\n\n /**\n * Gets the product info associated with a list of product identifiers.\n *\n * @param options - The product identifiers you wish to retrieve information for\n * @param options.productIdentifiers - Array of product identifiers\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProducts(options: { productIdentifiers: string[]; productType?: PURCHASE_TYPE }): Promise<{ products: Product[] }>;\n\n /**\n * Gets the product info for a single product identifier.\n *\n * **⚠️ Warning:** Do not call `getProduct` concurrently using `Promise.all`.\n * The underlying native billing client does not support concurrent product\n * queries, and doing so causes a race condition that may result in errors\n * or missing data. To fetch multiple products at once, use `getProducts`\n * instead — it accepts an array of identifiers and is race-condition-free.\n *\n * @example\n * // ❌ Avoid: causes race condition\n * const [a, b] = await Promise.all([\n * NativePurchases.getProduct({ productIdentifier: 'id1' }),\n * NativePurchases.getProduct({ productIdentifier: 'id2' }),\n * ]);\n *\n * // ✅ Correct: use getProducts for multiple identifiers\n * const { products } = await NativePurchases.getProducts({ productIdentifiers: ['id1', 'id2'] });\n *\n * @param options - The product identifier you wish to retrieve information for\n * @param options.productIdentifier - The product identifier\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProduct(options: { productIdentifier: string; productType?: PURCHASE_TYPE }): Promise<{ product: Product }>;\n\n /**\n * Check if billing is supported for the current device.\n *\n *\n */\n isBillingSupported(): Promise<{ isBillingSupported: boolean }>;\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n\n /**\n * Gets all the user's purchases (both in-app purchases and subscriptions).\n * This method queries the platform's purchase history for the current user.\n *\n * @param options - Optional parameters for filtering purchases\n * @param options.productType - Only Android, filter by product type (inapp or subs). If not specified, returns both types.\n * @param options.appAccountToken - Optional filter to restrict results to purchases that used the provided account token.\n * Must be the same identifier used during purchase (UUID format for iOS, any obfuscated string for Android).\n * iOS: UUID format required. Android: Maps to ObfuscatedAccountId.\n * @param options.onlyCurrentEntitlements - iOS only. When `false` (default), uses `Transaction.all` which returns every\n * transaction ever recorded on the device. When `true`, uses\n * `Transaction.currentEntitlements` which is scoped to the signed-in Apple ID\n * and only includes currently active entitlements. Set to `true` to prevent\n * cross-account purchase leakage on shared or refurbished devices.\n * @returns {Promise<{ purchases: Transaction[] }>} Promise that resolves with array of user's purchases\n * @throws An error if the purchase query fails\n * @since 7.2.0\n */\n getPurchases(options?: {\n productType?: PURCHASE_TYPE;\n appAccountToken?: string;\n onlyCurrentEntitlements?: boolean;\n }): Promise<{ purchases: Transaction[] }>;\n\n /**\n * Opens the platform's native subscription management page.\n * This allows users to view, modify, or cancel their subscriptions.\n *\n * - iOS: Opens the App Store subscription management page for the current app\n * - Android: Opens the Google Play subscription management page\n *\n * @returns {Promise<void>} Promise that resolves when the management page is opened\n * @throws An error if the subscription management page cannot be opened\n * @since 7.10.0\n */\n manageSubscriptions(): Promise<void>;\n\n /**\n * Presents the App Store offer code redemption sheet so users can redeem a subscription offer code in your app.\n *\n * iOS: Uses StoreKit's `AppStore.presentOfferCodeRedeemSheet(in:)` to display the system redemption UI (iOS 16.0+).\n *\n * @returns {Promise<void>} Promise that resolves when the redemption sheet is presented\n * @throws An error if the offer code redemption sheet cannot be presented\n * @since 8.6.0\n * @platform ios\n *\n * @see https://developer.apple.com/documentation/storekit/appstore/presentoffercoderedeemsheet(in:)\n */\n presentOfferCodeRedeemSheet(): Promise<void>;\n\n /**\n * Manually acknowledge/finish a purchase transaction.\n *\n * Call this when automatic finishing or acknowledgment is disabled, for example\n * `purchaseProduct({ autoAcknowledgePurchases: false })`, `configure({ autoFinishTransactions: false })`\n * (Android recovery or iOS updates), or when a returned transaction has `needsFinish: true`.\n *\n * **Platform Behavior:**\n * - **Android**: Acknowledges the purchase with Google Play. Must be called within 3 days or the purchase will be refunded.\n * - **iOS**: Finishes the transaction with StoreKit 2. Unfinished transactions remain in the queue and may block future purchases.\n *\n * **Acknowledgment Options:**\n *\n * **1. Client-side (this method)**: Call from your app after validation\n * ```typescript\n * await NativePurchases.acknowledgePurchase({\n * purchaseToken: transaction.purchaseToken // Android: purchaseToken, iOS: transactionId\n * });\n * ```\n *\n * **2. Server-side (Android only, recommended for security)**: Use Google Play Developer API v3\n * - Endpoint: `POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge`\n * - Requires OAuth 2.0 authentication with appropriate scopes\n * - See: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/acknowledge\n * - For subscriptions: Use `/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge` instead\n * - Note: iOS has no server-side finish API\n *\n * **When to use manual acknowledgment:**\n * - Server-side validation: Verify the purchase with your backend before acknowledging\n * - Entitlement delivery: Ensure user receives content/features before acknowledging\n * - Multi-step workflows: Complete all steps before final acknowledgment\n * - Security: Prevent client-side manipulation by handling acknowledgment server-side (Android only)\n *\n * @param options - The purchase to acknowledge\n * @param options.purchaseToken - The purchase token (Android) or transaction ID as string (iOS) from the Transaction object\n * @returns {Promise<void>} Promise that resolves when the purchase is acknowledged/finished\n * @throws An error if acknowledgment/finishing fails or transaction not found\n * @platform android Acknowledges the purchase with Google Play\n * @platform ios Finishes the transaction with StoreKit 2\n * @since 7.14.0\n *\n * @example\n * ```typescript\n * // Client-side acknowledgment\n * const transaction = await NativePurchases.purchaseProduct({\n * productIdentifier: 'premium_feature',\n * autoAcknowledgePurchases: false\n * });\n *\n * // Validate with your backend\n * const isValid = await fetch('/api/validate-purchase', {\n * method: 'POST',\n * body: JSON.stringify({ purchaseToken: transaction.purchaseToken })\n * });\n *\n * if (isValid) {\n * // Option 1: Acknowledge from client\n * await NativePurchases.acknowledgePurchase({\n * purchaseToken: transaction.purchaseToken\n * });\n *\n * // Option 2: Or let your backend acknowledge via Google Play API\n * // Your backend calls Google Play Developer API\n * }\n * ```\n */\n acknowledgePurchase(options: { purchaseToken: string }): Promise<void>;\n\n /**\n * Finish a StoreKit 2 transaction on iOS after you validate delivery on your backend.\n *\n * Equivalent to `acknowledgePurchase({ purchaseToken: transactionId })` on iOS. Safe to call more\n * than once; finishing an already finished transaction resolves successfully.\n *\n * A transaction StoreKit could not verify is rejected unless `allowUnverified` is `true`. Finishing\n * one only removes it from the queue so StoreKit stops re-delivering it; never grant entitlements from it.\n *\n * **Android**: Acknowledges the purchase, using `transactionId` as the purchase token. Use\n * `consumePurchase({ purchaseToken })` instead for consumables that must be purchasable again.\n * `allowUnverified` has no effect because Play Billing has no client-side unverified state.\n *\n * @param options.transactionId Transaction ID from the `Transaction` object (numeric string on iOS, purchase token on Android).\n * @param options.allowUnverified Finish the transaction even if StoreKit could not verify it. Defaults to `false`. Since 8.9.7.\n * @since 8.9.0\n * @platform ios Finishes the transaction with StoreKit 2\n * @platform android Acknowledges the purchase with Google Play\n */\n finishTransaction(options: { transactionId: string; allowUnverified?: boolean }): Promise<void>;\n\n /**\n * Returns transactions that still need finishing on iOS, or unacknowledged purchases on Android.\n *\n * Use on app launch when `autoFinishTransactions` is `false` to recover work after a restart.\n *\n * **Android recovery:** After validation, call `consumePurchase({ purchaseToken })` for consumable\n * in-app products (acknowledges and consumes). Call `acknowledgePurchase({ purchaseToken })` for\n * non-consumables and subscriptions. Includes only purchases in the `PURCHASED` state that are not\n * yet acknowledged. Pending purchases are excluded until Google Play marks them purchased.\n *\n * **Unverified transactions:** With `includeUnverified: true`, iOS also returns transactions StoreKit\n * could not verify, each with `verificationError` set. Do not grant entitlements from those; pass them\n * to `finishTransaction({ transactionId, allowUnverified: true })` to clear them. Android has no\n * client-side unverified state, so the option does not change its results.\n *\n * @param options.includeUnverified Also return unfinished transactions StoreKit could not verify. Defaults to `false`. Since 8.9.7.\n * @since 8.9.0\n */\n getUnfinishedTransactions(options?: { includeUnverified?: boolean }): Promise<{ transactions: Transaction[] }>;\n\n /**\n * Consume an in-app purchase on Android.\n *\n * Consuming a purchase does two things:\n * 1. Acknowledges the purchase (so you don't need to call acknowledgePurchase separately)\n * 2. Removes ownership, allowing the user to buy the same product again\n *\n * Use this for consumable products like virtual currency, extra lives, or credits.\n *\n * **Important:** In Google Play Billing Library 8.x, consumed purchases can no longer\n * be queried via getPurchases(). Once consumed, the purchase is gone.\n *\n * Android only — iOS does not have a separate consume concept.\n * On iOS and web, this method rejects with an error.\n *\n * @param options - The purchase to consume\n * @param options.purchaseToken - The purchase token from the Transaction object\n * @returns {Promise<void>} Promise that resolves when the purchase is consumed\n * @throws Error if consumption fails, token is invalid, or called on iOS/web\n * @platform android\n * @since 8.2.0\n *\n * @example\n * ```typescript\n * const transaction = await NativePurchases.purchaseProduct({\n * productIdentifier: 'coins_100',\n * isConsumable: false,\n * autoAcknowledgePurchases: false\n * });\n *\n * // Validate with your backend first\n * const isValid = await validateWithServer(transaction.purchaseToken);\n *\n * if (isValid) {\n * // Grant the coins, then consume to allow re-purchase\n * await NativePurchases.consumePurchase({\n * purchaseToken: transaction.purchaseToken!\n * });\n * }\n * ```\n */\n consumePurchase(options: { purchaseToken: string }): Promise<void>;\n\n /**\n * Get the user's current App Store / Google Play storefront — the country\n * their store account is registered to.\n *\n * iOS: reads StoreKit 2 `Storefront.current`. `countryCode` is ISO 3166-1\n * **alpha-3** (e.g. `\"USA\"`) and `storefrontId` is the Apple-defined\n * storefront identifier.\n * Android: reads Google Play Billing `getBillingConfigAsync()`. `countryCode`\n * is ISO 3166-1 **alpha-2** (e.g. `\"US\"`); `storefrontId` is omitted (Google\n * Play has no storefront-id concept).\n *\n * Contract note (future-major default candidate): `countryCode` is returned in\n * each store's native format and is intentionally NOT normalized across\n * platforms today (iOS alpha-3 vs Android alpha-2), to stay faithful to the\n * platform APIs. Normalizing both to a single scheme (e.g. ISO 3166-1 alpha-2)\n * is a candidate default change for the next Capacitor major, deferred so it\n * can be adopted deliberately rather than as a mid-major breaking change.\n *\n * Resolves a `countryCode` of `\"\"` (it does not reject) when the storefront\n * can't be determined on either platform — e.g. apps distributed via iOS\n * alternative distribution, or Google Play billing being unavailable.\n *\n * Useful for region-dependent logic such as localized offers/pricing and\n * gating external-purchase entitlements, whose eligibility the platforms key\n * to the storefront country. Read it live rather than caching, since the user\n * can change their store region.\n *\n * @returns {Promise<{ countryCode: string; storefrontId?: string }>} the current storefront\n * @since 8.5.0\n *\n * @example\n * ```typescript\n * const { countryCode } = await NativePurchases.getStorefront();\n * if (countryCode === 'USA' || countryCode === 'US') {\n * // show US-specific payment options\n * }\n * ```\n */\n getStorefront(): Promise<{ countryCode: string; storefrontId?: string }>;\n\n /**\n * Listen for StoreKit transaction updates delivered by Apple's Transaction.updates.\n * Fires on app launch if there are unfinished transactions, and for any updates afterward.\n *\n * When `autoFinishTransactions` is `true` (default), the plugin finishes each verified transaction\n * before emitting the event. When `false`, the event includes `needsFinish: true` and you must call\n * `finishTransaction()` after backend validation.\n *\n * iOS only.\n */\n addListener(\n eventName: 'transactionUpdated',\n listenerFunc: (transaction: Transaction) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for StoreKit transaction verification failures delivered by Apple's Transaction.updates.\n * Fires when the verification result is unverified.\n * iOS only.\n */\n addListener(\n eventName: 'transactionVerificationFailed',\n listenerFunc: (payload: TransactionVerificationFailedEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n /** Remove all registered listeners */\n removeAllListeners(): Promise<void>;\n}\n"]}
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativePurchases = registerPlugin('NativePurchases', {\n web: () => import('./web').then((m) => new m.NativePurchasesWeb()),\n});\nexport * from './definitions';\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativePurchasesWeb extends WebPlugin {\n async configure(options) {\n void options;\n }\n async getUnfinishedTransactions(options) {\n void options;\n console.error('getUnfinishedTransactions only mocked in web');\n return { transactions: [] };\n }\n async finishTransaction(options) {\n void options;\n console.error('finishTransaction only mocked in web');\n }\n async restorePurchases() {\n console.error('restorePurchases only mocked in web');\n }\n async getProducts(options) {\n console.error('getProducts only mocked in web ' + options);\n return { products: [] };\n }\n async getProduct(options) {\n console.error('getProduct only mocked in web ' + options);\n return { product: {} };\n }\n async purchaseProduct(options) {\n console.error('purchaseProduct only mocked in web' + options);\n return { transactionId: 'transactionId' };\n }\n async isBillingSupported() {\n console.error('isBillingSupported only mocked in web');\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn('Cannot get plugin version in web');\n return { version: 'default' };\n }\n async getPurchases(options) {\n console.error('getPurchases only mocked in web ' + options);\n return { purchases: [] };\n }\n async manageSubscriptions() {\n console.error('manageSubscriptions only mocked in web');\n }\n async presentOfferCodeRedeemSheet() {\n console.error('presentOfferCodeRedeemSheet only mocked in web');\n }\n async acknowledgePurchase(options) {\n void options;\n console.error('acknowledgePurchase only mocked in web');\n }\n async consumePurchase(options) {\n void options;\n throw new Error('consumePurchase is only available on Android');\n }\n async getStorefront() {\n console.error('getStorefront only mocked in web');\n return { countryCode: '' };\n }\n async getAppTransaction() {\n console.error('getAppTransaction only mocked in web');\n return {\n appTransaction: {\n originalAppVersion: '1.0.0',\n originalPurchaseDate: new Date().toISOString(),\n bundleId: 'com.example.app',\n appVersion: '1.0.0',\n environment: null,\n },\n };\n }\n async isEntitledToOldBusinessModel(options) {\n void options;\n console.error('isEntitledToOldBusinessModel only mocked in web');\n return {\n isOlderVersion: false,\n originalAppVersion: '1.0.0',\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TYPE","INTRO_ELIGIBILITY_STATUS","registerPlugin","WebPlug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AAK,CAAC,gDAAgD,CAAC;AACvE,IAAI;AACJ,IAAI,MAAM,mBAAmB,CAAC,OAAO,EAAE;AAEvC,QAAQ,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC;AAC/D,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AAEnC,QAAQ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;AACvE,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC;AACzD,QAAQ,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;AAClC,IAAI;AACJ,IAAI,MAAM,iBAAiB,GAAG;AAC9B,QAAQ,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC;AAC7D,QAAQ,OAAO;AACf,YAAY,cAAc,EAAE;AAC5B,gBAAgB,kBAAkB,EAAE,OAAO;AAC3C,gBAAgB,oBAAoB,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC9D,gBAAgB,QAAQ,EAAE,iBAAiB;AAC3C,gBAAgB,UAAU,EAAE,OAAO;AACnC,gBAAgB,WAAW,EAAE,IAAI;AACjC,aAAa;AACb,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,4BAA4B,CAAC,OAAO,EAAE;AAEhD,QAAQ,OAAO,CAAC,KAAK,CAAC,iDAAiD,CAAC;AACxE,QAAQ,OAAO;AACf,YAAY,cAAc,EAAE,KAAK;AACjC,YAAY,kBAAkB,EAAE,OAAO;AACvC,SAAS;AACT,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativePurchases = registerPlugin('NativePurchases', {\n web: () => import('./web').then((m) => new m.NativePurchasesWeb()),\n});\nexport * from './definitions';\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativePurchasesWeb extends WebPlugin {\n async configure(options) {\n void options;\n }\n async getUnfinishedTransactions(options) {\n void options;\n console.error('getUnfinishedTransactions only mocked in web');\n return { transactions: [] };\n }\n async finishTransaction(options) {\n void options;\n console.error('finishTransaction only mocked in web');\n }\n async restorePurchases() {\n console.error('restorePurchases only mocked in web');\n }\n async getProducts(options) {\n console.error('getProducts only mocked in web ' + options);\n return { products: [] };\n }\n async getProduct(options) {\n console.error('getProduct only mocked in web ' + options);\n return { product: {} };\n }\n async purchaseProduct(options) {\n console.error('purchaseProduct only mocked in web' + options);\n return { transactionId: 'transactionId' };\n }\n async isBillingSupported() {\n console.error('isBillingSupported only mocked in web');\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn('Cannot get plugin version in web');\n return { version: 'default' };\n }\n async getPurchases(options) {\n console.error('getPurchases only mocked in web ' + options);\n return { purchases: [] };\n }\n async manageSubscriptions() {\n console.error('manageSubscriptions only mocked in web');\n }\n async presentOfferCodeRedeemSheet() {\n console.error('presentOfferCodeRedeemSheet only mocked in web');\n }\n async acknowledgePurchase(options) {\n void options;\n console.error('acknowledgePurchase only mocked in web');\n }\n async consumePurchase(options) {\n void options;\n throw new Error('consumePurchase is only available on Android');\n }\n async getStorefront() {\n console.error('getStorefront only mocked in web');\n return { countryCode: '' };\n }\n async getAppTransaction() {\n console.error('getAppTransaction only mocked in web');\n return {\n appTransaction: {\n originalAppVersion: '1.0.0',\n originalPurchaseDate: new Date().toISOString(),\n bundleId: 'com.example.app',\n appVersion: '1.0.0',\n environment: null,\n },\n };\n }\n async isEntitledToOldBusinessModel(options) {\n void options;\n console.error('isEntitledToOldBusinessModel only mocked in web');\n return {\n isOlderVersion: false,\n originalAppVersion: '1.0.0',\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TYPE","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AA2B,GAAG;AACxC,QAAQ,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC;AACvE,IAAI;AACJ,IAAI,MAAM,mBAAmB,CAAC,OAAO,EAAE;AAEvC,QAAQ,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC;AAC/D,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AAEnC,QAAQ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;AACvE,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC;AACzD,QAAQ,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;AAClC,IAAI;AACJ,IAAI,MAAM,iBAAiB,GAAG;AAC9B,QAAQ,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC;AAC7D,QAAQ,OAAO;AACf,YAAY,cAAc,EAAE;AAC5B,gBAAgB,kBAAkB,EAAE,OAAO;AAC3C,gBAAgB,oBAAoB,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC9D,gBAAgB,QAAQ,EAAE,iBAAiB;AAC3C,gBAAgB,UAAU,EAAE,OAAO;AACnC,gBAAgB,WAAW,EAAE,IAAI;AACjC,aAAa;AACb,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,4BAA4B,CAAC,OAAO,EAAE;AAEhD,QAAQ,OAAO,CAAC,KAAK,CAAC,iDAAiD,CAAC;AACxE,QAAQ,OAAO;AACf,YAAY,cAAc,EAAE,KAAK;AACjC,YAAY,kBAAkB,EAAE,OAAO;AACvC,SAAS;AACT,IAAI;AACJ;;;;;;;"}
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativePurchases = registerPlugin('NativePurchases', {\n web: () => import('./web').then((m) => new m.NativePurchasesWeb()),\n});\nexport * from './definitions';\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativePurchasesWeb extends WebPlugin {\n async configure(options) {\n void options;\n }\n async getUnfinishedTransactions(options) {\n void options;\n console.error('getUnfinishedTransactions only mocked in web');\n return { transactions: [] };\n }\n async finishTransaction(options) {\n void options;\n console.error('finishTransaction only mocked in web');\n }\n async restorePurchases() {\n console.error('restorePurchases only mocked in web');\n }\n async getProducts(options) {\n console.error('getProducts only mocked in web ' + options);\n return { products: [] };\n }\n async getProduct(options) {\n console.error('getProduct only mocked in web ' + options);\n return { product: {} };\n }\n async purchaseProduct(options) {\n console.error('purchaseProduct only mocked in web' + options);\n return { transactionId: 'transactionId' };\n }\n async isBillingSupported() {\n console.error('isBillingSupported only mocked in web');\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn('Cannot get plugin version in web');\n return { version: 'default' };\n }\n async getPurchases(options) {\n console.error('getPurchases only mocked in web ' + options);\n return { purchases: [] };\n }\n async manageSubscriptions() {\n console.error('manageSubscriptions only mocked in web');\n }\n async presentOfferCodeRedeemSheet() {\n console.error('presentOfferCodeRedeemSheet only mocked in web');\n }\n async acknowledgePurchase(options) {\n void options;\n console.error('acknowledgePurchase only mocked in web');\n }\n async consumePurchase(options) {\n void options;\n throw new Error('consumePurchase is only available on Android');\n }\n async getStorefront() {\n console.error('getStorefront only mocked in web');\n return { countryCode: '' };\n }\n async getAppTransaction() {\n console.error('getAppTransaction only mocked in web');\n return {\n appTransaction: {\n originalAppVersion: '1.0.0',\n originalPurchaseDate: new Date().toISOString(),\n bundleId: 'com.example.app',\n appVersion: '1.0.0',\n environment: null,\n },\n };\n }\n async isEntitledToOldBusinessModel(options) {\n void options;\n console.error('isEntitledToOldBusinessModel only mocked in web');\n return {\n isOlderVersion: false,\n originalAppVersion: '1.0.0',\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names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\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativePurchases = registerPlugin('NativePurchases', {\n web: () => import('./web').then((m) => new m.NativePurchasesWeb()),\n});\nexport * from './definitions';\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativePurchasesWeb extends WebPlugin {\n async configure(options) {\n void options;\n }\n async getUnfinishedTransactions(options) {\n void options;\n console.error('getUnfinishedTransactions only mocked in web');\n return { transactions: [] };\n }\n async finishTransaction(options) {\n void options;\n console.error('finishTransaction only mocked in web');\n }\n async restorePurchases() {\n console.error('restorePurchases only mocked in web');\n }\n async getProducts(options) {\n console.error('getProducts only mocked in web ' + options);\n return { products: [] };\n }\n async getProduct(options) {\n console.error('getProduct only mocked in web ' + options);\n return { product: {} };\n }\n async purchaseProduct(options) {\n console.error('purchaseProduct only mocked in web' + options);\n return { transactionId: 'transactionId' };\n }\n async isBillingSupported() {\n console.error('isBillingSupported only mocked in web');\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn('Cannot get plugin version in web');\n return { version: 'default' };\n }\n async getPurchases(options) {\n console.error('getPurchases only mocked in web ' + options);\n return { purchases: [] };\n }\n async manageSubscriptions() {\n console.error('manageSubscriptions only mocked in web');\n }\n async presentOfferCodeRedeemSheet() {\n console.error('presentOfferCodeRedeemSheet only mocked in web');\n }\n async acknowledgePurchase(options) {\n void options;\n console.error('acknowledgePurchase only mocked in web');\n }\n async consumePurchase(options) {\n void options;\n throw new Error('consumePurchase is only available on Android');\n }\n async getStorefront() {\n console.error('getStorefront only mocked in web');\n return { countryCode: '' };\n }\n async getAppTransaction() {\n console.error('getAppTransaction only mocked in web');\n return {\n appTransaction: {\n originalAppVersion: '1.0.0',\n originalPurchaseDate: new Date().toISOString(),\n bundleId: 'com.example.app',\n appVersion: '1.0.0',\n environment: null,\n },\n };\n }\n async isEntitledToOldBusinessModel(options) {\n void options;\n console.error('isEntitledToOldBusinessModel only mocked in web');\n return {\n isOlderVersion: false,\n originalAppVersion: '1.0.0',\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TYPE","INTRO_ELIGIBILITY_STATUS","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,mBAAmB,EAAE;IAChC,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,kBAAkB;IACzF,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;IAC3E,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IACzE,CAAC,EAAEA,2BAAmB,KAAKA,2BAAmB,GAAG,EAAE,CAAC,CAAC;AAC1CC;IACX,CAAC,UAAU,aAAa,EAAE;IAC1B;IACA;IACA;IACA,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO;IACpC;IACA;IACA;IACA,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM;IAClC,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC;IACzC;IACA;IACA;IACA;IACA;AACWC;IACX,CAAC,UAAU,eAAe,EAAE;IAC5B;IACA;IACA;IACA,IAAI,eAAe,CAAC,eAAe,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe;IAC3E;IACA;IACA;IACA,IAAI,eAAe,CAAC,eAAe,CAAC,sBAAsB,CAAC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
66
|
-
/// Finishes a StoreKit 2 or legacy transaction
|
|
66
|
+
/// Finishes a StoreKit 2 or legacy transaction. Already-finished StoreKit 2 transactions return without error.
|
|
67
67
|
/// Throws `FinishTransactionError` if the transaction is unverified and not allowed, or cannot be found.
|
|
68
68
|
func finishStoreKitTransaction(
|
|
69
69
|
transactionId: UInt64,
|
|
@@ -26,7 +26,7 @@ public class NativePurchasesPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
26
26
|
CAPPluginMethod(name: "finishTransaction", returnType: CAPPluginReturnPromise)
|
|
27
27
|
]
|
|
28
28
|
|
|
29
|
-
private let pluginVersion: String = "8.9.
|
|
29
|
+
private let pluginVersion: String = "8.9.10"
|
|
30
30
|
var autoFinishTransactions: Bool = true
|
|
31
31
|
private var transactionUpdatesTask: Task<Void, Never>?
|
|
32
32
|
|