From 46848c56e5d555891696e0a246179175e7614fb2 Mon Sep 17 00:00:00 2001 From: martindonadieu Date: Wed, 15 Dec 2021 21:18:32 +0000 Subject: [PATCH] fix: product field --- README.md | 26 ++++++++++++----------- ios/Plugin/CapacitorPurchasesPlugin.swift | 8 +++---- package.json | 2 +- src/definitions.ts | 10 ++++++++- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index ebc15e7d..b9783299 100644 --- a/README.md +++ b/README.md @@ -217,18 +217,20 @@ For more info see https://docs.revenuecat.com/docs/entitlements #### Product -| Prop | Type | Description | -| ------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------ | -| **`identifier`** | string | Product Id. | -| **`description`** | string | Description of the product. | -| **`title`** | string | Title of the product. | -| **`price`** | number | Price of the product in the local currency. | -| **`localizedPrice`** | string | Formatted price of the item, including its currency sign, such as €3.99. | -| **`currencyCode`** | string | Currency code for price and original price. | -| **`currencySymbol`** | string | Currency symbol for price and original price. | -| **`subscriptionPeriod`** | SubscriptionPeriod | The Product subcription group identifier. | -| **`introductoryPrice`** | SKProductDiscount | The Product introductory Price. | -| **`discounts`** | SKProductDiscount | The Product discounts list. | +| Prop | Type | Description | +| --------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------ | +| **`identifier`** | string | Product Id. | +| **`description`** | string | Description of the product. | +| **`title`** | string | Title of the product. | +| **`price`** | number | Price of the product in the local currency. | +| **`priceString`** | string | Formatted price of the item, including its currency sign, such as €3.99. | +| **`currencyCode`** | string | Currency code for price and original price. | +| **`currencySymbol`** | string | Currency symbol for price and original price. | +| **`isFamilyShareable`** | boolean | Boolean indicating if the product is sharable with family | +| **`subscriptionGroupIdentifier`** | string | Group identifier for the product. | +| **`subscriptionPeriod`** | SubscriptionPeriod | The Product subcription group identifier. | +| **`introductoryPrice`** | SKProductDiscount | The Product introductory Price. | +| **`discounts`** | SKProductDiscount | The Product discounts list. | #### SubscriptionPeriod diff --git a/ios/Plugin/CapacitorPurchasesPlugin.swift b/ios/Plugin/CapacitorPurchasesPlugin.swift index 0585f0f6..60d43a3f 100644 --- a/ios/Plugin/CapacitorPurchasesPlugin.swift +++ b/ios/Plugin/CapacitorPurchasesPlugin.swift @@ -59,13 +59,13 @@ import StoreKit introPrice = introductoryPrice?.toJson() as Any } return [ - "localizedDescription": localizedDescription, - "localizedTitle": localizedTitle, + "description": localizedDescription, + "title": localizedTitle, "price": price, - "localizedPrice": localizedPrice, + "priceString": localizedPrice, "currencySymbol": priceLocale.currencySymbol as Any, "currencyCode": priceLocale.currencyCode as Any, - "productIdentifier": productIdentifier, + "identifier": productIdentifier, "isFamilyShareable": isFamilyShareable, "subscriptionGroupIdentifier": subscriptionGroupIdentifier as Any, "subscriptionPeriod": subscriptionPeriod?.toJson() as Any, diff --git a/package.json b/package.json index c1c245bf..c2e7b56e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "capacitor-purchases", - "version": "0.0.9", + "version": "0.0.10", "description": "In-app Subscriptions Made Easy with RevenueCat sdk", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", diff --git a/src/definitions.ts b/src/definitions.ts index 87b8a2f5..807a937c 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -367,7 +367,7 @@ export interface Product { /** * Formatted price of the item, including its currency sign, such as €3.99. */ - readonly localizedPrice: string; + readonly priceString: string; /** * Currency code for price and original price. */ @@ -376,6 +376,14 @@ export interface Product { * Currency symbol for price and original price. */ readonly currencySymbol: string; + /** + * Boolean indicating if the product is sharable with family + */ + readonly isFamilyShareable: boolean; + /** + * Group identifier for the product. + */ + readonly subscriptionGroupIdentifier: string; /** * The Product subcription group identifier. */