@revenuecat/purchases-capacitor 10.3.6 → 10.3.8

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
@@ -1403,12 +1403,12 @@ Type representing a product from the <a href="#store">Store</a>.
1403
1403
  | **`title`** | <code>string</code> | Title of the product. |
1404
1404
  | **`price`** | <code>number</code> | <a href="#price">Price</a> of the product in the local currency. Contains the price value of defaultOption for Google Play. |
1405
1405
  | **`priceString`** | <code>string</code> | Formatted price of the item, including its currency sign. Contains the formatted price value of defaultOption for Google Play. |
1406
- | **`pricePerWeek`** | <code>number</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> in a weekly recurrence. This means that, for example, if the period is monthly, the price will be divided by 4. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1407
- | **`pricePerMonth`** | <code>number</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> in a monthly recurrence. This means that, for example, if the period is annual, the price will be divided by 12. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1408
- | **`pricePerYear`** | <code>number</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> in a yearly recurrence. This means that, for example, if the period is monthly, the price will be multiplied by 12. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1409
- | **`pricePerWeekString`** | <code>string</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> formatted for the current locale in a weekly recurrence. This means that, for example, if the period is monthly, the price will be divided by 4. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1410
- | **`pricePerMonthString`** | <code>string</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> formatted for the current locale in a monthly recurrence. This means that, for example, if the period is annual, the price will be divided by 12. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1411
- | **`pricePerYearString`** | <code>string</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> formatted for the current locale in a yearly recurrence. This means that, for example, if the period is monthly, the price will be multiplied by 12. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1406
+ | **`pricePerWeek`** | <code>number \| null</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> in a weekly recurrence. This means that, for example, if the period is monthly, the price will be divided by 4. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1407
+ | **`pricePerMonth`** | <code>number \| null</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> in a monthly recurrence. This means that, for example, if the period is annual, the price will be divided by 12. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1408
+ | **`pricePerYear`** | <code>number \| null</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> in a yearly recurrence. This means that, for example, if the period is monthly, the price will be multiplied by 12. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1409
+ | **`pricePerWeekString`** | <code>string \| null</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> formatted for the current locale in a weekly recurrence. This means that, for example, if the period is monthly, the price will be divided by 4. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1410
+ | **`pricePerMonthString`** | <code>string \| null</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> formatted for the current locale in a monthly recurrence. This means that, for example, if the period is annual, the price will be divided by 12. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1411
+ | **`pricePerYearString`** | <code>string \| null</code> | Null for INAPP products. The price of the <a href="#purchasesstoreproduct">PurchasesStoreProduct</a> formatted for the current locale in a yearly recurrence. This means that, for example, if the period is monthly, the price will be multiplied by 12. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value. |
1412
1412
  | **`currencyCode`** | <code>string</code> | Currency code for price and original price. Contains the currency code value of defaultOption for Google Play. |
1413
1413
  | **`introPrice`** | <code><a href="#purchasesintroprice">PurchasesIntroPrice</a> \| null</code> | Introductory price. |
1414
1414
  | **`discounts`** | <code>PurchasesStoreProductDiscount[] \| null</code> | Collection of discount offers for a product. Null for Android. |
@@ -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.38.1'
16
+ s.dependency 'PurchasesHybridCommon', '14.2.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.38.1'
59
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:14.2.0'
60
60
  testImplementation "junit:junit:$junitVersion"
61
61
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
62
62
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -22,7 +22,7 @@ import com.revenuecat.purchases.hybridcommon.configure
22
22
  import com.revenuecat.purchases.hybridcommon.getProductInfo
23
23
  import com.revenuecat.purchases.hybridcommon.isWebPurchaseRedemptionURL
24
24
  import com.revenuecat.purchases.hybridcommon.mappers.convertToMap
25
- import com.revenuecat.purchases.hybridcommon.mappers.map
25
+ import com.revenuecat.purchases.hybridcommon.mappers.mapAsync
26
26
  import com.revenuecat.purchases.hybridcommon.purchaseProduct
27
27
  import com.revenuecat.purchases.hybridcommon.showInAppMessagesIfNeeded
28
28
  import com.revenuecat.purchases.interfaces.UpdatedCustomerInfoListener
@@ -80,7 +80,7 @@ class PurchasesPlugin : Plugin() {
80
80
 
81
81
  companion object {
82
82
  private const val PLATFORM_NAME = "capacitor"
83
- private const val PLUGIN_VERSION = "10.3.6"
83
+ private const val PLUGIN_VERSION = "10.3.8"
84
84
 
85
85
  private const val CUSTOMER_INFO_KEY = "customerInfo"
86
86
  }
@@ -116,8 +116,10 @@ class PurchasesPlugin : Plugin() {
116
116
  diagnosticsEnabled = diagnosticsEnabled,
117
117
  )
118
118
  Purchases.sharedInstance.updatedCustomerInfoListener = UpdatedCustomerInfoListener { customerInfo ->
119
- for (callbackId in customerInfoListeners) {
120
- bridge.getSavedCall(callbackId)?.resolveWithMap(customerInfo.map())
119
+ customerInfo.mapAsync { map ->
120
+ for (callbackId in customerInfoListeners) {
121
+ bridge.getSavedCall(callbackId)?.resolveWithMap(map)
122
+ }
121
123
  }
122
124
  }
123
125
  call.resolve()
@@ -161,7 +163,7 @@ class PurchasesPlugin : Plugin() {
161
163
  if (rejectIfNotConfigured(call)) return
162
164
  customerInfoListeners.add(call.callbackId)
163
165
  call.setKeepAlive(true)
164
- lastSeenCustomerInfo?.let { call.resolveWithMap(it.map()) }
166
+ lastSeenCustomerInfo?.let { it.mapAsync { map -> call.resolveWithMap(map) } }
165
167
  }
166
168
 
167
169
  @PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
package/dist/docs.json CHANGED
@@ -2446,42 +2446,42 @@
2446
2446
  "tags": [],
2447
2447
  "docs": "Null for INAPP products. The price of the PurchasesStoreProduct in a weekly recurrence.\nThis means that, for example, if the period is monthly, the price will be\ndivided by 4. Note that this value may be an approximation. For Google subscriptions,\nthis value will use the basePlan to calculate the value.",
2448
2448
  "complexTypes": [],
2449
- "type": "number"
2449
+ "type": "number | null"
2450
2450
  },
2451
2451
  {
2452
2452
  "name": "pricePerMonth",
2453
2453
  "tags": [],
2454
2454
  "docs": "Null for INAPP products. The price of the PurchasesStoreProduct in a monthly recurrence.\nThis means that, for example, if the period is annual, the price will be\ndivided by 12. Note that this value may be an approximation. For Google subscriptions,\nthis value will use the basePlan to calculate the value.",
2455
2455
  "complexTypes": [],
2456
- "type": "number"
2456
+ "type": "number | null"
2457
2457
  },
2458
2458
  {
2459
2459
  "name": "pricePerYear",
2460
2460
  "tags": [],
2461
2461
  "docs": "Null for INAPP products. The price of the PurchasesStoreProduct in a yearly recurrence.\nThis means that, for example, if the period is monthly, the price will be multiplied by\n12. Note that this value may be an approximation. For Google subscriptions, this value\nwill use the basePlan to calculate the value.",
2462
2462
  "complexTypes": [],
2463
- "type": "number"
2463
+ "type": "number | null"
2464
2464
  },
2465
2465
  {
2466
2466
  "name": "pricePerWeekString",
2467
2467
  "tags": [],
2468
2468
  "docs": "Null for INAPP products. The price of the PurchasesStoreProduct formatted for the current\nlocale in a weekly recurrence. This means that, for example, if the period is monthly,\nthe price will be divided by 4. It uses a currency formatter to format the price in the\ngiven locale. Note that this value may be an approximation. For Google subscriptions,\nthis value will use the basePlan to calculate the value.",
2469
2469
  "complexTypes": [],
2470
- "type": "string"
2470
+ "type": "string | null"
2471
2471
  },
2472
2472
  {
2473
2473
  "name": "pricePerMonthString",
2474
2474
  "tags": [],
2475
2475
  "docs": "Null for INAPP products. The price of the PurchasesStoreProduct formatted for the current\nlocale in a monthly recurrence. This means that, for example, if the period is annual,\nthe price will be divided by 12. It uses a currency formatter to format the price in the\ngiven locale. Note that this value may be an approximation. For Google subscriptions,\nthis value will use the basePlan to calculate the value.",
2476
2476
  "complexTypes": [],
2477
- "type": "string"
2477
+ "type": "string | null"
2478
2478
  },
2479
2479
  {
2480
2480
  "name": "pricePerYearString",
2481
2481
  "tags": [],
2482
2482
  "docs": "Null for INAPP products. The price of the PurchasesStoreProduct formatted for the current\nlocale in a yearly recurrence. This means that, for example, if the period is monthly,\nthe price will be multiplied by 12. It uses a currency formatter to format the price in the\ngiven locale. Note that this value may be an approximation. For Google subscriptions,\nthis value will use the basePlan to calculate the value.",
2483
2483
  "complexTypes": [],
2484
- "type": "string"
2484
+ "type": "string | null"
2485
2485
  },
2486
2486
  {
2487
2487
  "name": "currencyCode",
@@ -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.3.6"
15
+ private let platformVersion = "10.3.8"
16
16
 
17
17
  private let customerInfoKey = "customerInfo"
18
18
  private let transactionKey = "transaction"
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@revenuecat/purchases-capacitor",
3
- "version": "10.3.6",
3
+ "version": "10.3.8",
4
4
  "description": "Capacitor in-app purchases and subscriptions made easy. Support for iOS and Android.",
5
- "main": "dist/plugin.cjs.js",
5
+ "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/esm/index.d.ts",
8
8
  "unpkg": "dist/plugin.js",
@@ -73,6 +73,6 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@revenuecat/purchases-typescript-internal-esm": "13.38.1"
76
+ "@revenuecat/purchases-typescript-internal-esm": "14.2.0"
77
77
  }
78
78
  }