@revenuecat/purchases-capacitor 10.1.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1168,7 +1168,7 @@ If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPl
1168
1168
  showInAppMessages(options?: { messageTypes?: IN_APP_MESSAGE_TYPE[] | undefined; } | undefined) => Promise<void>
1169
1169
  ```
1170
1170
 
1171
- Shows in-app messages available from the App Store or Google Play. You need to disable messages from showing
1171
+ Shows in-app messages available from the App <a href="#store">Store</a> or Google Play. You need to disable messages from showing
1172
1172
  automatically using [PurchasesConfiguration.shouldShowInAppMessagesAutomatically].
1173
1173
 
1174
1174
  Note: In iOS, this requires version 16+. In older versions the promise will be resolved successfully
@@ -1209,7 +1209,7 @@ Holds parameters to initialize the SDK.
1209
1209
  | **`userDefaultsSuiteName`** | <code>string</code> | An optional string. iOS-only, will be ignored for Android. Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults. |
1210
1210
  | **`storeKitVersion`** | <code><a href="#storekit_version">STOREKIT_VERSION</a></code> | iOS-only, will be ignored for Android. By selecting the DEFAULT value, RevenueCat will automatically select the most appropriate StoreKit version for the app's runtime environment. - Warning: Make sure you have an In-App Purchase Key configured in your app. Please see https://rev.cat/in-app-purchase-key-configuration for more info. - Note: StoreKit 2 is only available on iOS 16+. StoreKit 1 will be used for previous iOS versions regardless of this setting. |
1211
1211
  | **`useAmazon`** | <code>boolean</code> | An optional boolean. Android only. Required to configure the plugin to be used in the Amazon Appstore. |
1212
- | **`shouldShowInAppMessagesAutomatically`** | <code>boolean</code> | Whether we should show store in-app messages automatically. Both Google Play and the App Store provide in-app messages for some situations like billing issues. By default, those messages will be shown automatically. This allows to disable that behavior, so you can display those messages at your convenience. For more information, check: https://rev.cat/storekit-message and https://rev.cat/googleplayinappmessaging |
1212
+ | **`shouldShowInAppMessagesAutomatically`** | <code>boolean</code> | Whether we should show store in-app messages automatically. Both Google Play and the App <a href="#store">Store</a> provide in-app messages for some situations like billing issues. By default, those messages will be shown automatically. This allows to disable that behavior, so you can display those messages at your convenience. For more information, check: https://rev.cat/storekit-message and https://rev.cat/googleplayinappmessaging |
1213
1213
  | **`entitlementVerificationMode`** | <code><a href="#entitlement_verification_mode">ENTITLEMENT_VERIFICATION_MODE</a></code> | Verification strictness levels for [EntitlementInfo]. See https://rev.cat/trusted-entitlements for more info. |
1214
1214
  | **`pendingTransactionsForPrepaidPlansEnabled`** | <code>boolean</code> | Enable this setting if you want to allow pending purchases for prepaid subscriptions (only supported in Google Play). Note that entitlements are not granted until payment is done. Disabled by default. |
1215
1215
  | **`diagnosticsEnabled`** | <code>boolean</code> | Enabling diagnostics will send some performance and debugging information from the SDK to RevenueCat's servers. Examples of this information include response times, cache hits or error codes. No personal identifiable information will be collected. The default value is false. |
@@ -1219,21 +1219,22 @@ Holds parameters to initialize the SDK.
1219
1219
 
1220
1220
  Type containing all information regarding the customer
1221
1221
 
1222
- | Prop | Type | Description |
1223
- | ------------------------------------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1224
- | **`entitlements`** | <code><a href="#purchasesentitlementinfos">PurchasesEntitlementInfos</a></code> | Entitlements attached to this customer info |
1225
- | **`activeSubscriptions`** | <code>string[]</code> | Set of active subscription skus |
1226
- | **`allPurchasedProductIdentifiers`** | <code>string[]</code> | Set of purchased skus, active and inactive |
1227
- | **`latestExpirationDate`** | <code>string \| null</code> | The latest expiration date of all purchased skus |
1228
- | **`firstSeen`** | <code>string</code> | The date this user was first seen in RevenueCat. |
1229
- | **`originalAppUserId`** | <code>string</code> | The original App User Id recorded for this user. |
1230
- | **`requestDate`** | <code>string</code> | Date when this info was requested |
1231
- | **`allExpirationDates`** | <code>{ [key: string]: string \| null; }</code> | Map of skus to expiration dates |
1232
- | **`allPurchaseDates`** | <code>{ [key: string]: string \| null; }</code> | Map of skus to purchase dates |
1233
- | **`originalApplicationVersion`** | <code>string \| null</code> | Returns the version number for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. This corresponds to the value of CFBundleVersion (in iOS) in the Info.plist file when the purchase was originally made. This is always null in Android |
1234
- | **`originalPurchaseDate`** | <code>string \| null</code> | Returns the purchase date for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. |
1235
- | **`managementURL`** | <code>string \| null</code> | URL to manage the active subscription of the user. If this user has an active iOS subscription, this will point to the App Store, if the user has an active Play Store subscription it will point there. If there are no active subscriptions it will be null. If there are multiple for different platforms, it will point to the device store. |
1236
- | **`nonSubscriptionTransactions`** | <code>PurchasesStoreTransaction[]</code> | List of all non subscription transactions. Use this to fetch the history of non-subscription purchases |
1222
+ | Prop | Type | Description |
1223
+ | -------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1224
+ | **`entitlements`** | <code><a href="#purchasesentitlementinfos">PurchasesEntitlementInfos</a></code> | Entitlements attached to this customer info |
1225
+ | **`activeSubscriptions`** | <code>string[]</code> | Set of active subscription skus |
1226
+ | **`allPurchasedProductIdentifiers`** | <code>string[]</code> | Set of purchased skus, active and inactive |
1227
+ | **`latestExpirationDate`** | <code>string \| null</code> | The latest expiration date of all purchased skus |
1228
+ | **`firstSeen`** | <code>string</code> | The date this user was first seen in RevenueCat. |
1229
+ | **`originalAppUserId`** | <code>string</code> | The original App User Id recorded for this user. |
1230
+ | **`requestDate`** | <code>string</code> | Date when this info was requested |
1231
+ | **`allExpirationDates`** | <code>{ [key: string]: string \| null; }</code> | Map of skus to expiration dates |
1232
+ | **`allPurchaseDates`** | <code>{ [key: string]: string \| null; }</code> | Map of skus to purchase dates |
1233
+ | **`originalApplicationVersion`** | <code>string \| null</code> | Returns the version number for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. This corresponds to the value of CFBundleVersion (in iOS) in the Info.plist file when the purchase was originally made. This is always null in Android |
1234
+ | **`originalPurchaseDate`** | <code>string \| null</code> | Returns the purchase date for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. |
1235
+ | **`managementURL`** | <code>string \| null</code> | URL to manage the active subscription of the user. If this user has an active iOS subscription, this will point to the App <a href="#store">Store</a>, if the user has an active Play <a href="#store">Store</a> subscription it will point there. If there are no active subscriptions it will be null. If there are multiple for different platforms, it will point to the device store. |
1236
+ | **`nonSubscriptionTransactions`** | <code>PurchasesStoreTransaction[]</code> | List of all non subscription transactions. Use this to fetch the history of non-subscription purchases |
1237
+ | **`subscriptionsByProductIdentifier`** | <code>{ [key: string]: <a href="#purchasessubscriptioninfo">PurchasesSubscriptionInfo</a>; }</code> | Information about the customer's subscriptions for each product identifier. |
1237
1238
 
1238
1239
 
1239
1240
  #### PurchasesEntitlementInfos
@@ -1251,33 +1252,33 @@ Contains all the entitlements associated to the user.
1251
1252
 
1252
1253
  The EntitlementInfo object gives you access to all of the information about the status of a user entitlement.
1253
1254
 
1254
- | Prop | Type | Description |
1255
- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1256
- | **`identifier`** | <code>string</code> | The entitlement identifier configured in the RevenueCat dashboard |
1257
- | **`isActive`** | <code>boolean</code> | True if the user has access to this entitlement |
1258
- | **`willRenew`** | <code>boolean</code> | True if the underlying subscription is set to renew at the end of the billing period (expirationDate). |
1259
- | **`periodType`** | <code>string</code> | The last period type this entitlement was in. Either: NORMAL, INTRO, TRIAL, PREPAID. |
1260
- | **`latestPurchaseDate`** | <code>string</code> | The latest purchase or renewal date for the entitlement in ISO8601 format. |
1261
- | **`latestPurchaseDateMillis`** | <code>number</code> | The latest purchase or renewal date for the entitlement in milliseconds. |
1262
- | **`originalPurchaseDate`** | <code>string</code> | The first date this entitlement was purchased in ISO8601 format. |
1263
- | **`originalPurchaseDateMillis`** | <code>number</code> | The first date this entitlement was purchased in milliseconds. |
1264
- | **`expirationDate`** | <code>string \| null</code> | The expiration date for the entitlement in ISO8601, can be `null` for lifetime access. If the `periodType` is `trial`, this is the trial expiration date. |
1265
- | **`expirationDateMillis`** | <code>number \| null</code> | The expiration date for the entitlement in milliseconds, can be `null` for lifetime access. If the `periodType` is `trial`, this is the trial expiration date. |
1266
- | **`store`** | <code>'PLAY_STORE' \| 'APP_STORE' \| 'STRIPE' \| 'MAC_APP_STORE' \| 'PROMOTIONAL' \| 'AMAZON' \| 'RC_BILLING' \| 'EXTERNAL' \| 'UNKNOWN_STORE'</code> | The store where this entitlement was unlocked from. |
1267
- | **`productIdentifier`** | <code>string</code> | The product identifier that unlocked this entitlement |
1268
- | **`productPlanIdentifier`** | <code>string \| null</code> | The product plan identifier that unlocked this entitlement. Android subscriptions only, null on consumables and iOS. |
1269
- | **`isSandbox`** | <code>boolean</code> | False if this entitlement is unlocked via a production purchase |
1270
- | **`unsubscribeDetectedAt`** | <code>string \| null</code> | The date an unsubscribe was detected in ISO8601 format. Can be `null`. Entitlement may still be active even if user has unsubscribed. Check the `isActive` property. |
1271
- | **`unsubscribeDetectedAtMillis`** | <code>number \| null</code> | The date an unsubscribe was detected in milliseconds. Can be `null`. Entitlement may still be active even if user has unsubscribed. Check the `isActive` property. |
1272
- | **`billingIssueDetectedAt`** | <code>string \| null</code> | The date a billing issue was detected in ISO8601 format. Can be `null` if there is no billing issue or an issue has been resolved Entitlement may still be active even if there is a billing issue. Check the `isActive` property. |
1273
- | **`billingIssueDetectedAtMillis`** | <code>number \| null</code> | The date a billing issue was detected in milliseconds. Can be `null` if there is no billing issue or an issue has been resolved Entitlement may still be active even if there is a billing issue. Check the `isActive` property. |
1274
- | **`ownershipType`** | <code>'FAMILY_SHARED' \| 'PURCHASED' \| 'UNKNOWN'</code> | Supported ownership types for an entitlement. PURCHASED if the purchase was made directly by this user. FAMILY_SHARED if the purchase has been shared to this user by a family member. UNKNOWN if the purchase has no or an unknown ownership type. |
1275
- | **`verification`** | <code><a href="#verification_result">VERIFICATION_RESULT</a></code> | If entitlement verification was enabled, the result of that verification. If not, VerificationResult.NOT_REQUESTED |
1255
+ | Prop | Type | Description |
1256
+ | ---------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1257
+ | **`identifier`** | <code>string</code> | The entitlement identifier configured in the RevenueCat dashboard |
1258
+ | **`isActive`** | <code>boolean</code> | True if the user has access to this entitlement |
1259
+ | **`willRenew`** | <code>boolean</code> | True if the underlying subscription is set to renew at the end of the billing period (expirationDate). |
1260
+ | **`periodType`** | <code>string</code> | The last period type this entitlement was in. Either: NORMAL, INTRO, TRIAL, PREPAID. |
1261
+ | **`latestPurchaseDate`** | <code>string</code> | The latest purchase or renewal date for the entitlement in ISO8601 format. |
1262
+ | **`latestPurchaseDateMillis`** | <code>number</code> | The latest purchase or renewal date for the entitlement in milliseconds. |
1263
+ | **`originalPurchaseDate`** | <code>string</code> | The first date this entitlement was purchased in ISO8601 format. |
1264
+ | **`originalPurchaseDateMillis`** | <code>number</code> | The first date this entitlement was purchased in milliseconds. |
1265
+ | **`expirationDate`** | <code>string \| null</code> | The expiration date for the entitlement in ISO8601, can be `null` for lifetime access. If the `periodType` is `trial`, this is the trial expiration date. |
1266
+ | **`expirationDateMillis`** | <code>number \| null</code> | The expiration date for the entitlement in milliseconds, can be `null` for lifetime access. If the `periodType` is `trial`, this is the trial expiration date. |
1267
+ | **`store`** | <code><a href="#store">Store</a></code> | The store where this entitlement was unlocked from. |
1268
+ | **`productIdentifier`** | <code>string</code> | The product identifier that unlocked this entitlement |
1269
+ | **`productPlanIdentifier`** | <code>string \| null</code> | The product plan identifier that unlocked this entitlement. Android subscriptions only, null on consumables and iOS. |
1270
+ | **`isSandbox`** | <code>boolean</code> | False if this entitlement is unlocked via a production purchase |
1271
+ | **`unsubscribeDetectedAt`** | <code>string \| null</code> | The date an unsubscribe was detected in ISO8601 format. Can be `null`. Entitlement may still be active even if user has unsubscribed. Check the `isActive` property. |
1272
+ | **`unsubscribeDetectedAtMillis`** | <code>number \| null</code> | The date an unsubscribe was detected in milliseconds. Can be `null`. Entitlement may still be active even if user has unsubscribed. Check the `isActive` property. |
1273
+ | **`billingIssueDetectedAt`** | <code>string \| null</code> | The date a billing issue was detected in ISO8601 format. Can be `null` if there is no billing issue or an issue has been resolved Entitlement may still be active even if there is a billing issue. Check the `isActive` property. |
1274
+ | **`billingIssueDetectedAtMillis`** | <code>number \| null</code> | The date a billing issue was detected in milliseconds. Can be `null` if there is no billing issue or an issue has been resolved Entitlement may still be active even if there is a billing issue. Check the `isActive` property. |
1275
+ | **`ownershipType`** | <code><a href="#ownershiptype">OwnershipType</a></code> | Supported ownership types for an entitlement. PURCHASED if the purchase was made directly by this user. FAMILY_SHARED if the purchase has been shared to this user by a family member. UNKNOWN if the purchase has no or an unknown ownership type. |
1276
+ | **`verification`** | <code><a href="#verification_result">VERIFICATION_RESULT</a></code> | If entitlement verification was enabled, the result of that verification. If not, VerificationResult.NOT_REQUESTED |
1276
1277
 
1277
1278
 
1278
1279
  #### PurchasesStoreTransaction
1279
1280
 
1280
- Represents a non-subscription transaction in the Store.
1281
+ Represents a non-subscription transaction in the <a href="#store">Store</a>.
1281
1282
 
1282
1283
  | Prop | Type | Description |
1283
1284
  | --------------------------- | ------------------- | ---------------------------------------------------- |
@@ -1286,6 +1287,29 @@ Represents a non-subscription transaction in the Store.
1286
1287
  | **`purchaseDate`** | <code>string</code> | Purchase date of the transaction in ISO 8601 format. |
1287
1288
 
1288
1289
 
1290
+ #### PurchasesSubscriptionInfo
1291
+
1292
+ Subscription purchases of the Customer.
1293
+
1294
+ | Prop | Type | Description |
1295
+ | ----------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1296
+ | **`productIdentifier`** | <code>string</code> | The product identifier. |
1297
+ | **`purchaseDate`** | <code>string</code> | Date when the last subscription period started. |
1298
+ | **`originalPurchaseDate`** | <code>string \| null</code> | Date when this subscription first started. This property does not update with renewals. This property also does not update for product changes within a subscription group or re-subscriptions by lapsed subscribers. |
1299
+ | **`expiresDate`** | <code>string \| null</code> | Date when the subscription expires/expired |
1300
+ | **`store`** | <code><a href="#store">Store</a></code> | <a href="#store">Store</a> where the subscription was purchased. |
1301
+ | **`unsubscribeDetectedAt`** | <code>string \| null</code> | Date when RevenueCat detected that auto-renewal was turned off for this subscription. Note the subscription may still be active, check the `expiresDate` attribute. |
1302
+ | **`isSandbox`** | <code>boolean</code> | Whether or not the purchase was made in sandbox mode. |
1303
+ | **`billingIssuesDetectedAt`** | <code>string \| null</code> | Date when RevenueCat detected any billing issues with this subscription. If and when the billing issue gets resolved, this field is set to nil. |
1304
+ | **`gracePeriodExpiresDate`** | <code>string \| null</code> | Date when any grace period for this subscription expires/expired. nil if the customer has never been in a grace period. |
1305
+ | **`ownershipType`** | <code><a href="#ownershiptype">OwnershipType</a></code> | How the Customer received access to this subscription: - [OwnershipType.PURCHASED]: The customer bought the subscription. - [OwnershipType.FAMILY_SHARED]: The Customer has access to the product via their family. |
1306
+ | **`periodType`** | <code><a href="#periodtype">PeriodType</a></code> | Type of the current subscription period: - [PeriodType.NORMAL]: The product is in a normal period (default) - [PeriodType.TRIAL]: The product is in a free trial period - [PeriodType.INTRO]: The product is in an introductory pricing period - [PeriodType.PREPAID]: The product is in a prepaid pricing period |
1307
+ | **`refundedAt`** | <code>string \| null</code> | Date when RevenueCat detected a refund of this subscription. |
1308
+ | **`storeTransactionId`** | <code>string \| null</code> | The transaction id in the store of the subscription. |
1309
+ | **`isActive`** | <code>boolean</code> | Whether the subscription is currently active. |
1310
+ | **`willRenew`** | <code>boolean</code> | Whether the subscription will renew at the next billing period. |
1311
+
1312
+
1289
1313
  #### PurchasesError
1290
1314
 
1291
1315
  Type encapsulating an error in an SDK operation.
@@ -1356,7 +1380,7 @@ For more info see https://docs.revenuecat.com/docs/entitlements
1356
1380
 
1357
1381
  #### PurchasesStoreProduct
1358
1382
 
1359
- Type representing a product from the Store.
1383
+ Type representing a product from the <a href="#store">Store</a>.
1360
1384
 
1361
1385
  | Prop | Type | Description |
1362
1386
  | --------------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -1538,7 +1562,7 @@ Holds the information used when upgrading from another sku. For Android use only
1538
1562
 
1539
1563
  #### PurchasesPromotionalOffer
1540
1564
 
1541
- Holds the information about a PromotionalOffer in Apple's App Store.
1565
+ Holds the information about a PromotionalOffer in Apple's App <a href="#store">Store</a>.
1542
1566
 
1543
1567
  | Prop | Type |
1544
1568
  | ------------------- | ------------------- |
@@ -1616,7 +1640,7 @@ Holds the introductory price status
1616
1640
 
1617
1641
  #### PurchasesWinBackOffer
1618
1642
 
1619
- Holds the information about a Win-Back Offer in Apple's App Store.
1643
+ Holds the information about a Win-Back Offer in Apple's App <a href="#store">Store</a>.
1620
1644
 
1621
1645
 
1622
1646
  #### GetEligibleWinBackOffersForProductOptions
@@ -1700,6 +1724,27 @@ The result of a redemption attempt.
1700
1724
  <code>{ result: <a href="#webpurchaseredemptionresulttype">WebPurchaseRedemptionResultType.SUCCESS</a>; customerInfo: <a href="#customerinfo">CustomerInfo</a>; } | { result: <a href="#webpurchaseredemptionresulttype">WebPurchaseRedemptionResultType.ERROR</a>; error: <a href="#purchaseserror">PurchasesError</a>; } | { result: <a href="#webpurchaseredemptionresulttype">WebPurchaseRedemptionResultType.PURCHASE_BELONGS_TO_OTHER_USER</a>; } | { result: <a href="#webpurchaseredemptionresulttype">WebPurchaseRedemptionResultType.INVALID_TOKEN</a>; } | { result: <a href="#webpurchaseredemptionresulttype">WebPurchaseRedemptionResultType.EXPIRED</a>; obfuscatedEmail: string; }</code>
1701
1725
 
1702
1726
 
1727
+ #### Store
1728
+
1729
+ The supported stores for purchases.
1730
+
1731
+ <code>"PLAY_STORE" | "APP_STORE" | "STRIPE" | "MAC_APP_STORE" | "PROMOTIONAL" | "AMAZON" | "RC_BILLING" | "EXTERNAL" | "UNKNOWN_STORE"</code>
1732
+
1733
+
1734
+ #### OwnershipType
1735
+
1736
+ The supported ownership types for an entitlement.
1737
+
1738
+ <code>"PURCHASED" | "FAMILY_SHARED" | "UNKNOWN"</code>
1739
+
1740
+
1741
+ #### PeriodType
1742
+
1743
+ The supported period types for an entitlement.
1744
+
1745
+ <code>"NORMAL" | "INTRO" | "TRIAL" | "PREPAID"</code>
1746
+
1747
+
1703
1748
  #### CustomerInfoUpdateListener
1704
1749
 
1705
1750
  Listener used on updated customer info
@@ -1847,14 +1892,14 @@ Listener used to receive log messages from the SDK.
1847
1892
 
1848
1893
  #### PRODUCT_TYPE
1849
1894
 
1850
- | Members | Value | Description |
1851
- | --------------------------------- | ------------------------------------------ | ----------------------------------------------------------------------- |
1852
- | **`CONSUMABLE`** | <code>"CONSUMABLE"</code> | A consumable in-app purchase. |
1853
- | **`NON_CONSUMABLE`** | <code>"NON_CONSUMABLE"</code> | A non-consumable in-app purchase. Only applies to Apple Store products. |
1854
- | **`NON_RENEWABLE_SUBSCRIPTION`** | <code>"NON_RENEWABLE_SUBSCRIPTION"</code> | A non-renewing subscription. Only applies to Apple Store products. |
1855
- | **`AUTO_RENEWABLE_SUBSCRIPTION`** | <code>"AUTO_RENEWABLE_SUBSCRIPTION"</code> | An auto-renewable subscription. |
1856
- | **`PREPAID_SUBSCRIPTION`** | <code>"PREPAID_SUBSCRIPTION"</code> | A subscription that is pre-paid. Only applies to Google Play products. |
1857
- | **`UNKNOWN`** | <code>"UNKNOWN"</code> | Unable to determine product type. |
1895
+ | Members | Value | Description |
1896
+ | --------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------- |
1897
+ | **`CONSUMABLE`** | <code>"CONSUMABLE"</code> | A consumable in-app purchase. |
1898
+ | **`NON_CONSUMABLE`** | <code>"NON_CONSUMABLE"</code> | A non-consumable in-app purchase. Only applies to Apple <a href="#store">Store</a> products. |
1899
+ | **`NON_RENEWABLE_SUBSCRIPTION`** | <code>"NON_RENEWABLE_SUBSCRIPTION"</code> | A non-renewing subscription. Only applies to Apple <a href="#store">Store</a> products. |
1900
+ | **`AUTO_RENEWABLE_SUBSCRIPTION`** | <code>"AUTO_RENEWABLE_SUBSCRIPTION"</code> | An auto-renewable subscription. |
1901
+ | **`PREPAID_SUBSCRIPTION`** | <code>"PREPAID_SUBSCRIPTION"</code> | A subscription that is pre-paid. Only applies to Google Play products. |
1902
+ | **`UNKNOWN`** | <code>"UNKNOWN"</code> | Unable to determine product type. |
1858
1903
 
1859
1904
 
1860
1905
  #### PERIOD_UNIT
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '14.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'PurchasesHybridCommon', '13.19.0'
16
+ s.dependency 'PurchasesHybridCommon', '13.24.0'
17
17
  s.swift_version = '5.1'
18
18
  end
@@ -56,7 +56,7 @@ dependencies {
56
56
  implementation fileTree(dir: 'libs', include: ['*.jar'])
57
57
  implementation project(':capacitor-android')
58
58
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
59
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:13.19.0'
59
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:13.24.0'
60
60
  testImplementation "junit:junit:$junitVersion"
61
61
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
62
62
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -79,7 +79,7 @@ class PurchasesPlugin : Plugin() {
79
79
 
80
80
  companion object {
81
81
  private const val PLATFORM_NAME = "capacitor"
82
- private const val PLUGIN_VERSION = "10.1.0"
82
+ private const val PLUGIN_VERSION = "10.2.0"
83
83
 
84
84
  private const val CUSTOMER_INFO_KEY = "customerInfo"
85
85
  }
package/dist/docs.json CHANGED
@@ -1724,6 +1724,15 @@
1724
1724
  "PurchasesStoreTransaction"
1725
1725
  ],
1726
1726
  "type": "PurchasesStoreTransaction[]"
1727
+ },
1728
+ {
1729
+ "name": "subscriptionsByProductIdentifier",
1730
+ "tags": [],
1731
+ "docs": "Information about the customer's subscriptions for each product identifier.",
1732
+ "complexTypes": [
1733
+ "PurchasesSubscriptionInfo"
1734
+ ],
1735
+ "type": "{ [key: string]: PurchasesSubscriptionInfo; }"
1727
1736
  }
1728
1737
  ]
1729
1738
  },
@@ -1852,8 +1861,10 @@
1852
1861
  "name": "store",
1853
1862
  "tags": [],
1854
1863
  "docs": "The store where this entitlement was unlocked from.",
1855
- "complexTypes": [],
1856
- "type": "'PLAY_STORE' | 'APP_STORE' | 'STRIPE' | 'MAC_APP_STORE' | 'PROMOTIONAL' | 'AMAZON' | 'RC_BILLING' | 'EXTERNAL' | 'UNKNOWN_STORE'"
1864
+ "complexTypes": [
1865
+ "Store"
1866
+ ],
1867
+ "type": "Store"
1857
1868
  },
1858
1869
  {
1859
1870
  "name": "productIdentifier",
@@ -1908,8 +1919,10 @@
1908
1919
  "name": "ownershipType",
1909
1920
  "tags": [],
1910
1921
  "docs": "Supported ownership types for an entitlement.\nPURCHASED if the purchase was made directly by this user.\nFAMILY_SHARED if the purchase has been shared to this user by a family member.\nUNKNOWN if the purchase has no or an unknown ownership type.",
1911
- "complexTypes": [],
1912
- "type": "'FAMILY_SHARED' | 'PURCHASED' | 'UNKNOWN'"
1922
+ "complexTypes": [
1923
+ "OwnershipType"
1924
+ ],
1925
+ "type": "OwnershipType"
1913
1926
  },
1914
1927
  {
1915
1928
  "name": "verification",
@@ -1956,6 +1969,130 @@
1956
1969
  }
1957
1970
  ]
1958
1971
  },
1972
+ {
1973
+ "name": "PurchasesSubscriptionInfo",
1974
+ "slug": "purchasessubscriptioninfo",
1975
+ "docs": "Subscription purchases of the Customer.",
1976
+ "tags": [
1977
+ {
1978
+ "name": "public"
1979
+ }
1980
+ ],
1981
+ "methods": [],
1982
+ "properties": [
1983
+ {
1984
+ "name": "productIdentifier",
1985
+ "tags": [],
1986
+ "docs": "The product identifier.",
1987
+ "complexTypes": [],
1988
+ "type": "string"
1989
+ },
1990
+ {
1991
+ "name": "purchaseDate",
1992
+ "tags": [],
1993
+ "docs": "Date when the last subscription period started.",
1994
+ "complexTypes": [],
1995
+ "type": "string"
1996
+ },
1997
+ {
1998
+ "name": "originalPurchaseDate",
1999
+ "tags": [],
2000
+ "docs": "Date when this subscription first started. This property does not update with renewals.\nThis property also does not update for product changes within a subscription group or\nre-subscriptions by lapsed subscribers.",
2001
+ "complexTypes": [],
2002
+ "type": "string | null"
2003
+ },
2004
+ {
2005
+ "name": "expiresDate",
2006
+ "tags": [],
2007
+ "docs": "Date when the subscription expires/expired",
2008
+ "complexTypes": [],
2009
+ "type": "string | null"
2010
+ },
2011
+ {
2012
+ "name": "store",
2013
+ "tags": [],
2014
+ "docs": "Store where the subscription was purchased.",
2015
+ "complexTypes": [
2016
+ "Store"
2017
+ ],
2018
+ "type": "Store"
2019
+ },
2020
+ {
2021
+ "name": "unsubscribeDetectedAt",
2022
+ "tags": [],
2023
+ "docs": "Date when RevenueCat detected that auto-renewal was turned off for this subscription.\nNote the subscription may still be active, check the `expiresDate` attribute.",
2024
+ "complexTypes": [],
2025
+ "type": "string | null"
2026
+ },
2027
+ {
2028
+ "name": "isSandbox",
2029
+ "tags": [],
2030
+ "docs": "Whether or not the purchase was made in sandbox mode.",
2031
+ "complexTypes": [],
2032
+ "type": "boolean"
2033
+ },
2034
+ {
2035
+ "name": "billingIssuesDetectedAt",
2036
+ "tags": [],
2037
+ "docs": "Date when RevenueCat detected any billing issues with this subscription.\nIf and when the billing issue gets resolved, this field is set to nil.",
2038
+ "complexTypes": [],
2039
+ "type": "string | null"
2040
+ },
2041
+ {
2042
+ "name": "gracePeriodExpiresDate",
2043
+ "tags": [],
2044
+ "docs": "Date when any grace period for this subscription expires/expired.\nnil if the customer has never been in a grace period.",
2045
+ "complexTypes": [],
2046
+ "type": "string | null"
2047
+ },
2048
+ {
2049
+ "name": "ownershipType",
2050
+ "tags": [],
2051
+ "docs": "How the Customer received access to this subscription:\n- [OwnershipType.PURCHASED]: The customer bought the subscription.\n- [OwnershipType.FAMILY_SHARED]: The Customer has access to the product via their family.",
2052
+ "complexTypes": [
2053
+ "OwnershipType"
2054
+ ],
2055
+ "type": "OwnershipType"
2056
+ },
2057
+ {
2058
+ "name": "periodType",
2059
+ "tags": [],
2060
+ "docs": "Type of the current subscription period:\n- [PeriodType.NORMAL]: The product is in a normal period (default)\n- [PeriodType.TRIAL]: The product is in a free trial period\n- [PeriodType.INTRO]: The product is in an introductory pricing period\n- [PeriodType.PREPAID]: The product is in a prepaid pricing period",
2061
+ "complexTypes": [
2062
+ "PeriodType"
2063
+ ],
2064
+ "type": "PeriodType"
2065
+ },
2066
+ {
2067
+ "name": "refundedAt",
2068
+ "tags": [],
2069
+ "docs": "Date when RevenueCat detected a refund of this subscription.",
2070
+ "complexTypes": [],
2071
+ "type": "string | null"
2072
+ },
2073
+ {
2074
+ "name": "storeTransactionId",
2075
+ "tags": [],
2076
+ "docs": "The transaction id in the store of the subscription.",
2077
+ "complexTypes": [],
2078
+ "type": "string | null"
2079
+ },
2080
+ {
2081
+ "name": "isActive",
2082
+ "tags": [],
2083
+ "docs": "Whether the subscription is currently active.",
2084
+ "complexTypes": [],
2085
+ "type": "boolean"
2086
+ },
2087
+ {
2088
+ "name": "willRenew",
2089
+ "tags": [],
2090
+ "docs": "Whether the subscription will renew at the next billing period.",
2091
+ "complexTypes": [],
2092
+ "type": "boolean"
2093
+ }
2094
+ ]
2095
+ },
1959
2096
  {
1960
2097
  "name": "PurchasesError",
1961
2098
  "slug": "purchaseserror",
@@ -4209,6 +4346,91 @@
4209
4346
  }
4210
4347
  ]
4211
4348
  },
4349
+ {
4350
+ "name": "Store",
4351
+ "slug": "store",
4352
+ "docs": "The supported stores for purchases.",
4353
+ "types": [
4354
+ {
4355
+ "text": "\"PLAY_STORE\"",
4356
+ "complexTypes": []
4357
+ },
4358
+ {
4359
+ "text": "\"APP_STORE\"",
4360
+ "complexTypes": []
4361
+ },
4362
+ {
4363
+ "text": "\"STRIPE\"",
4364
+ "complexTypes": []
4365
+ },
4366
+ {
4367
+ "text": "\"MAC_APP_STORE\"",
4368
+ "complexTypes": []
4369
+ },
4370
+ {
4371
+ "text": "\"PROMOTIONAL\"",
4372
+ "complexTypes": []
4373
+ },
4374
+ {
4375
+ "text": "\"AMAZON\"",
4376
+ "complexTypes": []
4377
+ },
4378
+ {
4379
+ "text": "\"RC_BILLING\"",
4380
+ "complexTypes": []
4381
+ },
4382
+ {
4383
+ "text": "\"EXTERNAL\"",
4384
+ "complexTypes": []
4385
+ },
4386
+ {
4387
+ "text": "\"UNKNOWN_STORE\"",
4388
+ "complexTypes": []
4389
+ }
4390
+ ]
4391
+ },
4392
+ {
4393
+ "name": "OwnershipType",
4394
+ "slug": "ownershiptype",
4395
+ "docs": "The supported ownership types for an entitlement.",
4396
+ "types": [
4397
+ {
4398
+ "text": "\"PURCHASED\"",
4399
+ "complexTypes": []
4400
+ },
4401
+ {
4402
+ "text": "\"FAMILY_SHARED\"",
4403
+ "complexTypes": []
4404
+ },
4405
+ {
4406
+ "text": "\"UNKNOWN\"",
4407
+ "complexTypes": []
4408
+ }
4409
+ ]
4410
+ },
4411
+ {
4412
+ "name": "PeriodType",
4413
+ "slug": "periodtype",
4414
+ "docs": "The supported period types for an entitlement.",
4415
+ "types": [
4416
+ {
4417
+ "text": "\"NORMAL\"",
4418
+ "complexTypes": []
4419
+ },
4420
+ {
4421
+ "text": "\"INTRO\"",
4422
+ "complexTypes": []
4423
+ },
4424
+ {
4425
+ "text": "\"TRIAL\"",
4426
+ "complexTypes": []
4427
+ },
4428
+ {
4429
+ "text": "\"PREPAID\"",
4430
+ "complexTypes": []
4431
+ }
4432
+ ]
4433
+ },
4212
4434
  {
4213
4435
  "name": "CustomerInfoUpdateListener",
4214
4436
  "slug": "customerinfoupdatelistener",
package/dist/esm/web.js CHANGED
@@ -25,6 +25,7 @@ export class PurchasesWeb extends WebPlugin {
25
25
  originalPurchaseDate: null,
26
26
  managementURL: null,
27
27
  nonSubscriptionTransactions: [],
28
+ subscriptionsByProductIdentifier: {},
28
29
  };
29
30
  }
30
31
  configure(_configuration) {
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAuB5C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,+CAA+C,CAAC;AAmBvD,MAAM,OAAO,YAAa,SAAQ,SAAS;IAA3C;;QACU,yBAAoB,GAAG,KAAK,CAAC;QAC7B,gCAA2B,GAAG,mCAAmC,CAAC;QAwS1E,eAAe;QAEP,0BAAqB,GAAiB;YAC5C,YAAY,EAAE;gBACZ,GAAG,EAAE,EAAE;gBACP,MAAM,EAAE,EAAE;gBACV,YAAY,EAAE,mBAAmB,CAAC,aAAa;aAChD;YACD,mBAAmB,EAAE,EAAE;YACvB,8BAA8B,EAAE,EAAE;YAClC,oBAAoB,EAAE,IAAI;YAC1B,SAAS,EAAE,0BAA0B;YACrC,iBAAiB,EAAE,kBAAkB;YACrC,WAAW,EAAE,0BAA0B;YACvC,kBAAkB,EAAE,EAAE;YACtB,gBAAgB,EAAE,EAAE;YACpB,0BAA0B,EAAE,IAAI;YAChC,oBAAoB,EAAE,IAAI;YAC1B,aAAa,EAAE,IAAI;YACnB,2BAA2B,EAAE,EAAE;SAChC,CAAC;IAyBJ,CAAC;IAnVC,SAAS,CAAC,cAAsC;QAC9C,OAAO,IAAI,CAAC,iCAAiC,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AAC;IACtC,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { WebPlugin } from '@capacitor/core';\nimport type {\n BILLING_FEATURE,\n CustomerInfo,\n CustomerInfoUpdateListener,\n IN_APP_MESSAGE_TYPE,\n IntroEligibility,\n LOG_LEVEL,\n LogHandler,\n LogInResult,\n MakePurchaseResult,\n PurchasesConfiguration,\n PurchasesEntitlementInfo,\n PurchasesOffering,\n PurchasesOfferings,\n PurchasesPromotionalOffer,\n PurchasesStoreProduct,\n PurchasesStoreTransaction,\n PurchasesWinBackOffer,\n ShouldPurchasePromoProductListener,\n WebPurchaseRedemption,\n WebPurchaseRedemptionResult,\n} from '@revenuecat/purchases-typescript-internal-esm';\nimport {\n REFUND_REQUEST_STATUS,\n VERIFICATION_RESULT,\n WebPurchaseRedemptionResultType,\n} from '@revenuecat/purchases-typescript-internal-esm';\n\nimport type {\n GetEligibleWinBackOffersForPackageOptions,\n GetEligibleWinBackOffersForProductOptions,\n GetProductOptions,\n GetPromotionalOfferOptions,\n PurchaseDiscountedPackageOptions,\n PurchaseDiscountedProductOptions,\n PurchasePackageOptions,\n PurchasePackageWithWinBackOfferOptions,\n PurchaseProductWithWinBackOfferOptions,\n PurchasesPlugin,\n PurchaseStoreProductOptions,\n PurchaseSubscriptionOptionOptions,\n SyncAmazonPurchaseOptions,\n SyncObserverModeAmazonPurchaseOptions,\n} from './definitions';\n\nexport class PurchasesWeb extends WebPlugin implements PurchasesPlugin {\n private shouldMockWebResults = false;\n private webNotSupportedErrorMessage = 'Web not supported in this plugin.';\n\n configure(_configuration: PurchasesConfiguration): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('configure');\n }\n\n parseAsWebPurchaseRedemption(_options: { urlString: string }): Promise<{\n webPurchaseRedemption: WebPurchaseRedemption | null;\n }> {\n return this.mockReturningFunctionIfEnabled('parseAsWebPurchaseRedemption', { webPurchaseRedemption: null });\n }\n\n redeemWebPurchase(_options: { webPurchaseRedemption: WebPurchaseRedemption }): Promise<WebPurchaseRedemptionResult> {\n return this.mockReturningFunctionIfEnabled('redeemWebPurchase', {\n result: WebPurchaseRedemptionResultType.INVALID_TOKEN,\n });\n }\n\n setMockWebResults(options: { shouldMockWebResults: boolean }): Promise<void> {\n this.shouldMockWebResults = options.shouldMockWebResults;\n return Promise.resolve();\n }\n\n setSimulatesAskToBuyInSandbox(_simulatesAskToBuyInSandbox: { simulatesAskToBuyInSandbox: boolean }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setSimulatesAskToBuyInSandbox');\n }\n addCustomerInfoUpdateListener(_customerInfoUpdateListener: CustomerInfoUpdateListener): Promise<string> {\n return this.mockReturningFunctionIfEnabled('addCustomerInfoUpdateListener', 'mock-callback-id');\n }\n removeCustomerInfoUpdateListener(_options: { listenerToRemove: string }): Promise<{ wasRemoved: boolean }> {\n return this.mockReturningFunctionIfEnabled('removeCustomerInfoUpdateListener', { wasRemoved: false });\n }\n addShouldPurchasePromoProductListener(\n _shouldPurchasePromoProductListener: ShouldPurchasePromoProductListener,\n ): Promise<string> {\n return this.mockReturningFunctionIfEnabled('addShouldPurchasePromoProductListener', 'mock-callback-id');\n }\n removeShouldPurchasePromoProductListener(_listenerToRemove: string): Promise<{ wasRemoved: boolean }> {\n return this.mockReturningFunctionIfEnabled('removeShouldPurchasePromoProductListener', { wasRemoved: false });\n }\n getOfferings(): Promise<PurchasesOfferings> {\n const mockOfferings: PurchasesOfferings = {\n all: {},\n current: null,\n };\n return this.mockReturningFunctionIfEnabled('getOfferings', mockOfferings);\n }\n getCurrentOfferingForPlacement(_options: { placementIdentifier: string }): Promise<PurchasesOffering | null> {\n const mockOffering: PurchasesOffering | null = null;\n return this.mockReturningFunctionIfEnabled('getCurrentOfferingForPlacement', mockOffering);\n }\n syncAttributesAndOfferingsIfNeeded(): Promise<PurchasesOfferings> {\n const mockOfferings: PurchasesOfferings = {\n all: {},\n current: null,\n };\n return this.mockReturningFunctionIfEnabled('syncAttributesAndOfferingsIfNeeded', mockOfferings);\n }\n getProducts(_options: GetProductOptions): Promise<{ products: PurchasesStoreProduct[] }> {\n const mockProducts = { products: [] };\n return this.mockReturningFunctionIfEnabled('getProducts', mockProducts);\n }\n purchaseStoreProduct(_options: PurchaseStoreProductOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.product.identifier,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.product.identifier),\n };\n return this.mockReturningFunctionIfEnabled('purchaseStoreProduct', mockPurchaseResult);\n }\n purchaseDiscountedProduct(_options: PurchaseDiscountedProductOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.product.identifier,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.product.identifier),\n };\n return this.mockReturningFunctionIfEnabled('purchaseDiscountedProduct', mockPurchaseResult);\n }\n purchasePackage(_options: PurchasePackageOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.aPackage.product.identifier,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.aPackage.product.identifier),\n };\n return this.mockReturningFunctionIfEnabled('purchasePackage', mockPurchaseResult);\n }\n purchaseSubscriptionOption(_options: PurchaseSubscriptionOptionOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.subscriptionOption.productId,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.subscriptionOption.productId),\n };\n return this.mockReturningFunctionIfEnabled('purchaseSubscriptionOption', mockPurchaseResult);\n }\n purchaseDiscountedPackage(_options: PurchaseDiscountedPackageOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.aPackage.product.identifier,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.aPackage.product.identifier),\n };\n return this.mockReturningFunctionIfEnabled('purchaseDiscountedPackage', mockPurchaseResult);\n }\n restorePurchases(): Promise<{ customerInfo: CustomerInfo }> {\n const mockResponse = { customerInfo: this.mockEmptyCustomerInfo };\n return this.mockReturningFunctionIfEnabled('restorePurchases', mockResponse);\n }\n recordPurchase(options: { productID: string }): Promise<{ transaction: PurchasesStoreTransaction }> {\n const mockResponse = {\n transaction: this.mockTransaction(options.productID),\n };\n return this.mockReturningFunctionIfEnabled('recordPurchase', mockResponse);\n }\n getAppUserID(): Promise<{ appUserID: string }> {\n return this.mockReturningFunctionIfEnabled('getAppUserID', {\n appUserID: 'test-web-user-id',\n });\n }\n logIn(_appUserID: { appUserID: string }): Promise<LogInResult> {\n const mockLogInResult: LogInResult = {\n customerInfo: this.mockEmptyCustomerInfo,\n created: false,\n };\n return this.mockReturningFunctionIfEnabled('logIn', mockLogInResult);\n }\n logOut(): Promise<{ customerInfo: CustomerInfo }> {\n const mockResponse = { customerInfo: this.mockEmptyCustomerInfo };\n return this.mockReturningFunctionIfEnabled('logOut', mockResponse);\n }\n setLogLevel(_level: { level: LOG_LEVEL }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setLogLevel');\n }\n setLogHandler(_logHandler: LogHandler): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setLogHandler');\n }\n getCustomerInfo(): Promise<{ customerInfo: CustomerInfo }> {\n const mockResponse = { customerInfo: this.mockEmptyCustomerInfo };\n return this.mockReturningFunctionIfEnabled('getCustomerInfo', mockResponse);\n }\n syncPurchases(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('syncPurchases');\n }\n syncObserverModeAmazonPurchase(_options: SyncObserverModeAmazonPurchaseOptions): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('syncObserverModeAmazonPurchase');\n }\n syncAmazonPurchase(_options: SyncAmazonPurchaseOptions): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('syncAmazonPurchase');\n }\n enableAdServicesAttributionTokenCollection(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('enableAdServicesAttributionTokenCollection');\n }\n isAnonymous(): Promise<{ isAnonymous: boolean }> {\n const mockResponse = { isAnonymous: false };\n return this.mockReturningFunctionIfEnabled('isAnonymous', mockResponse);\n }\n checkTrialOrIntroductoryPriceEligibility(_productIdentifiers: {\n productIdentifiers: string[];\n }): Promise<{ [productId: string]: IntroEligibility }> {\n return this.mockReturningFunctionIfEnabled('checkTrialOrIntroductoryPriceEligibility', {});\n }\n getPromotionalOffer(_options: GetPromotionalOfferOptions): Promise<PurchasesPromotionalOffer | undefined> {\n return this.mockReturningFunctionIfEnabled('getPromotionalOffer', undefined);\n }\n getEligibleWinBackOffersForProduct(\n _options: GetEligibleWinBackOffersForProductOptions,\n ): Promise<{ eligibleWinBackOffers: PurchasesWinBackOffer[] }> {\n return this.mockReturningFunctionIfEnabled('getEligibleWinBackOffersForProduct', { eligibleWinBackOffers: [] });\n }\n getEligibleWinBackOffersForPackage(\n _options: GetEligibleWinBackOffersForPackageOptions,\n ): Promise<{ eligibleWinBackOffers: PurchasesWinBackOffer[] }> {\n return this.mockReturningFunctionIfEnabled('getEligibleWinBackOffersForPackage', { eligibleWinBackOffers: [] });\n }\n purchaseProductWithWinBackOffer(\n _options: PurchaseProductWithWinBackOfferOptions,\n ): Promise<MakePurchaseResult | undefined> {\n return this.mockReturningFunctionIfEnabled('purchaseProductWithWinBackOffer', undefined);\n }\n purchasePackageWithWinBackOffer(\n _options: PurchasePackageWithWinBackOfferOptions,\n ): Promise<MakePurchaseResult | undefined> {\n return this.mockReturningFunctionIfEnabled('purchasePackageWithWinBackOffer', undefined);\n }\n invalidateCustomerInfoCache(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('invalidateCustomerInfoCache');\n }\n presentCodeRedemptionSheet(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('presentCodeRedemptionSheet');\n }\n setAttributes(_attributes: { [key: string]: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAttributes');\n }\n setEmail(_email: { email: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setEmail');\n }\n setPhoneNumber(_phoneNumber: { phoneNumber: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setPhoneNumber');\n }\n setDisplayName(_displayName: { displayName: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setDisplayName');\n }\n setPushToken(_pushToken: { pushToken: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setPushToken');\n }\n setProxyURL(_url: { url: string }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setProxyURL');\n }\n collectDeviceIdentifiers(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('collectDeviceIdentifiers');\n }\n setAdjustID(_adjustID: { adjustID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAdjustID');\n }\n setAppsflyerID(_appsflyerID: { appsflyerID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAppsflyerID');\n }\n setFBAnonymousID(_fbAnonymousID: { fbAnonymousID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setFBAnonymousID');\n }\n setMparticleID(_mparticleID: { mparticleID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setMparticleID');\n }\n setCleverTapID(_cleverTapID: { cleverTapID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setCleverTapID');\n }\n setMixpanelDistinctID(_mixpanelDistinctID: { mixpanelDistinctID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setMixpanelDistinctID');\n }\n setFirebaseAppInstanceID(_firebaseAppInstanceID: { firebaseAppInstanceID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setFirebaseAppInstanceID');\n }\n setOnesignalID(_onesignalID: { onesignalID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setOnesignalID');\n }\n setOnesignalUserID(_onesignalUserID: { onesignalUserID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setOnesignalUserID');\n }\n setAirshipChannelID(_airshipChannelID: { airshipChannelID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAirshipChannelID');\n }\n setMediaSource(_mediaSource: { mediaSource: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setMediaSource');\n }\n setCampaign(_campaign: { campaign: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setCampaign');\n }\n setAdGroup(_adGroup: { adGroup: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAdGroup');\n }\n setAd(_ad: { ad: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAd');\n }\n setKeyword(_keyword: { keyword: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setKeyword');\n }\n setCreative(_creative: { creative: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setCreative');\n }\n canMakePayments(_features?: { features?: BILLING_FEATURE[] }): Promise<{ canMakePayments: boolean }> {\n return this.mockReturningFunctionIfEnabled('canMakePayments', {\n canMakePayments: true,\n });\n }\n beginRefundRequestForActiveEntitlement(): Promise<{\n refundRequestStatus: REFUND_REQUEST_STATUS;\n }> {\n const mockResult = {\n refundRequestStatus: REFUND_REQUEST_STATUS.USER_CANCELLED,\n };\n return this.mockReturningFunctionIfEnabled('beginRefundRequestForActiveEntitlement', mockResult);\n }\n beginRefundRequestForEntitlement(_entitlementInfo: {\n entitlementInfo: PurchasesEntitlementInfo;\n }): Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS }> {\n const mockResult = {\n refundRequestStatus: REFUND_REQUEST_STATUS.USER_CANCELLED,\n };\n return this.mockReturningFunctionIfEnabled('beginRefundRequestForEntitlement', mockResult);\n }\n beginRefundRequestForProduct(_storeProduct: {\n storeProduct: PurchasesStoreProduct;\n }): Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS }> {\n const mockResult = {\n refundRequestStatus: REFUND_REQUEST_STATUS.USER_CANCELLED,\n };\n return this.mockReturningFunctionIfEnabled('beginRefundRequestForProduct', mockResult);\n }\n\n showInAppMessages(_options?: { messageTypes?: IN_APP_MESSAGE_TYPE[] }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('showInAppMessages');\n }\n\n isConfigured(): Promise<{ isConfigured: boolean }> {\n const mockResult = { isConfigured: true };\n return this.mockReturningFunctionIfEnabled('isConfigured', mockResult);\n }\n\n // Mock helpers\n\n private mockEmptyCustomerInfo: CustomerInfo = {\n entitlements: {\n all: {},\n active: {},\n verification: VERIFICATION_RESULT.NOT_REQUESTED,\n },\n activeSubscriptions: [],\n allPurchasedProductIdentifiers: [],\n latestExpirationDate: null,\n firstSeen: '2023-08-31T15:11:21.445Z',\n originalAppUserId: 'mock-web-user-id',\n requestDate: '2023-08-31T15:11:21.445Z',\n allExpirationDates: {},\n allPurchaseDates: {},\n originalApplicationVersion: null,\n originalPurchaseDate: null,\n managementURL: null,\n nonSubscriptionTransactions: [],\n };\n\n private mockTransaction(productIdentifier: string): PurchasesStoreTransaction {\n return {\n productIdentifier: productIdentifier,\n purchaseDate: new Date().toISOString(),\n transactionIdentifier: '',\n };\n }\n\n private mockNonReturningFunctionIfEnabled(functionName: string): Promise<void> {\n if (!this.shouldMockWebResults) {\n return Promise.reject(this.webNotSupportedErrorMessage);\n }\n console.log(`${functionName} called on web with mocking enabled. No-op`);\n return Promise.resolve();\n }\n\n private mockReturningFunctionIfEnabled<T>(functionName: string, returnValue: T): Promise<T> {\n if (!this.shouldMockWebResults) {\n return Promise.reject(this.webNotSupportedErrorMessage);\n }\n console.log(`${functionName} called on web with mocking enabled. Returning mocked value`);\n return Promise.resolve(returnValue);\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAuB5C,OAAO,EACL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CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IACzE,CAAC;IAyBO,eAAe,CAAC,iBAAyB;QAC/C,OAAO;YACL,iBAAiB,EAAE,iBAAiB;YACpC,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACtC,qBAAqB,EAAE,EAAE;SAC1B,CAAC;IACJ,CAAC;IAEO,iCAAiC,CAAC,YAAoB;QAC5D,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC9B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;SACzD;QACD,OAAO,CAAC,GAAG,CAAC,GAAG,YAAY,4CAA4C,CAAC,CAAC;QACzE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAEO,8BAA8B,CAAI,YAAoB,EAAE,WAAc;QAC5E,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC9B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;SACzD;QACD,OAAO,CAAC,GAAG,CAAC,GAAG,YAAY,6DAA6D,CAAC,CAAC;QAC1F,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { WebPlugin } from '@capacitor/core';\nimport type {\n BILLING_FEATURE,\n CustomerInfo,\n CustomerInfoUpdateListener,\n IN_APP_MESSAGE_TYPE,\n IntroEligibility,\n LOG_LEVEL,\n LogHandler,\n LogInResult,\n MakePurchaseResult,\n PurchasesConfiguration,\n PurchasesEntitlementInfo,\n PurchasesOffering,\n PurchasesOfferings,\n PurchasesPromotionalOffer,\n PurchasesStoreProduct,\n PurchasesStoreTransaction,\n PurchasesWinBackOffer,\n ShouldPurchasePromoProductListener,\n WebPurchaseRedemption,\n WebPurchaseRedemptionResult,\n} from '@revenuecat/purchases-typescript-internal-esm';\nimport {\n REFUND_REQUEST_STATUS,\n VERIFICATION_RESULT,\n WebPurchaseRedemptionResultType,\n} from '@revenuecat/purchases-typescript-internal-esm';\n\nimport type {\n GetEligibleWinBackOffersForPackageOptions,\n GetEligibleWinBackOffersForProductOptions,\n GetProductOptions,\n GetPromotionalOfferOptions,\n PurchaseDiscountedPackageOptions,\n PurchaseDiscountedProductOptions,\n PurchasePackageOptions,\n PurchasePackageWithWinBackOfferOptions,\n PurchaseProductWithWinBackOfferOptions,\n PurchasesPlugin,\n PurchaseStoreProductOptions,\n PurchaseSubscriptionOptionOptions,\n SyncAmazonPurchaseOptions,\n SyncObserverModeAmazonPurchaseOptions,\n} from './definitions';\n\nexport class PurchasesWeb extends WebPlugin implements PurchasesPlugin {\n private shouldMockWebResults = false;\n private webNotSupportedErrorMessage = 'Web not supported in this plugin.';\n\n configure(_configuration: PurchasesConfiguration): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('configure');\n }\n\n parseAsWebPurchaseRedemption(_options: { urlString: string }): Promise<{\n webPurchaseRedemption: WebPurchaseRedemption | null;\n }> {\n return this.mockReturningFunctionIfEnabled('parseAsWebPurchaseRedemption', { webPurchaseRedemption: null });\n }\n\n redeemWebPurchase(_options: { webPurchaseRedemption: WebPurchaseRedemption }): Promise<WebPurchaseRedemptionResult> {\n return this.mockReturningFunctionIfEnabled('redeemWebPurchase', {\n result: WebPurchaseRedemptionResultType.INVALID_TOKEN,\n });\n }\n\n setMockWebResults(options: { shouldMockWebResults: boolean }): Promise<void> {\n this.shouldMockWebResults = options.shouldMockWebResults;\n return Promise.resolve();\n }\n\n setSimulatesAskToBuyInSandbox(_simulatesAskToBuyInSandbox: { simulatesAskToBuyInSandbox: boolean }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setSimulatesAskToBuyInSandbox');\n }\n addCustomerInfoUpdateListener(_customerInfoUpdateListener: CustomerInfoUpdateListener): Promise<string> {\n return this.mockReturningFunctionIfEnabled('addCustomerInfoUpdateListener', 'mock-callback-id');\n }\n removeCustomerInfoUpdateListener(_options: { listenerToRemove: string }): Promise<{ wasRemoved: boolean }> {\n return this.mockReturningFunctionIfEnabled('removeCustomerInfoUpdateListener', { wasRemoved: false });\n }\n addShouldPurchasePromoProductListener(\n _shouldPurchasePromoProductListener: ShouldPurchasePromoProductListener,\n ): Promise<string> {\n return this.mockReturningFunctionIfEnabled('addShouldPurchasePromoProductListener', 'mock-callback-id');\n }\n removeShouldPurchasePromoProductListener(_listenerToRemove: string): Promise<{ wasRemoved: boolean }> {\n return this.mockReturningFunctionIfEnabled('removeShouldPurchasePromoProductListener', { wasRemoved: false });\n }\n getOfferings(): Promise<PurchasesOfferings> {\n const mockOfferings: PurchasesOfferings = {\n all: {},\n current: null,\n };\n return this.mockReturningFunctionIfEnabled('getOfferings', mockOfferings);\n }\n getCurrentOfferingForPlacement(_options: { placementIdentifier: string }): Promise<PurchasesOffering | null> {\n const mockOffering: PurchasesOffering | null = null;\n return this.mockReturningFunctionIfEnabled('getCurrentOfferingForPlacement', mockOffering);\n }\n syncAttributesAndOfferingsIfNeeded(): Promise<PurchasesOfferings> {\n const mockOfferings: PurchasesOfferings = {\n all: {},\n current: null,\n };\n return this.mockReturningFunctionIfEnabled('syncAttributesAndOfferingsIfNeeded', mockOfferings);\n }\n getProducts(_options: GetProductOptions): Promise<{ products: PurchasesStoreProduct[] }> {\n const mockProducts = { products: [] };\n return this.mockReturningFunctionIfEnabled('getProducts', mockProducts);\n }\n purchaseStoreProduct(_options: PurchaseStoreProductOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.product.identifier,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.product.identifier),\n };\n return this.mockReturningFunctionIfEnabled('purchaseStoreProduct', mockPurchaseResult);\n }\n purchaseDiscountedProduct(_options: PurchaseDiscountedProductOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.product.identifier,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.product.identifier),\n };\n return this.mockReturningFunctionIfEnabled('purchaseDiscountedProduct', mockPurchaseResult);\n }\n purchasePackage(_options: PurchasePackageOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.aPackage.product.identifier,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.aPackage.product.identifier),\n };\n return this.mockReturningFunctionIfEnabled('purchasePackage', mockPurchaseResult);\n }\n purchaseSubscriptionOption(_options: PurchaseSubscriptionOptionOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.subscriptionOption.productId,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.subscriptionOption.productId),\n };\n return this.mockReturningFunctionIfEnabled('purchaseSubscriptionOption', mockPurchaseResult);\n }\n purchaseDiscountedPackage(_options: PurchaseDiscountedPackageOptions): Promise<MakePurchaseResult> {\n const mockPurchaseResult: MakePurchaseResult = {\n productIdentifier: _options.aPackage.product.identifier,\n customerInfo: this.mockEmptyCustomerInfo,\n transaction: this.mockTransaction(_options.aPackage.product.identifier),\n };\n return this.mockReturningFunctionIfEnabled('purchaseDiscountedPackage', mockPurchaseResult);\n }\n restorePurchases(): Promise<{ customerInfo: CustomerInfo }> {\n const mockResponse = { customerInfo: this.mockEmptyCustomerInfo };\n return this.mockReturningFunctionIfEnabled('restorePurchases', mockResponse);\n }\n recordPurchase(options: { productID: string }): Promise<{ transaction: PurchasesStoreTransaction }> {\n const mockResponse = {\n transaction: this.mockTransaction(options.productID),\n };\n return this.mockReturningFunctionIfEnabled('recordPurchase', mockResponse);\n }\n getAppUserID(): Promise<{ appUserID: string }> {\n return this.mockReturningFunctionIfEnabled('getAppUserID', {\n appUserID: 'test-web-user-id',\n });\n }\n logIn(_appUserID: { appUserID: string }): Promise<LogInResult> {\n const mockLogInResult: LogInResult = {\n customerInfo: this.mockEmptyCustomerInfo,\n created: false,\n };\n return this.mockReturningFunctionIfEnabled('logIn', mockLogInResult);\n }\n logOut(): Promise<{ customerInfo: CustomerInfo }> {\n const mockResponse = { customerInfo: this.mockEmptyCustomerInfo };\n return this.mockReturningFunctionIfEnabled('logOut', mockResponse);\n }\n setLogLevel(_level: { level: LOG_LEVEL }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setLogLevel');\n }\n setLogHandler(_logHandler: LogHandler): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setLogHandler');\n }\n getCustomerInfo(): Promise<{ customerInfo: CustomerInfo }> {\n const mockResponse = { customerInfo: this.mockEmptyCustomerInfo };\n return this.mockReturningFunctionIfEnabled('getCustomerInfo', mockResponse);\n }\n syncPurchases(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('syncPurchases');\n }\n syncObserverModeAmazonPurchase(_options: SyncObserverModeAmazonPurchaseOptions): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('syncObserverModeAmazonPurchase');\n }\n syncAmazonPurchase(_options: SyncAmazonPurchaseOptions): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('syncAmazonPurchase');\n }\n enableAdServicesAttributionTokenCollection(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('enableAdServicesAttributionTokenCollection');\n }\n isAnonymous(): Promise<{ isAnonymous: boolean }> {\n const mockResponse = { isAnonymous: false };\n return this.mockReturningFunctionIfEnabled('isAnonymous', mockResponse);\n }\n checkTrialOrIntroductoryPriceEligibility(_productIdentifiers: {\n productIdentifiers: string[];\n }): Promise<{ [productId: string]: IntroEligibility }> {\n return this.mockReturningFunctionIfEnabled('checkTrialOrIntroductoryPriceEligibility', {});\n }\n getPromotionalOffer(_options: GetPromotionalOfferOptions): Promise<PurchasesPromotionalOffer | undefined> {\n return this.mockReturningFunctionIfEnabled('getPromotionalOffer', undefined);\n }\n getEligibleWinBackOffersForProduct(\n _options: GetEligibleWinBackOffersForProductOptions,\n ): Promise<{ eligibleWinBackOffers: PurchasesWinBackOffer[] }> {\n return this.mockReturningFunctionIfEnabled('getEligibleWinBackOffersForProduct', { eligibleWinBackOffers: [] });\n }\n getEligibleWinBackOffersForPackage(\n _options: GetEligibleWinBackOffersForPackageOptions,\n ): Promise<{ eligibleWinBackOffers: PurchasesWinBackOffer[] }> {\n return this.mockReturningFunctionIfEnabled('getEligibleWinBackOffersForPackage', { eligibleWinBackOffers: [] });\n }\n purchaseProductWithWinBackOffer(\n _options: PurchaseProductWithWinBackOfferOptions,\n ): Promise<MakePurchaseResult | undefined> {\n return this.mockReturningFunctionIfEnabled('purchaseProductWithWinBackOffer', undefined);\n }\n purchasePackageWithWinBackOffer(\n _options: PurchasePackageWithWinBackOfferOptions,\n ): Promise<MakePurchaseResult | undefined> {\n return this.mockReturningFunctionIfEnabled('purchasePackageWithWinBackOffer', undefined);\n }\n invalidateCustomerInfoCache(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('invalidateCustomerInfoCache');\n }\n presentCodeRedemptionSheet(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('presentCodeRedemptionSheet');\n }\n setAttributes(_attributes: { [key: string]: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAttributes');\n }\n setEmail(_email: { email: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setEmail');\n }\n setPhoneNumber(_phoneNumber: { phoneNumber: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setPhoneNumber');\n }\n setDisplayName(_displayName: { displayName: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setDisplayName');\n }\n setPushToken(_pushToken: { pushToken: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setPushToken');\n }\n setProxyURL(_url: { url: string }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setProxyURL');\n }\n collectDeviceIdentifiers(): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('collectDeviceIdentifiers');\n }\n setAdjustID(_adjustID: { adjustID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAdjustID');\n }\n setAppsflyerID(_appsflyerID: { appsflyerID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAppsflyerID');\n }\n setFBAnonymousID(_fbAnonymousID: { fbAnonymousID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setFBAnonymousID');\n }\n setMparticleID(_mparticleID: { mparticleID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setMparticleID');\n }\n setCleverTapID(_cleverTapID: { cleverTapID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setCleverTapID');\n }\n setMixpanelDistinctID(_mixpanelDistinctID: { mixpanelDistinctID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setMixpanelDistinctID');\n }\n setFirebaseAppInstanceID(_firebaseAppInstanceID: { firebaseAppInstanceID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setFirebaseAppInstanceID');\n }\n setOnesignalID(_onesignalID: { onesignalID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setOnesignalID');\n }\n setOnesignalUserID(_onesignalUserID: { onesignalUserID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setOnesignalUserID');\n }\n setAirshipChannelID(_airshipChannelID: { airshipChannelID: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAirshipChannelID');\n }\n setMediaSource(_mediaSource: { mediaSource: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setMediaSource');\n }\n setCampaign(_campaign: { campaign: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setCampaign');\n }\n setAdGroup(_adGroup: { adGroup: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAdGroup');\n }\n setAd(_ad: { ad: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setAd');\n }\n setKeyword(_keyword: { keyword: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setKeyword');\n }\n setCreative(_creative: { creative: string | null }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('setCreative');\n }\n canMakePayments(_features?: { features?: BILLING_FEATURE[] }): Promise<{ canMakePayments: boolean }> {\n return this.mockReturningFunctionIfEnabled('canMakePayments', {\n canMakePayments: true,\n });\n }\n beginRefundRequestForActiveEntitlement(): Promise<{\n refundRequestStatus: REFUND_REQUEST_STATUS;\n }> {\n const mockResult = {\n refundRequestStatus: REFUND_REQUEST_STATUS.USER_CANCELLED,\n };\n return this.mockReturningFunctionIfEnabled('beginRefundRequestForActiveEntitlement', mockResult);\n }\n beginRefundRequestForEntitlement(_entitlementInfo: {\n entitlementInfo: PurchasesEntitlementInfo;\n }): Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS }> {\n const mockResult = {\n refundRequestStatus: REFUND_REQUEST_STATUS.USER_CANCELLED,\n };\n return this.mockReturningFunctionIfEnabled('beginRefundRequestForEntitlement', mockResult);\n }\n beginRefundRequestForProduct(_storeProduct: {\n storeProduct: PurchasesStoreProduct;\n }): Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS }> {\n const mockResult = {\n refundRequestStatus: REFUND_REQUEST_STATUS.USER_CANCELLED,\n };\n return this.mockReturningFunctionIfEnabled('beginRefundRequestForProduct', mockResult);\n }\n\n showInAppMessages(_options?: { messageTypes?: IN_APP_MESSAGE_TYPE[] }): Promise<void> {\n return this.mockNonReturningFunctionIfEnabled('showInAppMessages');\n }\n\n isConfigured(): Promise<{ isConfigured: boolean }> {\n const mockResult = { isConfigured: true };\n return this.mockReturningFunctionIfEnabled('isConfigured', mockResult);\n }\n\n // Mock helpers\n\n private mockEmptyCustomerInfo: CustomerInfo = {\n entitlements: {\n all: {},\n active: {},\n verification: VERIFICATION_RESULT.NOT_REQUESTED,\n },\n activeSubscriptions: [],\n allPurchasedProductIdentifiers: [],\n latestExpirationDate: null,\n firstSeen: '2023-08-31T15:11:21.445Z',\n originalAppUserId: 'mock-web-user-id',\n requestDate: '2023-08-31T15:11:21.445Z',\n allExpirationDates: {},\n allPurchaseDates: {},\n originalApplicationVersion: null,\n originalPurchaseDate: null,\n managementURL: null,\n nonSubscriptionTransactions: [],\n subscriptionsByProductIdentifier: {},\n };\n\n private mockTransaction(productIdentifier: string): PurchasesStoreTransaction {\n return {\n productIdentifier: productIdentifier,\n purchaseDate: new Date().toISOString(),\n transactionIdentifier: '',\n };\n }\n\n private mockNonReturningFunctionIfEnabled(functionName: string): Promise<void> {\n if (!this.shouldMockWebResults) {\n return Promise.reject(this.webNotSupportedErrorMessage);\n }\n console.log(`${functionName} called on web with mocking enabled. No-op`);\n return Promise.resolve();\n }\n\n private mockReturningFunctionIfEnabled<T>(functionName: string, returnValue: T): Promise<T> {\n if (!this.shouldMockWebResults) {\n return Promise.reject(this.webNotSupportedErrorMessage);\n }\n console.log(`${functionName} called on web with mocking enabled. Returning mocked value`);\n return Promise.resolve(returnValue);\n }\n}\n"]}
@@ -12,7 +12,7 @@ import RevenueCat
12
12
  @objc(PurchasesPlugin)
13
13
  public class PurchasesPlugin: CAPPlugin, PurchasesDelegate {
14
14
  private let platformFlavor = "capacitor"
15
- private let platformVersion = "10.1.0"
15
+ private let platformVersion = "10.2.0"
16
16
 
17
17
  private let customerInfoKey = "customerInfo"
18
18
  private let transactionKey = "transaction"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenuecat/purchases-capacitor",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "description": "Capacitor in-app purchases and subscriptions made easy. Support for iOS and Android.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -72,6 +72,6 @@
72
72
  }
73
73
  },
74
74
  "dependencies": {
75
- "@revenuecat/purchases-typescript-internal-esm": "13.19.0"
75
+ "@revenuecat/purchases-typescript-internal-esm": "13.24.0"
76
76
  }
77
77
  }