@revenuecat/purchases-capacitor 13.0.0 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Package.swift CHANGED
@@ -11,7 +11,7 @@ let package = Package(
11
11
  ],
12
12
  dependencies: [
13
13
  .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
14
- .package(url: "https://github.com/RevenueCat/purchases-hybrid-common.git", exact: "18.0.0")
14
+ .package(url: "https://github.com/RevenueCat/purchases-hybrid-common.git", exact: "18.4.0")
15
15
  ],
16
16
  targets: [
17
17
  .target(
package/README.md CHANGED
@@ -1663,7 +1663,8 @@ Type containing information of installment subscriptions. Currently only support
1663
1663
  | Prop | Type | Description |
1664
1664
  | ------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1665
1665
  | **`product`** | <code><a href="#purchasesstoreproduct">PurchasesStoreProduct</a></code> | The product you want to purchase |
1666
- | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. |
1666
+ | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. If both googleProductChangeInfo and storeProductChangeInfo are provided, storeProductChangeInfo is used and googleProductChangeInfo is ignored. |
1667
+ | **`storeProductChangeInfo`** | <code><a href="#storeproductchangeinfo">StoreProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#storeproductchangeinfo">StoreProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional replacementMode. |
1667
1668
  | **`googleIsPersonalizedPrice`** | <code>boolean \| null</code> | Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info. |
1668
1669
 
1669
1670
 
@@ -1677,6 +1678,16 @@ Holds the information used when upgrading from another sku. For Android use only
1677
1678
  | **`prorationMode`** | <code><a href="#proration_mode">PRORATION_MODE</a></code> | The [PRORATION_MODE] to use when upgrading the given oldSKU. |
1678
1679
 
1679
1680
 
1681
+ #### StoreProductChangeInfo
1682
+
1683
+ Holds the information used when upgrading from another sku. For use on the Play <a href="#store">Store</a> and Galaxy <a href="#store">Store</a> on Android only.
1684
+
1685
+ | Prop | Type | Description |
1686
+ | -------------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------- |
1687
+ | **`oldProductIdentifier`** | <code>string</code> | The old product identifier to upgrade from. |
1688
+ | **`replacementMode`** | <code><a href="#store_replacement_mode">STORE_REPLACEMENT_MODE</a></code> | The [STORE_REPLACEMENT_MODE] to use when upgrading the given oldSKU. |
1689
+
1690
+
1680
1691
  #### PurchaseDiscountedProductOptions
1681
1692
 
1682
1693
  | Prop | Type | Description |
@@ -1703,7 +1714,8 @@ Holds the information about a PromotionalOffer in Apple's App <a href="#store">S
1703
1714
  | Prop | Type | Description |
1704
1715
  | ------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1705
1716
  | **`aPackage`** | <code><a href="#purchasespackage">PurchasesPackage</a></code> | The Package you wish to purchase. You can get the Packages by calling getOfferings |
1706
- | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. |
1717
+ | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. If both googleProductChangeInfo and storeProductChangeInfo are provided, storeProductChangeInfo is used and googleProductChangeInfo is ignored. |
1718
+ | **`storeProductChangeInfo`** | <code><a href="#storeproductchangeinfo">StoreProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#storeproductchangeinfo">StoreProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional replacementMode. |
1707
1719
  | **`googleIsPersonalizedPrice`** | <code>boolean \| null</code> | Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info. |
1708
1720
 
1709
1721
 
@@ -1712,7 +1724,8 @@ Holds the information about a PromotionalOffer in Apple's App <a href="#store">S
1712
1724
  | Prop | Type | Description |
1713
1725
  | ------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1714
1726
  | **`subscriptionOption`** | <code><a href="#subscriptionoption">SubscriptionOption</a></code> | The <a href="#subscriptionoption">SubscriptionOption</a> you wish to purchase. You can get the <a href="#subscriptionoption">SubscriptionOption</a> from StoreProducts by calling getOfferings |
1715
- | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. |
1727
+ | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. If both googleProductChangeInfo and storeProductChangeInfo are provided, storeProductChangeInfo is used and googleProductChangeInfo is ignored. |
1728
+ | **`storeProductChangeInfo`** | <code><a href="#storeproductchangeinfo">StoreProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#storeproductchangeinfo">StoreProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional replacementMode. |
1716
1729
  | **`googleIsPersonalizedPrice`** | <code>boolean \| null</code> | Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info. |
1717
1730
 
1718
1731
 
@@ -2081,13 +2094,24 @@ Listener used to receive log messages from the SDK.
2081
2094
  | Members | Value | Description |
2082
2095
  | --------------------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2083
2096
  | **`UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY`** | <code>0</code> | |
2084
- | **`IMMEDIATE_WITH_TIME_PRORATION`** | <code>1</code> | Replacement takes effect immediately, and the remaining time will be prorated and credited to the user. This is the current default behavior. |
2097
+ | **`IMMEDIATE_WITH_TIME_PRORATION`** | <code>1</code> | Replacement takes effect immediately, and the remaining time will be prorated and credited to the user. |
2085
2098
  | **`IMMEDIATE_AND_CHARGE_PRORATED_PRICE`** | <code>2</code> | Replacement takes effect immediately, and the billing cycle remains the same. The price for the remaining period will be charged. This option is only available for subscription upgrade. |
2086
- | **`IMMEDIATE_WITHOUT_PRORATION`** | <code>3</code> | Replacement takes effect immediately, and the new price will be charged on next recurrence time. The billing cycle stays the same. |
2099
+ | **`IMMEDIATE_WITHOUT_PRORATION`** | <code>3</code> | Replacement takes effect immediately, and the new price will be charged on next recurrence time. The billing cycle stays the same. This is the current default behavior. |
2087
2100
  | **`DEFERRED`** | <code>6</code> | Replacement takes effect when the old plan expires, and the new price will be charged at the same time. |
2088
2101
  | **`IMMEDIATE_AND_CHARGE_FULL_PRICE`** | <code>5</code> | Replacement takes effect immediately, and the user is charged full price of new plan and is given a full billing cycle of subscription, plus remaining prorated time from the old plan. |
2089
2102
 
2090
2103
 
2104
+ #### STORE_REPLACEMENT_MODE
2105
+
2106
+ | Members | Value | Description |
2107
+ | --------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2108
+ | **`WITHOUT_PRORATION`** | <code>"WITHOUT_PRORATION"</code> | Old subscription is cancelled, and new subscription takes effect immediately. User is charged for the full price of the new subscription on the old subscription's expiration date. This is the default behavior for the Galaxy and Play stores. |
2109
+ | **`WITH_TIME_PRORATION`** | <code>"WITH_TIME_PRORATION"</code> | Replacement takes effect immediately, and the remaining time will be prorated and credited to the user. This is the current default behavior. |
2110
+ | **`CHARGE_FULL_PRICE`** | <code>"CHARGE_FULL_PRICE"</code> | Replacement takes effect immediately, and the user is charged full price of new plan and is given a full billing cycle of subscription, plus remaining prorated time from the old plan. This mode is not supported by the Galaxy <a href="#store">Store</a>. If it is passed to the Galaxy <a href="#store">Store</a>, an error will be thrown. |
2111
+ | **`CHARGE_PRORATED_PRICE`** | <code>"CHARGE_PRORATED_PRICE"</code> | Replacement takes effect immediately, and the billing cycle remains the same. The price for the remaining period will be charged. This option is only available for subscription upgrade. |
2112
+ | **`DEFERRED`** | <code>"DEFERRED"</code> | Replacement takes effect when the old plan expires, and the new price will be charged at the same time. |
2113
+
2114
+
2091
2115
  #### LOG_LEVEL
2092
2116
 
2093
2117
  | Members | Value |
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '15.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'PurchasesHybridCommon', '18.0.0'
16
+ s.dependency 'PurchasesHybridCommon', '18.4.0'
17
17
  s.swift_version = '5.1'
18
18
  end
@@ -61,7 +61,7 @@ dependencies {
61
61
  implementation fileTree(dir: 'libs', include: ['*.jar'])
62
62
  implementation project(':capacitor-android')
63
63
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
64
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:18.0.0'
64
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:18.4.0'
65
65
  testImplementation "junit:junit:$junitVersion"
66
66
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
67
67
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -85,7 +85,7 @@ class PurchasesPlugin : Plugin() {
85
85
 
86
86
  companion object {
87
87
  private const val PLATFORM_NAME = "capacitor"
88
- private const val PLUGIN_VERSION = "13.0.0"
88
+ private const val PLUGIN_VERSION = "13.1.0"
89
89
 
90
90
  private const val CUSTOMER_INFO_KEY = "customerInfo"
91
91
  }
@@ -254,10 +254,11 @@ class PurchasesPlugin : Plugin() {
254
254
  type,
255
255
  googleBasePlanId = null,
256
256
  optionalPurchaseParams.oldProductIdentifier,
257
- optionalPurchaseParams.prorationMode,
257
+ googleReplacementModeInt = null,
258
258
  optionalPurchaseParams.isPersonalizedPrice,
259
259
  presentedOfferingContext?.convertToAnyMap(),
260
260
  getOnResult(call),
261
+ storeReplacementModeString = optionalPurchaseParams.replacementMode,
261
262
  )
262
263
  }
263
264
 
@@ -284,9 +285,10 @@ class PurchasesPlugin : Plugin() {
284
285
  packageIdentifier,
285
286
  presentedOfferingContext.convertToAnyMap(),
286
287
  optionalPurchaseParams.oldProductIdentifier,
287
- optionalPurchaseParams.prorationMode,
288
+ googleReplacementModeInt = null,
288
289
  optionalPurchaseParams.isPersonalizedPrice,
289
290
  getOnResult(call),
291
+ storeReplacementModeString = optionalPurchaseParams.replacementMode,
290
292
  )
291
293
  }
292
294
 
@@ -304,10 +306,11 @@ class PurchasesPlugin : Plugin() {
304
306
  productId,
305
307
  subscriptionOptionId,
306
308
  optionalPurchaseParams.oldProductIdentifier,
307
- optionalPurchaseParams.prorationMode,
309
+ googleReplacementModeInt = null,
308
310
  optionalPurchaseParams.isPersonalizedPrice,
309
311
  presentedOfferingContext?.convertToAnyMap(),
310
312
  getOnResult(call),
313
+ storeReplacementModeString = optionalPurchaseParams.replacementMode,
311
314
  )
312
315
  }
313
316
 
@@ -870,16 +873,22 @@ class PurchasesPlugin : Plugin() {
870
873
 
871
874
  private data class PurchaseOptionalInfoParams(
872
875
  val oldProductIdentifier: String?,
873
- val prorationMode: Int?,
876
+ val replacementMode: String?,
874
877
  val isPersonalizedPrice: Boolean?,
875
878
  ) {
876
879
  companion object {
877
880
  fun fromCall(call: PluginCall): PurchaseOptionalInfoParams {
878
881
  val googleProductChangeInfo = call.getObject("googleProductChangeInfo")
882
+ val storeProductChangeInfo = call.getObject("storeProductChangeInfo")
883
+ val productChangeInfo = storeProductChangeInfo ?: googleProductChangeInfo
879
884
  val googleIsPersonalizedPrice = call.getBoolean("googleIsPersonalizedPrice")
880
885
  return PurchaseOptionalInfoParams(
881
- oldProductIdentifier = googleProductChangeInfo?.getString("oldProductIdentifier"),
882
- prorationMode = googleProductChangeInfo?.getInteger("prorationMode"),
886
+ oldProductIdentifier = productChangeInfo?.getString("oldProductIdentifier"),
887
+ replacementMode = if (storeProductChangeInfo != null) {
888
+ storeProductChangeInfo.getString("replacementMode")
889
+ } else {
890
+ googleProductChangeInfo?.getInteger("prorationMode")?.toStoreReplacementMode()
891
+ },
883
892
  isPersonalizedPrice = googleIsPersonalizedPrice,
884
893
  )
885
894
  }
@@ -887,6 +896,16 @@ class PurchasesPlugin : Plugin() {
887
896
  }
888
897
  }
889
898
 
899
+ private fun Int.toStoreReplacementMode(): String? =
900
+ when (this) {
901
+ 1 -> "WITH_TIME_PRORATION"
902
+ 2 -> "CHARGE_PRORATED_PRICE"
903
+ 3 -> "WITHOUT_PRORATION"
904
+ 5 -> "CHARGE_FULL_PRICE"
905
+ 6 -> "DEFERRED"
906
+ else -> null
907
+ }
908
+
890
909
  private fun JSONObject.convertToAnyMap(): Map<String, Any?> =
891
910
  this.keys().asSequence<String>().associate { key ->
892
911
  when (val value = this[key]) {
package/dist/docs.json CHANGED
@@ -3279,13 +3279,27 @@
3279
3279
  },
3280
3280
  {
3281
3281
  "name": "googleProductChangeInfo",
3282
- "tags": [],
3283
- "docs": "Android only. Optional GoogleProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional prorationMode.",
3282
+ "tags": [
3283
+ {
3284
+ "text": "Use storeProductChangeInfo instead.",
3285
+ "name": "deprecated"
3286
+ }
3287
+ ],
3288
+ "docs": "Android only. Optional GoogleProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\nIf both googleProductChangeInfo and storeProductChangeInfo are provided,\nstoreProductChangeInfo is used and googleProductChangeInfo is ignored.",
3284
3289
  "complexTypes": [
3285
3290
  "GoogleProductChangeInfo"
3286
3291
  ],
3287
3292
  "type": "GoogleProductChangeInfo | null | undefined"
3288
3293
  },
3294
+ {
3295
+ "name": "storeProductChangeInfo",
3296
+ "tags": [],
3297
+ "docs": "Android only. Optional StoreProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional replacementMode.",
3298
+ "complexTypes": [
3299
+ "StoreProductChangeInfo"
3300
+ ],
3301
+ "type": "StoreProductChangeInfo | null | undefined"
3302
+ },
3289
3303
  {
3290
3304
  "name": "googleIsPersonalizedPrice",
3291
3305
  "tags": [],
@@ -3300,6 +3314,10 @@
3300
3314
  "slug": "googleproductchangeinfo",
3301
3315
  "docs": "Holds the information used when upgrading from another sku. For Android use only.",
3302
3316
  "tags": [
3317
+ {
3318
+ "text": "Use StoreProductChangeInfo",
3319
+ "name": "deprecated"
3320
+ },
3303
3321
  {
3304
3322
  "name": "public"
3305
3323
  }
@@ -3324,6 +3342,35 @@
3324
3342
  }
3325
3343
  ]
3326
3344
  },
3345
+ {
3346
+ "name": "StoreProductChangeInfo",
3347
+ "slug": "storeproductchangeinfo",
3348
+ "docs": "Holds the information used when upgrading from another sku. For use on the Play Store and Galaxy Store on Android only.",
3349
+ "tags": [
3350
+ {
3351
+ "name": "public"
3352
+ }
3353
+ ],
3354
+ "methods": [],
3355
+ "properties": [
3356
+ {
3357
+ "name": "oldProductIdentifier",
3358
+ "tags": [],
3359
+ "docs": "The old product identifier to upgrade from.",
3360
+ "complexTypes": [],
3361
+ "type": "string"
3362
+ },
3363
+ {
3364
+ "name": "replacementMode",
3365
+ "tags": [],
3366
+ "docs": "The [STORE_REPLACEMENT_MODE] to use when upgrading the given oldSKU.",
3367
+ "complexTypes": [
3368
+ "STORE_REPLACEMENT_MODE"
3369
+ ],
3370
+ "type": "STORE_REPLACEMENT_MODE"
3371
+ }
3372
+ ]
3373
+ },
3327
3374
  {
3328
3375
  "name": "PurchaseDiscountedProductOptions",
3329
3376
  "slug": "purchasediscountedproductoptions",
@@ -3417,13 +3464,27 @@
3417
3464
  },
3418
3465
  {
3419
3466
  "name": "googleProductChangeInfo",
3420
- "tags": [],
3421
- "docs": "Android only. Optional GoogleProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional prorationMode.",
3467
+ "tags": [
3468
+ {
3469
+ "text": "Use storeProductChangeInfo instead.",
3470
+ "name": "deprecated"
3471
+ }
3472
+ ],
3473
+ "docs": "Android only. Optional GoogleProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\nIf both googleProductChangeInfo and storeProductChangeInfo are provided,\nstoreProductChangeInfo is used and googleProductChangeInfo is ignored.",
3422
3474
  "complexTypes": [
3423
3475
  "GoogleProductChangeInfo"
3424
3476
  ],
3425
3477
  "type": "GoogleProductChangeInfo | null | undefined"
3426
3478
  },
3479
+ {
3480
+ "name": "storeProductChangeInfo",
3481
+ "tags": [],
3482
+ "docs": "Android only. Optional StoreProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional replacementMode.",
3483
+ "complexTypes": [
3484
+ "StoreProductChangeInfo"
3485
+ ],
3486
+ "type": "StoreProductChangeInfo | null | undefined"
3487
+ },
3427
3488
  {
3428
3489
  "name": "googleIsPersonalizedPrice",
3429
3490
  "tags": [],
@@ -3451,13 +3512,27 @@
3451
3512
  },
3452
3513
  {
3453
3514
  "name": "googleProductChangeInfo",
3454
- "tags": [],
3455
- "docs": "Android only. Optional GoogleProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional prorationMode.",
3515
+ "tags": [
3516
+ {
3517
+ "text": "Use storeProductChangeInfo instead.",
3518
+ "name": "deprecated"
3519
+ }
3520
+ ],
3521
+ "docs": "Android only. Optional GoogleProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\nIf both googleProductChangeInfo and storeProductChangeInfo are provided,\nstoreProductChangeInfo is used and googleProductChangeInfo is ignored.",
3456
3522
  "complexTypes": [
3457
3523
  "GoogleProductChangeInfo"
3458
3524
  ],
3459
3525
  "type": "GoogleProductChangeInfo | null | undefined"
3460
3526
  },
3527
+ {
3528
+ "name": "storeProductChangeInfo",
3529
+ "tags": [],
3530
+ "docs": "Android only. Optional StoreProductChangeInfo you\nwish to upgrade from containing the oldProductIdentifier and the optional replacementMode.",
3531
+ "complexTypes": [
3532
+ "StoreProductChangeInfo"
3533
+ ],
3534
+ "type": "StoreProductChangeInfo | null | undefined"
3535
+ },
3461
3536
  {
3462
3537
  "name": "googleIsPersonalizedPrice",
3463
3538
  "tags": [],
@@ -4342,7 +4417,7 @@
4342
4417
  "name": "IMMEDIATE_WITH_TIME_PRORATION",
4343
4418
  "value": "1",
4344
4419
  "tags": [],
4345
- "docs": "Replacement takes effect immediately, and the remaining time will be\nprorated and credited to the user. This is the current default behavior."
4420
+ "docs": "Replacement takes effect immediately, and the remaining time will be\nprorated and credited to the user."
4346
4421
  },
4347
4422
  {
4348
4423
  "name": "IMMEDIATE_AND_CHARGE_PRORATED_PRICE",
@@ -4354,7 +4429,7 @@
4354
4429
  "name": "IMMEDIATE_WITHOUT_PRORATION",
4355
4430
  "value": "3",
4356
4431
  "tags": [],
4357
- "docs": "Replacement takes effect immediately, and the new price will be charged on\nnext recurrence time. The billing cycle stays the same."
4432
+ "docs": "Replacement takes effect immediately, and the new price will be charged on\nnext recurrence time. The billing cycle stays the same.\n\nThis is the current default behavior."
4358
4433
  },
4359
4434
  {
4360
4435
  "name": "DEFERRED",
@@ -4370,6 +4445,42 @@
4370
4445
  }
4371
4446
  ]
4372
4447
  },
4448
+ {
4449
+ "name": "STORE_REPLACEMENT_MODE",
4450
+ "slug": "store_replacement_mode",
4451
+ "members": [
4452
+ {
4453
+ "name": "WITHOUT_PRORATION",
4454
+ "value": "\"WITHOUT_PRORATION\"",
4455
+ "tags": [],
4456
+ "docs": "Old subscription is cancelled, and new subscription takes effect immediately.\nUser is charged for the full price of the new subscription on the old subscription's expiration date.\n\nThis is the default behavior for the Galaxy and Play stores."
4457
+ },
4458
+ {
4459
+ "name": "WITH_TIME_PRORATION",
4460
+ "value": "\"WITH_TIME_PRORATION\"",
4461
+ "tags": [],
4462
+ "docs": "Replacement takes effect immediately, and the remaining time will be\nprorated and credited to the user. This is the current default behavior."
4463
+ },
4464
+ {
4465
+ "name": "CHARGE_FULL_PRICE",
4466
+ "value": "\"CHARGE_FULL_PRICE\"",
4467
+ "tags": [],
4468
+ "docs": "Replacement takes effect immediately, and the user is charged full price of new plan and is\ngiven a full billing cycle of subscription, plus remaining prorated time from the old plan.\n\nThis mode is not supported by the Galaxy Store. If it is passed to the Galaxy Store, an error will be thrown."
4469
+ },
4470
+ {
4471
+ "name": "CHARGE_PRORATED_PRICE",
4472
+ "value": "\"CHARGE_PRORATED_PRICE\"",
4473
+ "tags": [],
4474
+ "docs": "Replacement takes effect immediately, and the billing cycle remains the\nsame. The price for the remaining period will be charged. This option is\nonly available for subscription upgrade."
4475
+ },
4476
+ {
4477
+ "name": "DEFERRED",
4478
+ "value": "\"DEFERRED\"",
4479
+ "tags": [],
4480
+ "docs": "Replacement takes effect when the old plan expires, and the new price will be charged at the same time."
4481
+ }
4482
+ ]
4483
+ },
4373
4484
  {
4374
4485
  "name": "LOG_LEVEL",
4375
4486
  "slug": "log_level",
@@ -1,4 +1,4 @@
1
- import type { BILLING_FEATURE, CustomerInfo, CustomerInfoUpdateListener, GoogleProductChangeInfo, IN_APP_MESSAGE_TYPE, IntroEligibility, LOG_LEVEL, LogHandler, LogInResult, MakePurchaseResult, PRODUCT_CATEGORY, PurchasesConfiguration, PurchasesEntitlementInfo, PurchasesOffering, PurchasesOfferings, PurchasesPackage, PurchasesPromotionalOffer, PurchasesStoreProduct, PurchasesStoreProductDiscount, PurchasesStoreTransaction, PurchasesVirtualCurrencies, PurchasesWinBackOffer, REFUND_REQUEST_STATUS, Storefront, SubscriptionOption, WebPurchaseRedemption, WebPurchaseRedemptionResult } from '@revenuecat/purchases-typescript-internal-esm';
1
+ import type { BILLING_FEATURE, CustomerInfo, CustomerInfoUpdateListener, GoogleProductChangeInfo, IN_APP_MESSAGE_TYPE, IntroEligibility, LOG_LEVEL, LogHandler, LogInResult, MakePurchaseResult, PRODUCT_CATEGORY, PurchasesConfiguration, PurchasesEntitlementInfo, PurchasesOffering, PurchasesOfferings, PurchasesPackage, PurchasesPromotionalOffer, PurchasesStoreProduct, PurchasesStoreProductDiscount, PurchasesStoreTransaction, PurchasesVirtualCurrencies, PurchasesWinBackOffer, REFUND_REQUEST_STATUS, StoreProductChangeInfo, Storefront, SubscriptionOption, WebPurchaseRedemption, WebPurchaseRedemptionResult } from '@revenuecat/purchases-typescript-internal-esm';
2
2
  export * from '@revenuecat/purchases-typescript-internal-esm';
3
3
  export type PurchasesCallbackId = string;
4
4
  export interface GetProductOptions {
@@ -19,8 +19,16 @@ export interface PurchaseStoreProductOptions {
19
19
  /**
20
20
  * Android only. Optional GoogleProductChangeInfo you
21
21
  * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
22
+ * If both googleProductChangeInfo and storeProductChangeInfo are provided,
23
+ * storeProductChangeInfo is used and googleProductChangeInfo is ignored.
24
+ * @deprecated Use storeProductChangeInfo instead.
22
25
  */
23
26
  googleProductChangeInfo?: GoogleProductChangeInfo | null;
27
+ /**
28
+ * Android only. Optional StoreProductChangeInfo you
29
+ * wish to upgrade from containing the oldProductIdentifier and the optional replacementMode.
30
+ */
31
+ storeProductChangeInfo?: StoreProductChangeInfo | null;
24
32
  /**
25
33
  * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.
26
34
  * For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true.
@@ -78,8 +86,16 @@ export interface PurchasePackageOptions {
78
86
  /**
79
87
  * Android only. Optional GoogleProductChangeInfo you
80
88
  * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
89
+ * If both googleProductChangeInfo and storeProductChangeInfo are provided,
90
+ * storeProductChangeInfo is used and googleProductChangeInfo is ignored.
91
+ * @deprecated Use storeProductChangeInfo instead.
81
92
  */
82
93
  googleProductChangeInfo?: GoogleProductChangeInfo | null;
94
+ /**
95
+ * Android only. Optional StoreProductChangeInfo you
96
+ * wish to upgrade from containing the oldProductIdentifier and the optional replacementMode.
97
+ */
98
+ storeProductChangeInfo?: StoreProductChangeInfo | null;
83
99
  /**
84
100
  * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.
85
101
  * For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true.
@@ -95,8 +111,16 @@ export interface PurchaseSubscriptionOptionOptions {
95
111
  /**
96
112
  * Android only. Optional GoogleProductChangeInfo you
97
113
  * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
114
+ * If both googleProductChangeInfo and storeProductChangeInfo are provided,
115
+ * storeProductChangeInfo is used and googleProductChangeInfo is ignored.
116
+ * @deprecated Use storeProductChangeInfo instead.
98
117
  */
99
118
  googleProductChangeInfo?: GoogleProductChangeInfo | null;
119
+ /**
120
+ * Android only. Optional StoreProductChangeInfo you
121
+ * wish to upgrade from containing the oldProductIdentifier and the optional replacementMode.
122
+ */
123
+ storeProductChangeInfo?: StoreProductChangeInfo | null;
100
124
  /**
101
125
  * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.
102
126
  * For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true.
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA8BA,cAAc,+CAA+C,CAAC","sourcesContent":["import type {\n BILLING_FEATURE,\n CustomerInfo,\n CustomerInfoUpdateListener,\n GoogleProductChangeInfo,\n IN_APP_MESSAGE_TYPE,\n IntroEligibility,\n LOG_LEVEL,\n LogHandler,\n LogInResult,\n MakePurchaseResult,\n PRODUCT_CATEGORY,\n PurchasesConfiguration,\n PurchasesEntitlementInfo,\n PurchasesOffering,\n PurchasesOfferings,\n PurchasesPackage,\n PurchasesPromotionalOffer,\n PurchasesStoreProduct,\n PurchasesStoreProductDiscount,\n PurchasesStoreTransaction,\n PurchasesVirtualCurrencies,\n PurchasesWinBackOffer,\n REFUND_REQUEST_STATUS,\n Storefront,\n SubscriptionOption,\n WebPurchaseRedemption,\n WebPurchaseRedemptionResult,\n} from '@revenuecat/purchases-typescript-internal-esm';\n\nexport * from '@revenuecat/purchases-typescript-internal-esm';\n\nexport type PurchasesCallbackId = string;\n\nexport interface GetProductOptions {\n /**\n * Array of product identifiers to obtain\n */\n productIdentifiers: string[];\n /**\n * Optional type of products to fetch, can be SUBSCRIPTION or NON_SUBSCRIPTION. SUBSCRIPTION by default. Ignored in iOS.\n */\n type?: PRODUCT_CATEGORY;\n}\n\nexport interface PurchaseStoreProductOptions {\n /**\n * The product you want to purchase\n */\n product: PurchasesStoreProduct;\n /**\n * Android only. Optional GoogleProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\n */\n googleProductChangeInfo?: GoogleProductChangeInfo | null;\n /**\n * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.\n * For compliance with EU regulations. User will see \"This price has been customized for you\" in the purchase dialog when true.\n * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.\n */\n googleIsPersonalizedPrice?: boolean | null;\n}\n\nexport interface PurchaseDiscountedProductOptions {\n /**\n * The product you want to purchase\n */\n product: PurchasesStoreProduct;\n /**\n * Discount to apply to this package. Retrieve this discount using getPromotionalOffer.\n */\n discount: PurchasesPromotionalOffer;\n}\n\nexport interface GetEligibleWinBackOffersForProductOptions {\n /**\n * The product you want to fetch eligible win-back offers for\n */\n product: PurchasesStoreProduct;\n}\n\nexport interface GetEligibleWinBackOffersForPackageOptions {\n /**\n * The package you want to fetch eligible win-back offers for\n */\n aPackage: PurchasesPackage;\n}\n\nexport interface PurchaseProductWithWinBackOfferOptions {\n /**\n * The product you want to purchase\n */\n product: PurchasesStoreProduct;\n /**\n * Win-back offer to apply to this purchase. Retrieve this using getEligibleWinBackOffersForProduct.\n */\n winBackOffer: PurchasesWinBackOffer;\n}\n\nexport interface PurchasePackageWithWinBackOfferOptions {\n /**\n * The package you want to purchase\n */\n aPackage: PurchasesPackage;\n /**\n * Win-back offer to apply to this purchase. Retrieve this using getEligibleWinBackOffersForPackage.\n */\n winBackOffer: PurchasesWinBackOffer;\n}\n\nexport interface PurchasePackageOptions {\n /**\n * The Package you wish to purchase. You can get the Packages by calling getOfferings\n */\n aPackage: PurchasesPackage;\n /**\n * Android only. Optional GoogleProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\n */\n googleProductChangeInfo?: GoogleProductChangeInfo | null;\n /**\n * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.\n * For compliance with EU regulations. User will see \"This price has been customized for you\" in the purchase dialog when true.\n * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.\n */\n googleIsPersonalizedPrice?: boolean | null;\n}\n\nexport interface PurchaseSubscriptionOptionOptions {\n /**\n * The SubscriptionOption you wish to purchase. You can get the SubscriptionOption from StoreProducts by calling getOfferings\n */\n subscriptionOption: SubscriptionOption;\n /**\n * Android only. Optional GoogleProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\n */\n googleProductChangeInfo?: GoogleProductChangeInfo | null;\n /**\n * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.\n * For compliance with EU regulations. User will see \"This price has been customized for you\" in the purchase dialog when true.\n * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.\n */\n googleIsPersonalizedPrice?: boolean | null;\n}\n\nexport interface PurchaseDiscountedPackageOptions {\n /**\n * The Package you wish to purchase. You can get the Packages by calling getOfferings\n */\n aPackage: PurchasesPackage;\n /**\n * Discount to apply to this package. Retrieve this discount using getPromotionalOffer.\n */\n discount: PurchasesPromotionalOffer;\n}\n\nexport interface SyncAmazonPurchaseOptions {\n /**\n * Product ID associated to the purchase.\n */\n productID: string;\n /**\n * ReceiptId that represents the Amazon purchase.\n */\n receiptID: string;\n /**\n * Amazon's userID. This parameter will be ignored when syncing a Google purchase.\n */\n amazonUserID: string;\n /**\n * Product's currency code in ISO 4217 format.\n */\n isoCurrencyCode?: string | null;\n /**\n * Product's price.\n */\n price?: number | null;\n}\n\n/**\n * @deprecated - Use SyncAmazonPurchaseOptions instead\n */\nexport type SyncObserverModeAmazonPurchaseOptions = SyncAmazonPurchaseOptions;\n\nexport interface GetPromotionalOfferOptions {\n /**\n * The `PurchasesStoreProduct` the user intends to purchase.\n */\n product: PurchasesStoreProduct;\n /**\n * The `PurchasesStoreProductDiscount` to apply to the product.\n */\n discount: PurchasesStoreProductDiscount;\n}\n\nexport interface PurchasesPlugin {\n /**\n * Sets up Purchases with your API key and an app user id.\n * @param {PurchasesConfiguration} configuration RevenueCat configuration object including the API key and other optional parameters. See {@link PurchasesConfiguration}\n */\n configure(configuration: PurchasesConfiguration): Promise<void>;\n\n /**\n * Fetches the virtual currencies for the current subscriber.\n *\n * @returns {Promise<{ virtualCurrencies: PurchasesVirtualCurrencies }>} A promise of a {@link PurchasesVirtualCurrencies} object.\n * The promise will be rejected if configure has not been called yet or if an error occurs while getting the virtual currencies.\n */\n getVirtualCurrencies(): Promise<{ virtualCurrencies: PurchasesVirtualCurrencies }>;\n\n /**\n * Invalidates the cache for virtual currencies.\n *\n * This is useful for cases where a virtual currency's balance might have been updated\n * outside of the app, like if you decreased a user's balance from the user spending a virtual currency,\n * or if you increased the balance from your backend using the server APIs.\n */\n invalidateVirtualCurrenciesCache(): Promise<void>;\n\n /**\n * The currently cached {@link PurchasesVirtualCurrencies} if one is available.\n * This value will remain null until virtual currencies have been fetched at\n * least once with {@link getVirtualCurrencies} or an equivalent function.\n *\n * @returns {Promise<{ cachedVirtualCurrencies: PurchasesVirtualCurrencies | null }>} The currently cached virtual currencies for the current subscriber.\n * The promise will be rejected if configure has not been called yet or there's an error.\n */\n getCachedVirtualCurrencies(): Promise<{ cachedVirtualCurrencies: PurchasesVirtualCurrencies | null }>;\n\n /**\n * Parses the given URL string into a [WebPurchaseRedemption] object that can be used to redeem web purchases.\n * @param options Set the urlString used to open the App.\n * @returns {Promise<{ webPurchaseRedemption: WebPurchaseRedemption | null}>} A promise of a WebPurchaseRedemption\n * object that can be redeemed using {@link redeemWebPurchase} or null if the link is invalid.\n */\n parseAsWebPurchaseRedemption(options: {\n urlString: string;\n }): Promise<{ webPurchaseRedemption: WebPurchaseRedemption | null }>;\n\n /**\n * Redeems the web purchase associated with the Redemption Link obtained with [parseAsWebPurchaseRedemption].\n * @param options The WebPurchaseRedemption object obtained from {@link parseAsWebPurchaseRedemption}.\n * @returns {Promise<WebPurchaseRedemptionResult>} The result of the redemption process.\n * Can throw if an invalid WebPurchaseRedemption parameter is passed or Purchases is not configured.\n */\n redeemWebPurchase(options: { webPurchaseRedemption: WebPurchaseRedemption }): Promise<WebPurchaseRedemptionResult>;\n\n /**\n * Sets whether the SDK should return mocked results in the web version.\n * This won't affect the iOS and Android versions of the implementation.\n * Default is false\n * @param options Set shouldMockWebResults to true if you want the plugin methods to return mocked values\n */\n setMockWebResults(options: { shouldMockWebResults: boolean }): Promise<void>;\n\n /**\n * iOS only.\n * @param options Set this property to true *only* when testing the ask-to-buy / SCA\n * purchases flow. More information: http://errors.rev.cat/ask-to-buy\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n setSimulatesAskToBuyInSandbox(options: { simulatesAskToBuyInSandbox: boolean }): Promise<void>;\n\n /**\n * Sets a function to be called on updated customer info\n * @param {CustomerInfoUpdateListener} customerInfoUpdateListener CustomerInfo update listener\n */\n addCustomerInfoUpdateListener(customerInfoUpdateListener: CustomerInfoUpdateListener): Promise<PurchasesCallbackId>;\n\n /**\n * Removes a given CustomerInfoUpdateListener\n * @param {CustomerInfoUpdateListener} options Include listenerToRemove, which is a CustomerInfoUpdateListener\n * reference of the listener to remove\n * @returns Promise with boolean. True if listener was removed, false otherwise\n */\n removeCustomerInfoUpdateListener(options: {\n listenerToRemove: PurchasesCallbackId;\n }): Promise<{ wasRemoved: boolean }>;\n\n // TODO: Support addShouldPurchasePromoProductListener functionality\n // /**\n // * Sets a function to be called on purchases initiated on the Apple App Store. This is only used in iOS.\n // * @param {ShouldPurchasePromoProductListener} shouldPurchasePromoProductListener Called when a user initiates a\n // * promotional in-app purchase from the App Store. If your app is able to handle a purchase at the current time, run\n // * the deferredPurchase function. If the app is not in a state to make a purchase: cache the deferredPurchase, then\n // * call the deferredPurchase when the app is ready to make the promotional purchase.\n // * If the purchase should never be made, you don't need to ever call the deferredPurchase and the app will not\n // * proceed with promotional purchases.\n // */\n // addShouldPurchasePromoProductListener(\n // shouldPurchasePromoProductListener: ShouldPurchasePromoProductListener,\n // ): Promise<PurchasesCallbackId>;\n //\n // /**\n // * Removes a given ShouldPurchasePromoProductListener\n // * @param {ShouldPurchasePromoProductListener} listenerToRemove ShouldPurchasePromoProductListener reference of\n // * the listener to remove\n // * @returns Promise with boolean. True if listener was removed, false otherwise\n // */\n // removeShouldPurchasePromoProductListener(\n // listenerToRemove: PurchasesCallbackId,\n // ): Promise<{ wasRemoved: boolean }>;\n\n /**\n * Gets the map of entitlements -> offerings -> products\n * @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if configure\n * has not been called yet.\n */\n getOfferings(): Promise<PurchasesOfferings>;\n\n /**\n * Retrieves a current offering for a placement identifier, use this to access offerings defined by targeting\n * placements configured in the RevenueCat dashboard.\n * @returns {Promise<PurchasesOffering | null>} Promise of optional offering. The promise will be rejected if configure\n * has not been called yet.\n */\n getCurrentOfferingForPlacement(options: { placementIdentifier: string }): Promise<PurchasesOffering | null>;\n\n /**\n * Syncs subscriber attributes and then fetches the configured offerings for this user. This method is intended to\n * be called when using Targeting Rules with Custom Attributes. Any subscriber attributes should be set before\n * calling this method to ensure the returned offerings are applied with the latest subscriber attributes.\n * @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if configure\n * has not been called yet.\n */\n syncAttributesAndOfferingsIfNeeded(): Promise<PurchasesOfferings>;\n\n /**\n * Fetch the product info\n * @returns {Promise<PurchasesStoreProduct[]>} A promise containing an array of products. The promise will be rejected\n * if the products are not properly configured in RevenueCat or if there is another error retrieving them.\n * Rejections return an error code, and a userInfo object with more information. The promise will also be rejected\n * if configure has not been called yet.\n */\n getProducts(options: GetProductOptions): Promise<{ products: PurchasesStoreProduct[] }>;\n\n /**\n * Make a purchase\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code,\n * a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will\n * also be rejected if configure has not been called yet.\n */\n purchaseStoreProduct(options: PurchaseStoreProductOptions): Promise<MakePurchaseResult>;\n\n /**\n * iOS only. Purchase a product applying a given discount.\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code,\n * a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be\n * rejected if configure has not been called yet.\n */\n purchaseDiscountedProduct(options: PurchaseDiscountedProductOptions): Promise<MakePurchaseResult>;\n\n /**\n * Make a purchase\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet.\n */\n purchasePackage(options: PurchasePackageOptions): Promise<MakePurchaseResult>;\n\n /**\n * Google only. Make a purchase of a subscriptionOption\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet.\n */\n purchaseSubscriptionOption(options: PurchaseSubscriptionOptionOptions): Promise<MakePurchaseResult>;\n\n /**\n * iOS only. Purchase a package applying a given discount.\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet.\n */\n purchaseDiscountedPackage(options: PurchaseDiscountedPackageOptions): Promise<MakePurchaseResult>;\n\n /**\n * Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.\n * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code, and an\n * userInfo object with more information. The promise will be also be rejected if configure has not been called yet.\n */\n restorePurchases(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * Use this method only if you already have your own IAP implementation using StoreKit 2 and want to use\n * RevenueCat's backend. If you are using StoreKit 1 for your implementation, you do not need this method.\n *\n * You only need to use this method with *new* purchases. Subscription updates are observed automatically.\n * @param options The productID that was purchased that needs to be synced with RevenueCat's backend.\n */\n recordPurchase(options: { productID: string }): Promise<{ transaction: PurchasesStoreTransaction }>;\n\n /**\n * Get the appUserID\n * @returns {Promise<string>} The app user id in a promise\n */\n getAppUserID(): Promise<{ appUserID: string }>;\n\n /**\n * Gets the storefront for the current store account.\n * @return {Promise<Storefront>} A promise of a Storefront object.\n * The promise will be rejected if configure has not been called yet or if storefront could\n * not be obtained for account.\n */\n getStorefront(): Promise<Storefront>;\n\n /**\n * This function will log in the current user with an appUserID. Typically, this would be used after a log in\n * to identify a user without calling configure.\n * @param options The appUserID that should be linked to the current user\n * @returns {Promise<LogInResult>} A promise of an object that contains the customerInfo after logging in, as well\n * as a boolean indicating whether the user has just been created for the first time in the RevenueCat backend. The\n * promise will be rejected if configure has not been called yet or if there's an issue logging in.\n */\n logIn(options: { appUserID: string }): Promise<LogInResult>;\n\n /**\n * Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.\n * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code,\n * and a userInfo object with more information. The promise will be rejected if configure has not been called yet or if\n * there's an issue logging out.\n */\n logOut(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * Used to set the log level. Useful for debugging issues with the lovely team @RevenueCat.\n * The default is {LOG_LEVEL.INFO} in release builds and {LOG_LEVEL.DEBUG} in debug builds.\n * @param options Log level to use to display logs.\n */\n setLogLevel(options: { level: LOG_LEVEL }): Promise<void>;\n\n /**\n * Set a custom log handler for redirecting logs to your own logging system.\n * By default, this sends info, warning, and error messages.\n * If you wish to receive Debug level messages, see [setLogLevel].\n * @param {LogHandler} logHandler It will get called for each log event.\n * Use this function to redirect the log to your own logging system\n */\n setLogHandler(logHandler: LogHandler): Promise<void>;\n\n /**\n * Gets current customer info\n * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code, and an\n * userInfo object with more information. The promise will be rejected if configure has not been called yet or if\n * there's an issue getting the customer information.\n */\n getCustomerInfo(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * This method will send all the purchases to the RevenueCat backend. Call this when using your own implementation\n * for subscriptions anytime a sync is needed, like after a successful purchase.\n *\n * @warning This function should only be called if you're not calling purchaseProduct/purchaseStoreProduct/purchasePackage/purchaseSubscriptionOption.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * syncing purchases.\n */\n syncPurchases(): Promise<void>;\n\n /**\n * @deprecated - Use syncAmazonPurchase instead\n * This method will send a purchase to the RevenueCat backend. This function should only be called if you are\n * in Amazon observer mode or performing a client side migration of your current users to RevenueCat.\n *\n * The receipt IDs are cached if successfully posted, so they are not posted more than once.\n *\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * syncing purchases.\n */\n syncObserverModeAmazonPurchase(options: SyncObserverModeAmazonPurchaseOptions): Promise<void>;\n\n /**\n * This method will send a purchase to the RevenueCat backend. This function should only be called if you are\n * in Amazon observer mode or performing a client side migration of your current users to RevenueCat.\n *\n * The receipt IDs are cached if successfully posted, so they are not posted more than once.\n *\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * syncing purchases.\n */\n syncAmazonPurchase(options: SyncAmazonPurchaseOptions): Promise<void>;\n\n /**\n * Enable automatic collection of Apple Search Ad attribution on iOS. Disabled by default. Supported in iOS 14.3+ only\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n enableAdServicesAttributionTokenCollection(): Promise<void>;\n\n /**\n * @returns { Promise<boolean> } If the `appUserID` has been generated by RevenueCat or not.\n * The promise will be rejected if configure has not been called yet.\n */\n isAnonymous(): Promise<{ isAnonymous: boolean }>;\n\n /**\n * iOS only. Computes whether a user is eligible for the introductory pricing period of a given product.\n * You should use this method to determine whether you show the user the normal product price or the\n * introductory price. This also applies to trials (trials are considered a type of introductory pricing).\n *\n * @note Subscription groups are automatically collected for determining eligibility. If RevenueCat can't\n * definitively compute the eligibility, most likely because of missing group information, it will return\n * `INTRO_ELIGIBILITY_STATUS_UNKNOWN`. The best course of action on unknown status is to display the non-intro\n * pricing, to not create a misleading situation. To avoid this, make sure you are testing with the latest version of\n * iOS so that the subscription group can be collected by the SDK. Android always returns INTRO_ELIGIBILITY_STATUS_UNKNOWN.\n *\n * @param options Array of product identifiers for which you want to compute eligibility\n * @returns { Promise<[productId: string]: IntroEligibility> } A map of IntroEligility per productId. The promise\n * will be rejected if configure has not been called yet or if there's in an error checking eligibility.\n */\n checkTrialOrIntroductoryPriceEligibility(options: {\n productIdentifiers: string[];\n }): Promise<{ [productId: string]: IntroEligibility }>;\n\n /**\n * iOS only. Use this function to retrieve the `PurchasesPromotionalOffer` for a given `PurchasesPackage`.\n *\n * @returns { Promise<PurchasesPromotionalOffer | undefined> } Returns when the `PurchasesPaymentDiscount` is returned.\n * Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been\n * called yet or if there's an error getting the payment discount.\n */\n getPromotionalOffer(options: GetPromotionalOfferOptions): Promise<PurchasesPromotionalOffer | undefined>;\n\n /**\n * iOS only, requires iOS 18.0 or greater with StoreKit 2. Use this function to retrieve\n * the eligible `PurchasesWinBackOffer`s that a subscriber is eligible for for a\n * given `PurchasesStoreProduct`.\n *\n * @returns { Promise<{ eligibleWinBackOffers: PurchasesWinBackOffer[] }> } A dictionary containing an array of `PurchasesWinBackOffer`s that\n * the subscriber is eligible for for the given `PurchasesStoreProduct`.\n * The promise will be rejected if called on an unsupported platform (Android or iOS < 18), or if called on iOS 18+ with StoreKit 1.\n * The promise will also be rejected if configure has not been called yet.\n */\n getEligibleWinBackOffersForProduct(options: GetEligibleWinBackOffersForProductOptions): Promise<{\n eligibleWinBackOffers: PurchasesWinBackOffer[];\n }>;\n\n /**\n * iOS only, requires iOS 18.0 or greater with StoreKit 2. Use this function to retrieve\n * the eligible `PurchasesWinBackOffer`s that a subscriber is eligible for for a\n * given `PurchasesStorePackage`.\n *\n * @returns { Promise<{ eligibleWinBackOffers: PurchasesWinBackOffer[] }> } An array of `PurchasesWinBackOffer`s that\n * the subscriber is eligible for for the given `PurchasesStorePackage`.\n * The promise will be rejected if called on an unsupported platform (Android or iOS < 18), or if called on iOS 18+ with StoreKit 1.\n * The promise will also be rejected if configure has not been called yet.\n */\n getEligibleWinBackOffersForPackage(options: GetEligibleWinBackOffersForPackageOptions): Promise<{\n eligibleWinBackOffers: PurchasesWinBackOffer[];\n }>;\n\n /**\n * iOS only, requires iOS 18.0 or greater with StoreKit 2. Purchase a product applying a given win-back offer.\n *\n * @returns {Promise<MakePurchaseResult>} A promise of an object containing\n * a customer info object, a transaction, and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet or if called in an unsupported platform (Android or iOS < 18), or if called on iOS 18+ with StoreKit 1.\n */\n purchaseProductWithWinBackOffer(\n options: PurchaseProductWithWinBackOfferOptions,\n ): Promise<MakePurchaseResult | undefined>;\n\n /**\n * iOS only, requires iOS 18.0 or greater with StoreKit 2. Purchase a package applying a given win-back offer.\n *\n * @returns {Promise<MakePurchaseResult>} A promise of an object containing\n * a customer info object, a transaction, and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet or if called in an unsupported platform (Android or iOS < 18), or if called on iOS 18+ with StoreKit 1.\n */\n purchasePackageWithWinBackOffer(\n options: PurchasePackageWithWinBackOfferOptions,\n ): Promise<MakePurchaseResult | undefined>;\n\n /**\n * Invalidates the cache for customer information.\n *\n * Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.\n * Refer to https://docs.revenuecat.com/docs/customer-info#section-get-user-information for more information on\n * using the cache properly.\n *\n * This is useful for cases where customer information might have been updated outside the app, like if a\n * promotional subscription is granted through the RevenueCat dashboard.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error\n * invalidating the customer info cache.\n */\n invalidateCustomerInfoCache(): Promise<void>;\n\n /** iOS 14.0+ only. Presents a code redemption sheet, useful for redeeming offer codes\n * Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how\n * to configure and use offer codes\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error\n * presenting the code redemption sheet.\n */\n presentCodeRedemptionSheet(): Promise<void>;\n\n /**\n * Subscriber attributes are useful for storing additional, structured information on a user.\n * Since attributes are writable using a public key they should not be used for\n * managing secure or sensitive information such as subscription status, coins, etc.\n *\n * Key names starting with \"$\" are reserved names used by RevenueCat. For a full list of key\n * restrictions refer to our guide: https://docs.revenuecat.com/docs/subscriber-attributes\n *\n * @param attributes Map of attributes by key. Set the value as an empty string to delete an attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error\n * setting the subscriber attributes.\n */\n setAttributes(attributes: { [key: string]: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the email address for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the email.\n */\n setEmail(options: { email: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the phone number for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the phone number.\n */\n setPhoneNumber(options: { phoneNumber: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the display name for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the display name.\n */\n setDisplayName(options: { displayName: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the push token for the user\n *\n * @param options null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the push token.\n */\n setPushToken(options: { pushToken: string | null }): Promise<void>;\n\n /**\n * Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value\n * from your RevenueCat contact.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the proxy url.\n */\n setProxyURL(options: { url: string }): Promise<void>;\n\n /**\n * Automatically collect subscriber attributes associated with the device identifiers.\n * $idfa, $idfv, $ip on iOS\n * $gpsAdId, $androidId, $ip on Android\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting collecting the device identifiers.\n */\n collectDeviceIdentifiers(): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Adjust ID for the user\n * Required for the RevenueCat Adjust integration\n *\n * @param options Adjust ID to use in Adjust integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting Adjust ID.\n */\n setAdjustID(options: { adjustID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the AppsFlyer ID for the user\n * Required for the RevenueCat AppsFlyer integration\n * @param options Appsflyer ID to use in Appsflyer integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Appsflyer ID.\n */\n setAppsflyerID(options: { appsflyerID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Facebook SDK Anonymous ID for the user\n * Recommended for the RevenueCat Facebook integration\n *\n * @param options Facebook Anonymous ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Facebook Anonymous ID.\n */\n setFBAnonymousID(options: { fbAnonymousID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the mParticle ID for the user\n * Recommended for the RevenueCat mParticle integration\n *\n * @param options Mparticle ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Mparticle ID.\n */\n setMparticleID(options: { mparticleID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the CleverTap ID for the user\n * Required for the RevenueCat CleverTap integration\n *\n * @param options CleverTap user ID to use in CleverTap integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the CleverTap ID.\n */\n setCleverTapID(options: { cleverTapID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Mixpanel Distinct ID for the user\n * Required for the RevenueCat Mixpanel integration\n *\n * @param options Mixpanel Distinct ID to use in Mixpanel integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Mixpanel Distinct ID.\n */\n setMixpanelDistinctID(options: { mixpanelDistinctID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Firebase App Instance ID for the user\n * Required for the RevenueCat Firebase integration\n *\n * @param options Firebase App Instance ID to use in Firebase integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Firebase App Instance ID.\n */\n setFirebaseAppInstanceID(options: { firebaseAppInstanceID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the OneSignal Player ID for the user\n * Required for the RevenueCat OneSignal integration. Deprecated for OneSignal versions above v9.0.\n *\n * @param options OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the OneSignal ID.\n */\n setOnesignalID(options: { onesignalID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the OneSignal User ID for the user\n * Required for the RevenueCat OneSignal integration with versions v11.0 and above.\n *\n * @param options OneSignal UserId to use in OneSignal integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the OneSignal user ID.\n */\n setOnesignalUserID(options: { onesignalUserID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Airship Channel ID for the user\n * Required for the RevenueCat Airship integration\n *\n * @param options Airship Channel ID to use in Airship integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Airship Channel ID.\n */\n setAirshipChannelID(options: { airshipChannelID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install media source for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the media source.\n */\n setMediaSource(options: { mediaSource: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install campaign for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the campaign.\n */\n setCampaign(options: { campaign: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install ad group for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting ad group.\n */\n setAdGroup(options: { adGroup: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install ad for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the ad subscriber attribute.\n */\n setAd(options: { ad: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install keyword for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the keyword.\n */\n setKeyword(options: { keyword: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install ad creative for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the creative subscriber attribute.\n */\n setCreative(options: { creative: string | null }): Promise<void>;\n\n /**\n * Check if billing is supported for the current user (meaning IN-APP purchases are supported)\n * and optionally, whether a list of specified feature types are supported.\n *\n * Note: Billing features are only relevant to Google Play Android users.\n * For other stores and platforms, billing features won't be checked.\n *\n * @param options An array of feature types to check for support. Feature types must be one of\n * [BILLING_FEATURE]. By default, is an empty list and no specific feature support will be checked.\n * @returns promise with boolean response. True if billing is supported, false otherwise.\n */\n canMakePayments(options?: { features?: BILLING_FEATURE[] }): Promise<{ canMakePayments: boolean }>;\n\n /**\n * iOS 15+ only. Presents a refund request sheet in the current window scene for\n * the latest transaction associated with the active entitlement.\n *\n * If the request was unsuccessful, no active entitlements could be found for\n * the user, or multiple active entitlements were found for the user,\n * the promise will return an error.\n * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.\n *\n * Important: This method should only be used if your user can only have a single active entitlement at a given time.\n * If a user could have more than one entitlement at a time, use `beginRefundRequestForEntitlement` instead.\n *\n * @returns Returns refundRequestStatus: The status of the\n * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED\n */\n beginRefundRequestForActiveEntitlement(): Promise<{\n refundRequestStatus: REFUND_REQUEST_STATUS;\n }>;\n\n /**\n * iOS 15+ only. Presents a refund request sheet in the current window scene for\n * the latest transaction associated with the `entitlement`.\n *\n * If the request was unsuccessful, the promise will return an error.\n * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.\n *\n * @param options The entitlement to begin a refund request for.\n * @returns Returns refundRequestStatus: The status of the\n * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED\n */\n beginRefundRequestForEntitlement(options: {\n entitlementInfo: PurchasesEntitlementInfo;\n }): Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS }>;\n\n /**\n * iOS 15+ only. Presents a refund request sheet in the current window scene for\n * the latest transaction associated with the `product`.\n *\n * If the request was unsuccessful, the promise will return an error.\n * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.\n *\n * @param options The StoreProduct to begin a refund request for.\n * @returns {Promise<REFUND_REQUEST_STATUS>} Returns a REFUND_REQUEST_STATUS: The status of the\n * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED\n */\n beginRefundRequestForProduct(options: {\n storeProduct: PurchasesStoreProduct;\n }): Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS }>;\n\n /**\n * Shows in-app messages available from the App Store or Google Play. You need to disable messages from showing\n * automatically using [PurchasesConfiguration.shouldShowInAppMessagesAutomatically].\n *\n * Note: In iOS, this requires version 16+. In older versions the promise will be resolved successfully\n * immediately.\n *\n * @param options An array of message types that the stores can display inside your app. Values must be one of\n * [IN_APP_MESSAGE_TYPE]. By default, is undefined and all message types will be shown.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n showInAppMessages(options?: { messageTypes?: IN_APP_MESSAGE_TYPE[] }): Promise<void>;\n\n /**\n * Check if configure has finished and Purchases has been configured.\n *\n * @returns promise with boolean response\n */\n isConfigured(): Promise<{ isConfigured: boolean }>;\n\n /**\n * Override the preferred UI locale for RevenueCat UI components at runtime. This affects both API requests\n * and UI rendering. If the locale changes, this will automatically clear the offerings cache and trigger\n * a background refetch to get paywall templates with the correct localizations.\n *\n * @param options The locale string (e.g., \"es-ES\", \"en-US\") or null to use system default.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n overridePreferredUILocale(options: { locale: string | null }): Promise<void>;\n\n /**\n * Tracks an impression of a custom paywall. Use this to record when a user views your custom paywall\n * so that RevenueCat can track paywall analytics.\n *\n * Call this method once per paywall display, ideally when the paywall first becomes visible to the user,\n * not in callbacks that may fire multiple times for the same display.\n *\n * @param options Optional parameters for the impression. Include `paywallId` to identify which paywall was shown.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n trackCustomPaywallImpression(options?: TrackCustomPaywallImpressionOptions): Promise<void>;\n}\n\n/**\n * Options for tracking a custom paywall impression.\n */\nexport interface TrackCustomPaywallImpressionOptions {\n /** The identifier of the paywall that was shown. */\n paywallId?: string | null;\n /**\n * An optional identifier for the offering associated with the custom paywall.\n * If not provided, the SDK will use the current offering identifier from the cache.\n */\n offeringId?: string | null;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA+BA,cAAc,+CAA+C,CAAC","sourcesContent":["import type {\n BILLING_FEATURE,\n CustomerInfo,\n CustomerInfoUpdateListener,\n GoogleProductChangeInfo,\n IN_APP_MESSAGE_TYPE,\n IntroEligibility,\n LOG_LEVEL,\n LogHandler,\n LogInResult,\n MakePurchaseResult,\n PRODUCT_CATEGORY,\n PurchasesConfiguration,\n PurchasesEntitlementInfo,\n PurchasesOffering,\n PurchasesOfferings,\n PurchasesPackage,\n PurchasesPromotionalOffer,\n PurchasesStoreProduct,\n PurchasesStoreProductDiscount,\n PurchasesStoreTransaction,\n PurchasesVirtualCurrencies,\n PurchasesWinBackOffer,\n REFUND_REQUEST_STATUS,\n StoreProductChangeInfo,\n Storefront,\n SubscriptionOption,\n WebPurchaseRedemption,\n WebPurchaseRedemptionResult,\n} from '@revenuecat/purchases-typescript-internal-esm';\n\nexport * from '@revenuecat/purchases-typescript-internal-esm';\n\nexport type PurchasesCallbackId = string;\n\nexport interface GetProductOptions {\n /**\n * Array of product identifiers to obtain\n */\n productIdentifiers: string[];\n /**\n * Optional type of products to fetch, can be SUBSCRIPTION or NON_SUBSCRIPTION. SUBSCRIPTION by default. Ignored in iOS.\n */\n type?: PRODUCT_CATEGORY;\n}\n\nexport interface PurchaseStoreProductOptions {\n /**\n * The product you want to purchase\n */\n product: PurchasesStoreProduct;\n /**\n * Android only. Optional GoogleProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\n * If both googleProductChangeInfo and storeProductChangeInfo are provided,\n * storeProductChangeInfo is used and googleProductChangeInfo is ignored.\n * @deprecated Use storeProductChangeInfo instead.\n */\n googleProductChangeInfo?: GoogleProductChangeInfo | null;\n /**\n * Android only. Optional StoreProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional replacementMode.\n */\n storeProductChangeInfo?: StoreProductChangeInfo | null;\n /**\n * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.\n * For compliance with EU regulations. User will see \"This price has been customized for you\" in the purchase dialog when true.\n * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.\n */\n googleIsPersonalizedPrice?: boolean | null;\n}\n\nexport interface PurchaseDiscountedProductOptions {\n /**\n * The product you want to purchase\n */\n product: PurchasesStoreProduct;\n /**\n * Discount to apply to this package. Retrieve this discount using getPromotionalOffer.\n */\n discount: PurchasesPromotionalOffer;\n}\n\nexport interface GetEligibleWinBackOffersForProductOptions {\n /**\n * The product you want to fetch eligible win-back offers for\n */\n product: PurchasesStoreProduct;\n}\n\nexport interface GetEligibleWinBackOffersForPackageOptions {\n /**\n * The package you want to fetch eligible win-back offers for\n */\n aPackage: PurchasesPackage;\n}\n\nexport interface PurchaseProductWithWinBackOfferOptions {\n /**\n * The product you want to purchase\n */\n product: PurchasesStoreProduct;\n /**\n * Win-back offer to apply to this purchase. Retrieve this using getEligibleWinBackOffersForProduct.\n */\n winBackOffer: PurchasesWinBackOffer;\n}\n\nexport interface PurchasePackageWithWinBackOfferOptions {\n /**\n * The package you want to purchase\n */\n aPackage: PurchasesPackage;\n /**\n * Win-back offer to apply to this purchase. Retrieve this using getEligibleWinBackOffersForPackage.\n */\n winBackOffer: PurchasesWinBackOffer;\n}\n\nexport interface PurchasePackageOptions {\n /**\n * The Package you wish to purchase. You can get the Packages by calling getOfferings\n */\n aPackage: PurchasesPackage;\n /**\n * Android only. Optional GoogleProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\n * If both googleProductChangeInfo and storeProductChangeInfo are provided,\n * storeProductChangeInfo is used and googleProductChangeInfo is ignored.\n * @deprecated Use storeProductChangeInfo instead.\n */\n googleProductChangeInfo?: GoogleProductChangeInfo | null;\n /**\n * Android only. Optional StoreProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional replacementMode.\n */\n storeProductChangeInfo?: StoreProductChangeInfo | null;\n /**\n * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.\n * For compliance with EU regulations. User will see \"This price has been customized for you\" in the purchase dialog when true.\n * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.\n */\n googleIsPersonalizedPrice?: boolean | null;\n}\n\nexport interface PurchaseSubscriptionOptionOptions {\n /**\n * The SubscriptionOption you wish to purchase. You can get the SubscriptionOption from StoreProducts by calling getOfferings\n */\n subscriptionOption: SubscriptionOption;\n /**\n * Android only. Optional GoogleProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.\n * If both googleProductChangeInfo and storeProductChangeInfo are provided,\n * storeProductChangeInfo is used and googleProductChangeInfo is ignored.\n * @deprecated Use storeProductChangeInfo instead.\n */\n googleProductChangeInfo?: GoogleProductChangeInfo | null;\n /**\n * Android only. Optional StoreProductChangeInfo you\n * wish to upgrade from containing the oldProductIdentifier and the optional replacementMode.\n */\n storeProductChangeInfo?: StoreProductChangeInfo | null;\n /**\n * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.\n * For compliance with EU regulations. User will see \"This price has been customized for you\" in the purchase dialog when true.\n * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.\n */\n googleIsPersonalizedPrice?: boolean | null;\n}\n\nexport interface PurchaseDiscountedPackageOptions {\n /**\n * The Package you wish to purchase. You can get the Packages by calling getOfferings\n */\n aPackage: PurchasesPackage;\n /**\n * Discount to apply to this package. Retrieve this discount using getPromotionalOffer.\n */\n discount: PurchasesPromotionalOffer;\n}\n\nexport interface SyncAmazonPurchaseOptions {\n /**\n * Product ID associated to the purchase.\n */\n productID: string;\n /**\n * ReceiptId that represents the Amazon purchase.\n */\n receiptID: string;\n /**\n * Amazon's userID. This parameter will be ignored when syncing a Google purchase.\n */\n amazonUserID: string;\n /**\n * Product's currency code in ISO 4217 format.\n */\n isoCurrencyCode?: string | null;\n /**\n * Product's price.\n */\n price?: number | null;\n}\n\n/**\n * @deprecated - Use SyncAmazonPurchaseOptions instead\n */\nexport type SyncObserverModeAmazonPurchaseOptions = SyncAmazonPurchaseOptions;\n\nexport interface GetPromotionalOfferOptions {\n /**\n * The `PurchasesStoreProduct` the user intends to purchase.\n */\n product: PurchasesStoreProduct;\n /**\n * The `PurchasesStoreProductDiscount` to apply to the product.\n */\n discount: PurchasesStoreProductDiscount;\n}\n\nexport interface PurchasesPlugin {\n /**\n * Sets up Purchases with your API key and an app user id.\n * @param {PurchasesConfiguration} configuration RevenueCat configuration object including the API key and other optional parameters. See {@link PurchasesConfiguration}\n */\n configure(configuration: PurchasesConfiguration): Promise<void>;\n\n /**\n * Fetches the virtual currencies for the current subscriber.\n *\n * @returns {Promise<{ virtualCurrencies: PurchasesVirtualCurrencies }>} A promise of a {@link PurchasesVirtualCurrencies} object.\n * The promise will be rejected if configure has not been called yet or if an error occurs while getting the virtual currencies.\n */\n getVirtualCurrencies(): Promise<{ virtualCurrencies: PurchasesVirtualCurrencies }>;\n\n /**\n * Invalidates the cache for virtual currencies.\n *\n * This is useful for cases where a virtual currency's balance might have been updated\n * outside of the app, like if you decreased a user's balance from the user spending a virtual currency,\n * or if you increased the balance from your backend using the server APIs.\n */\n invalidateVirtualCurrenciesCache(): Promise<void>;\n\n /**\n * The currently cached {@link PurchasesVirtualCurrencies} if one is available.\n * This value will remain null until virtual currencies have been fetched at\n * least once with {@link getVirtualCurrencies} or an equivalent function.\n *\n * @returns {Promise<{ cachedVirtualCurrencies: PurchasesVirtualCurrencies | null }>} The currently cached virtual currencies for the current subscriber.\n * The promise will be rejected if configure has not been called yet or there's an error.\n */\n getCachedVirtualCurrencies(): Promise<{ cachedVirtualCurrencies: PurchasesVirtualCurrencies | null }>;\n\n /**\n * Parses the given URL string into a [WebPurchaseRedemption] object that can be used to redeem web purchases.\n * @param options Set the urlString used to open the App.\n * @returns {Promise<{ webPurchaseRedemption: WebPurchaseRedemption | null}>} A promise of a WebPurchaseRedemption\n * object that can be redeemed using {@link redeemWebPurchase} or null if the link is invalid.\n */\n parseAsWebPurchaseRedemption(options: {\n urlString: string;\n }): Promise<{ webPurchaseRedemption: WebPurchaseRedemption | null }>;\n\n /**\n * Redeems the web purchase associated with the Redemption Link obtained with [parseAsWebPurchaseRedemption].\n * @param options The WebPurchaseRedemption object obtained from {@link parseAsWebPurchaseRedemption}.\n * @returns {Promise<WebPurchaseRedemptionResult>} The result of the redemption process.\n * Can throw if an invalid WebPurchaseRedemption parameter is passed or Purchases is not configured.\n */\n redeemWebPurchase(options: { webPurchaseRedemption: WebPurchaseRedemption }): Promise<WebPurchaseRedemptionResult>;\n\n /**\n * Sets whether the SDK should return mocked results in the web version.\n * This won't affect the iOS and Android versions of the implementation.\n * Default is false\n * @param options Set shouldMockWebResults to true if you want the plugin methods to return mocked values\n */\n setMockWebResults(options: { shouldMockWebResults: boolean }): Promise<void>;\n\n /**\n * iOS only.\n * @param options Set this property to true *only* when testing the ask-to-buy / SCA\n * purchases flow. More information: http://errors.rev.cat/ask-to-buy\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n setSimulatesAskToBuyInSandbox(options: { simulatesAskToBuyInSandbox: boolean }): Promise<void>;\n\n /**\n * Sets a function to be called on updated customer info\n * @param {CustomerInfoUpdateListener} customerInfoUpdateListener CustomerInfo update listener\n */\n addCustomerInfoUpdateListener(customerInfoUpdateListener: CustomerInfoUpdateListener): Promise<PurchasesCallbackId>;\n\n /**\n * Removes a given CustomerInfoUpdateListener\n * @param {CustomerInfoUpdateListener} options Include listenerToRemove, which is a CustomerInfoUpdateListener\n * reference of the listener to remove\n * @returns Promise with boolean. True if listener was removed, false otherwise\n */\n removeCustomerInfoUpdateListener(options: {\n listenerToRemove: PurchasesCallbackId;\n }): Promise<{ wasRemoved: boolean }>;\n\n // TODO: Support addShouldPurchasePromoProductListener functionality\n // /**\n // * Sets a function to be called on purchases initiated on the Apple App Store. This is only used in iOS.\n // * @param {ShouldPurchasePromoProductListener} shouldPurchasePromoProductListener Called when a user initiates a\n // * promotional in-app purchase from the App Store. If your app is able to handle a purchase at the current time, run\n // * the deferredPurchase function. If the app is not in a state to make a purchase: cache the deferredPurchase, then\n // * call the deferredPurchase when the app is ready to make the promotional purchase.\n // * If the purchase should never be made, you don't need to ever call the deferredPurchase and the app will not\n // * proceed with promotional purchases.\n // */\n // addShouldPurchasePromoProductListener(\n // shouldPurchasePromoProductListener: ShouldPurchasePromoProductListener,\n // ): Promise<PurchasesCallbackId>;\n //\n // /**\n // * Removes a given ShouldPurchasePromoProductListener\n // * @param {ShouldPurchasePromoProductListener} listenerToRemove ShouldPurchasePromoProductListener reference of\n // * the listener to remove\n // * @returns Promise with boolean. True if listener was removed, false otherwise\n // */\n // removeShouldPurchasePromoProductListener(\n // listenerToRemove: PurchasesCallbackId,\n // ): Promise<{ wasRemoved: boolean }>;\n\n /**\n * Gets the map of entitlements -> offerings -> products\n * @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if configure\n * has not been called yet.\n */\n getOfferings(): Promise<PurchasesOfferings>;\n\n /**\n * Retrieves a current offering for a placement identifier, use this to access offerings defined by targeting\n * placements configured in the RevenueCat dashboard.\n * @returns {Promise<PurchasesOffering | null>} Promise of optional offering. The promise will be rejected if configure\n * has not been called yet.\n */\n getCurrentOfferingForPlacement(options: { placementIdentifier: string }): Promise<PurchasesOffering | null>;\n\n /**\n * Syncs subscriber attributes and then fetches the configured offerings for this user. This method is intended to\n * be called when using Targeting Rules with Custom Attributes. Any subscriber attributes should be set before\n * calling this method to ensure the returned offerings are applied with the latest subscriber attributes.\n * @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if configure\n * has not been called yet.\n */\n syncAttributesAndOfferingsIfNeeded(): Promise<PurchasesOfferings>;\n\n /**\n * Fetch the product info\n * @returns {Promise<PurchasesStoreProduct[]>} A promise containing an array of products. The promise will be rejected\n * if the products are not properly configured in RevenueCat or if there is another error retrieving them.\n * Rejections return an error code, and a userInfo object with more information. The promise will also be rejected\n * if configure has not been called yet.\n */\n getProducts(options: GetProductOptions): Promise<{ products: PurchasesStoreProduct[] }>;\n\n /**\n * Make a purchase\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code,\n * a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will\n * also be rejected if configure has not been called yet.\n */\n purchaseStoreProduct(options: PurchaseStoreProductOptions): Promise<MakePurchaseResult>;\n\n /**\n * iOS only. Purchase a product applying a given discount.\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code,\n * a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be\n * rejected if configure has not been called yet.\n */\n purchaseDiscountedProduct(options: PurchaseDiscountedProductOptions): Promise<MakePurchaseResult>;\n\n /**\n * Make a purchase\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet.\n */\n purchasePackage(options: PurchasePackageOptions): Promise<MakePurchaseResult>;\n\n /**\n * Google only. Make a purchase of a subscriptionOption\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet.\n */\n purchaseSubscriptionOption(options: PurchaseSubscriptionOptionOptions): Promise<MakePurchaseResult>;\n\n /**\n * iOS only. Purchase a package applying a given discount.\n *\n * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing\n * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet.\n */\n purchaseDiscountedPackage(options: PurchaseDiscountedPackageOptions): Promise<MakePurchaseResult>;\n\n /**\n * Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.\n * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code, and an\n * userInfo object with more information. The promise will be also be rejected if configure has not been called yet.\n */\n restorePurchases(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * Use this method only if you already have your own IAP implementation using StoreKit 2 and want to use\n * RevenueCat's backend. If you are using StoreKit 1 for your implementation, you do not need this method.\n *\n * You only need to use this method with *new* purchases. Subscription updates are observed automatically.\n * @param options The productID that was purchased that needs to be synced with RevenueCat's backend.\n */\n recordPurchase(options: { productID: string }): Promise<{ transaction: PurchasesStoreTransaction }>;\n\n /**\n * Get the appUserID\n * @returns {Promise<string>} The app user id in a promise\n */\n getAppUserID(): Promise<{ appUserID: string }>;\n\n /**\n * Gets the storefront for the current store account.\n * @return {Promise<Storefront>} A promise of a Storefront object.\n * The promise will be rejected if configure has not been called yet or if storefront could\n * not be obtained for account.\n */\n getStorefront(): Promise<Storefront>;\n\n /**\n * This function will log in the current user with an appUserID. Typically, this would be used after a log in\n * to identify a user without calling configure.\n * @param options The appUserID that should be linked to the current user\n * @returns {Promise<LogInResult>} A promise of an object that contains the customerInfo after logging in, as well\n * as a boolean indicating whether the user has just been created for the first time in the RevenueCat backend. The\n * promise will be rejected if configure has not been called yet or if there's an issue logging in.\n */\n logIn(options: { appUserID: string }): Promise<LogInResult>;\n\n /**\n * Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.\n * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code,\n * and a userInfo object with more information. The promise will be rejected if configure has not been called yet or if\n * there's an issue logging out.\n */\n logOut(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * Used to set the log level. Useful for debugging issues with the lovely team @RevenueCat.\n * The default is {LOG_LEVEL.INFO} in release builds and {LOG_LEVEL.DEBUG} in debug builds.\n * @param options Log level to use to display logs.\n */\n setLogLevel(options: { level: LOG_LEVEL }): Promise<void>;\n\n /**\n * Set a custom log handler for redirecting logs to your own logging system.\n * By default, this sends info, warning, and error messages.\n * If you wish to receive Debug level messages, see [setLogLevel].\n * @param {LogHandler} logHandler It will get called for each log event.\n * Use this function to redirect the log to your own logging system\n */\n setLogHandler(logHandler: LogHandler): Promise<void>;\n\n /**\n * Gets current customer info\n * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code, and an\n * userInfo object with more information. The promise will be rejected if configure has not been called yet or if\n * there's an issue getting the customer information.\n */\n getCustomerInfo(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * This method will send all the purchases to the RevenueCat backend. Call this when using your own implementation\n * for subscriptions anytime a sync is needed, like after a successful purchase.\n *\n * @warning This function should only be called if you're not calling purchaseProduct/purchaseStoreProduct/purchasePackage/purchaseSubscriptionOption.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * syncing purchases.\n */\n syncPurchases(): Promise<void>;\n\n /**\n * @deprecated - Use syncAmazonPurchase instead\n * This method will send a purchase to the RevenueCat backend. This function should only be called if you are\n * in Amazon observer mode or performing a client side migration of your current users to RevenueCat.\n *\n * The receipt IDs are cached if successfully posted, so they are not posted more than once.\n *\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * syncing purchases.\n */\n syncObserverModeAmazonPurchase(options: SyncObserverModeAmazonPurchaseOptions): Promise<void>;\n\n /**\n * This method will send a purchase to the RevenueCat backend. This function should only be called if you are\n * in Amazon observer mode or performing a client side migration of your current users to RevenueCat.\n *\n * The receipt IDs are cached if successfully posted, so they are not posted more than once.\n *\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * syncing purchases.\n */\n syncAmazonPurchase(options: SyncAmazonPurchaseOptions): Promise<void>;\n\n /**\n * Enable automatic collection of Apple Search Ad attribution on iOS. Disabled by default. Supported in iOS 14.3+ only\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n enableAdServicesAttributionTokenCollection(): Promise<void>;\n\n /**\n * @returns { Promise<boolean> } If the `appUserID` has been generated by RevenueCat or not.\n * The promise will be rejected if configure has not been called yet.\n */\n isAnonymous(): Promise<{ isAnonymous: boolean }>;\n\n /**\n * iOS only. Computes whether a user is eligible for the introductory pricing period of a given product.\n * You should use this method to determine whether you show the user the normal product price or the\n * introductory price. This also applies to trials (trials are considered a type of introductory pricing).\n *\n * @note Subscription groups are automatically collected for determining eligibility. If RevenueCat can't\n * definitively compute the eligibility, most likely because of missing group information, it will return\n * `INTRO_ELIGIBILITY_STATUS_UNKNOWN`. The best course of action on unknown status is to display the non-intro\n * pricing, to not create a misleading situation. To avoid this, make sure you are testing with the latest version of\n * iOS so that the subscription group can be collected by the SDK. Android always returns INTRO_ELIGIBILITY_STATUS_UNKNOWN.\n *\n * @param options Array of product identifiers for which you want to compute eligibility\n * @returns { Promise<[productId: string]: IntroEligibility> } A map of IntroEligility per productId. The promise\n * will be rejected if configure has not been called yet or if there's in an error checking eligibility.\n */\n checkTrialOrIntroductoryPriceEligibility(options: {\n productIdentifiers: string[];\n }): Promise<{ [productId: string]: IntroEligibility }>;\n\n /**\n * iOS only. Use this function to retrieve the `PurchasesPromotionalOffer` for a given `PurchasesPackage`.\n *\n * @returns { Promise<PurchasesPromotionalOffer | undefined> } Returns when the `PurchasesPaymentDiscount` is returned.\n * Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been\n * called yet or if there's an error getting the payment discount.\n */\n getPromotionalOffer(options: GetPromotionalOfferOptions): Promise<PurchasesPromotionalOffer | undefined>;\n\n /**\n * iOS only, requires iOS 18.0 or greater with StoreKit 2. Use this function to retrieve\n * the eligible `PurchasesWinBackOffer`s that a subscriber is eligible for for a\n * given `PurchasesStoreProduct`.\n *\n * @returns { Promise<{ eligibleWinBackOffers: PurchasesWinBackOffer[] }> } A dictionary containing an array of `PurchasesWinBackOffer`s that\n * the subscriber is eligible for for the given `PurchasesStoreProduct`.\n * The promise will be rejected if called on an unsupported platform (Android or iOS < 18), or if called on iOS 18+ with StoreKit 1.\n * The promise will also be rejected if configure has not been called yet.\n */\n getEligibleWinBackOffersForProduct(options: GetEligibleWinBackOffersForProductOptions): Promise<{\n eligibleWinBackOffers: PurchasesWinBackOffer[];\n }>;\n\n /**\n * iOS only, requires iOS 18.0 or greater with StoreKit 2. Use this function to retrieve\n * the eligible `PurchasesWinBackOffer`s that a subscriber is eligible for for a\n * given `PurchasesStorePackage`.\n *\n * @returns { Promise<{ eligibleWinBackOffers: PurchasesWinBackOffer[] }> } An array of `PurchasesWinBackOffer`s that\n * the subscriber is eligible for for the given `PurchasesStorePackage`.\n * The promise will be rejected if called on an unsupported platform (Android or iOS < 18), or if called on iOS 18+ with StoreKit 1.\n * The promise will also be rejected if configure has not been called yet.\n */\n getEligibleWinBackOffersForPackage(options: GetEligibleWinBackOffersForPackageOptions): Promise<{\n eligibleWinBackOffers: PurchasesWinBackOffer[];\n }>;\n\n /**\n * iOS only, requires iOS 18.0 or greater with StoreKit 2. Purchase a product applying a given win-back offer.\n *\n * @returns {Promise<MakePurchaseResult>} A promise of an object containing\n * a customer info object, a transaction, and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet or if called in an unsupported platform (Android or iOS < 18), or if called on iOS 18+ with StoreKit 1.\n */\n purchaseProductWithWinBackOffer(\n options: PurchaseProductWithWinBackOfferOptions,\n ): Promise<MakePurchaseResult | undefined>;\n\n /**\n * iOS only, requires iOS 18.0 or greater with StoreKit 2. Purchase a package applying a given win-back offer.\n *\n * @returns {Promise<MakePurchaseResult>} A promise of an object containing\n * a customer info object, a transaction, and a product identifier. Rejections return an error code, a boolean indicating if the\n * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure\n * has not been called yet or if called in an unsupported platform (Android or iOS < 18), or if called on iOS 18+ with StoreKit 1.\n */\n purchasePackageWithWinBackOffer(\n options: PurchasePackageWithWinBackOfferOptions,\n ): Promise<MakePurchaseResult | undefined>;\n\n /**\n * Invalidates the cache for customer information.\n *\n * Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.\n * Refer to https://docs.revenuecat.com/docs/customer-info#section-get-user-information for more information on\n * using the cache properly.\n *\n * This is useful for cases where customer information might have been updated outside the app, like if a\n * promotional subscription is granted through the RevenueCat dashboard.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error\n * invalidating the customer info cache.\n */\n invalidateCustomerInfoCache(): Promise<void>;\n\n /** iOS 14.0+ only. Presents a code redemption sheet, useful for redeeming offer codes\n * Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how\n * to configure and use offer codes\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error\n * presenting the code redemption sheet.\n */\n presentCodeRedemptionSheet(): Promise<void>;\n\n /**\n * Subscriber attributes are useful for storing additional, structured information on a user.\n * Since attributes are writable using a public key they should not be used for\n * managing secure or sensitive information such as subscription status, coins, etc.\n *\n * Key names starting with \"$\" are reserved names used by RevenueCat. For a full list of key\n * restrictions refer to our guide: https://docs.revenuecat.com/docs/subscriber-attributes\n *\n * @param attributes Map of attributes by key. Set the value as an empty string to delete an attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error\n * setting the subscriber attributes.\n */\n setAttributes(attributes: { [key: string]: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the email address for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the email.\n */\n setEmail(options: { email: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the phone number for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the phone number.\n */\n setPhoneNumber(options: { phoneNumber: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the display name for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the display name.\n */\n setDisplayName(options: { displayName: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the push token for the user\n *\n * @param options null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the push token.\n */\n setPushToken(options: { pushToken: string | null }): Promise<void>;\n\n /**\n * Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value\n * from your RevenueCat contact.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the proxy url.\n */\n setProxyURL(options: { url: string }): Promise<void>;\n\n /**\n * Automatically collect subscriber attributes associated with the device identifiers.\n * $idfa, $idfv, $ip on iOS\n * $gpsAdId, $androidId, $ip on Android\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting collecting the device identifiers.\n */\n collectDeviceIdentifiers(): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Adjust ID for the user\n * Required for the RevenueCat Adjust integration\n *\n * @param options Adjust ID to use in Adjust integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting Adjust ID.\n */\n setAdjustID(options: { adjustID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the AppsFlyer ID for the user\n * Required for the RevenueCat AppsFlyer integration\n * @param options Appsflyer ID to use in Appsflyer integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Appsflyer ID.\n */\n setAppsflyerID(options: { appsflyerID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Facebook SDK Anonymous ID for the user\n * Recommended for the RevenueCat Facebook integration\n *\n * @param options Facebook Anonymous ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Facebook Anonymous ID.\n */\n setFBAnonymousID(options: { fbAnonymousID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the mParticle ID for the user\n * Recommended for the RevenueCat mParticle integration\n *\n * @param options Mparticle ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Mparticle ID.\n */\n setMparticleID(options: { mparticleID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the CleverTap ID for the user\n * Required for the RevenueCat CleverTap integration\n *\n * @param options CleverTap user ID to use in CleverTap integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the CleverTap ID.\n */\n setCleverTapID(options: { cleverTapID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Mixpanel Distinct ID for the user\n * Required for the RevenueCat Mixpanel integration\n *\n * @param options Mixpanel Distinct ID to use in Mixpanel integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Mixpanel Distinct ID.\n */\n setMixpanelDistinctID(options: { mixpanelDistinctID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Firebase App Instance ID for the user\n * Required for the RevenueCat Firebase integration\n *\n * @param options Firebase App Instance ID to use in Firebase integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Firebase App Instance ID.\n */\n setFirebaseAppInstanceID(options: { firebaseAppInstanceID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the OneSignal Player ID for the user\n * Required for the RevenueCat OneSignal integration. Deprecated for OneSignal versions above v9.0.\n *\n * @param options OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the OneSignal ID.\n */\n setOnesignalID(options: { onesignalID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the OneSignal User ID for the user\n * Required for the RevenueCat OneSignal integration with versions v11.0 and above.\n *\n * @param options OneSignal UserId to use in OneSignal integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the OneSignal user ID.\n */\n setOnesignalUserID(options: { onesignalUserID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the Airship Channel ID for the user\n * Required for the RevenueCat Airship integration\n *\n * @param options Airship Channel ID to use in Airship integration. Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the Airship Channel ID.\n */\n setAirshipChannelID(options: { airshipChannelID: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install media source for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the media source.\n */\n setMediaSource(options: { mediaSource: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install campaign for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the campaign.\n */\n setCampaign(options: { campaign: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install ad group for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting ad group.\n */\n setAdGroup(options: { adGroup: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install ad for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the ad subscriber attribute.\n */\n setAd(options: { ad: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install keyword for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the keyword.\n */\n setKeyword(options: { keyword: string | null }): Promise<void>;\n\n /**\n * Subscriber attribute associated with the install ad creative for the user\n *\n * @param options Empty String or null will delete the subscriber attribute.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error\n * setting the creative subscriber attribute.\n */\n setCreative(options: { creative: string | null }): Promise<void>;\n\n /**\n * Check if billing is supported for the current user (meaning IN-APP purchases are supported)\n * and optionally, whether a list of specified feature types are supported.\n *\n * Note: Billing features are only relevant to Google Play Android users.\n * For other stores and platforms, billing features won't be checked.\n *\n * @param options An array of feature types to check for support. Feature types must be one of\n * [BILLING_FEATURE]. By default, is an empty list and no specific feature support will be checked.\n * @returns promise with boolean response. True if billing is supported, false otherwise.\n */\n canMakePayments(options?: { features?: BILLING_FEATURE[] }): Promise<{ canMakePayments: boolean }>;\n\n /**\n * iOS 15+ only. Presents a refund request sheet in the current window scene for\n * the latest transaction associated with the active entitlement.\n *\n * If the request was unsuccessful, no active entitlements could be found for\n * the user, or multiple active entitlements were found for the user,\n * the promise will return an error.\n * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.\n *\n * Important: This method should only be used if your user can only have a single active entitlement at a given time.\n * If a user could have more than one entitlement at a time, use `beginRefundRequestForEntitlement` instead.\n *\n * @returns Returns refundRequestStatus: The status of the\n * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED\n */\n beginRefundRequestForActiveEntitlement(): Promise<{\n refundRequestStatus: REFUND_REQUEST_STATUS;\n }>;\n\n /**\n * iOS 15+ only. Presents a refund request sheet in the current window scene for\n * the latest transaction associated with the `entitlement`.\n *\n * If the request was unsuccessful, the promise will return an error.\n * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.\n *\n * @param options The entitlement to begin a refund request for.\n * @returns Returns refundRequestStatus: The status of the\n * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED\n */\n beginRefundRequestForEntitlement(options: {\n entitlementInfo: PurchasesEntitlementInfo;\n }): Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS }>;\n\n /**\n * iOS 15+ only. Presents a refund request sheet in the current window scene for\n * the latest transaction associated with the `product`.\n *\n * If the request was unsuccessful, the promise will return an error.\n * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.\n *\n * @param options The StoreProduct to begin a refund request for.\n * @returns {Promise<REFUND_REQUEST_STATUS>} Returns a REFUND_REQUEST_STATUS: The status of the\n * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED\n */\n beginRefundRequestForProduct(options: {\n storeProduct: PurchasesStoreProduct;\n }): Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS }>;\n\n /**\n * Shows in-app messages available from the App Store or Google Play. You need to disable messages from showing\n * automatically using [PurchasesConfiguration.shouldShowInAppMessagesAutomatically].\n *\n * Note: In iOS, this requires version 16+. In older versions the promise will be resolved successfully\n * immediately.\n *\n * @param options An array of message types that the stores can display inside your app. Values must be one of\n * [IN_APP_MESSAGE_TYPE]. By default, is undefined and all message types will be shown.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n showInAppMessages(options?: { messageTypes?: IN_APP_MESSAGE_TYPE[] }): Promise<void>;\n\n /**\n * Check if configure has finished and Purchases has been configured.\n *\n * @returns promise with boolean response\n */\n isConfigured(): Promise<{ isConfigured: boolean }>;\n\n /**\n * Override the preferred UI locale for RevenueCat UI components at runtime. This affects both API requests\n * and UI rendering. If the locale changes, this will automatically clear the offerings cache and trigger\n * a background refetch to get paywall templates with the correct localizations.\n *\n * @param options The locale string (e.g., \"es-ES\", \"en-US\") or null to use system default.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n overridePreferredUILocale(options: { locale: string | null }): Promise<void>;\n\n /**\n * Tracks an impression of a custom paywall. Use this to record when a user views your custom paywall\n * so that RevenueCat can track paywall analytics.\n *\n * Call this method once per paywall display, ideally when the paywall first becomes visible to the user,\n * not in callbacks that may fire multiple times for the same display.\n *\n * @param options Optional parameters for the impression. Include `paywallId` to identify which paywall was shown.\n * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.\n */\n trackCustomPaywallImpression(options?: TrackCustomPaywallImpressionOptions): Promise<void>;\n}\n\n/**\n * Options for tracking a custom paywall impression.\n */\nexport interface TrackCustomPaywallImpressionOptions {\n /** The identifier of the paywall that was shown. */\n paywallId?: string | null;\n /**\n * An optional identifier for the offering associated with the custom paywall.\n * If not provided, the SDK will use the current offering identifier from the cache.\n */\n offeringId?: string | null;\n}\n"]}
@@ -90,7 +90,7 @@ public class PurchasesPlugin: CAPPlugin, PurchasesDelegate, CAPBridgedPlugin {
90
90
  CAPPluginMethod(name: "trackCustomPaywallImpression", returnType: CAPPluginReturnNone),
91
91
  ]
92
92
  private let platformFlavor = "capacitor"
93
- private let platformVersion = "13.0.0"
93
+ private let platformVersion = "13.1.0"
94
94
 
95
95
  private let customerInfoKey = "customerInfo"
96
96
  private let transactionKey = "transaction"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenuecat/purchases-capacitor",
3
- "version": "13.0.0",
3
+ "version": "13.1.0",
4
4
  "description": "Capacitor in-app purchases and subscriptions made easy. Support for iOS and Android.",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -88,6 +88,6 @@
88
88
  }
89
89
  },
90
90
  "dependencies": {
91
- "@revenuecat/purchases-typescript-internal-esm": "18.0.0"
91
+ "@revenuecat/purchases-typescript-internal-esm": "18.4.0"
92
92
  }
93
93
  }