Skip to content

Commit

Permalink
fix: product field
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Dec 15, 2021
1 parent 7c05f0e commit 46848c5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,20 @@ For more info see https://docs.revenuecat.com/docs/entitlements

#### Product

| Prop | Type | Description |
| ------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------ |
| **`identifier`** | <code>string</code> | <a href="#product">Product</a> Id. |
| **`description`** | <code>string</code> | Description of the product. |
| **`title`** | <code>string</code> | Title of the product. |
| **`price`** | <code>number</code> | Price of the product in the local currency. |
| **`localizedPrice`** | <code>string</code> | Formatted price of the item, including its currency sign, such as €3.99. |
| **`currencyCode`** | <code>string</code> | Currency code for price and original price. |
| **`currencySymbol`** | <code>string</code> | Currency symbol for price and original price. |
| **`subscriptionPeriod`** | <code><a href="#subscriptionperiod">SubscriptionPeriod</a></code> | The <a href="#product">Product</a> subcription group identifier. |
| **`introductoryPrice`** | <code><a href="#skproductdiscount">SKProductDiscount</a></code> | The <a href="#product">Product</a> introductory Price. |
| **`discounts`** | <code><a href="#skproductdiscount">SKProductDiscount</a></code> | The <a href="#product">Product</a> discounts list. |
| Prop | Type | Description |
| --------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------ |
| **`identifier`** | <code>string</code> | <a href="#product">Product</a> Id. |
| **`description`** | <code>string</code> | Description of the product. |
| **`title`** | <code>string</code> | Title of the product. |
| **`price`** | <code>number</code> | Price of the product in the local currency. |
| **`priceString`** | <code>string</code> | Formatted price of the item, including its currency sign, such as €3.99. |
| **`currencyCode`** | <code>string</code> | Currency code for price and original price. |
| **`currencySymbol`** | <code>string</code> | Currency symbol for price and original price. |
| **`isFamilyShareable`** | <code>boolean</code> | Boolean indicating if the product is sharable with family |
| **`subscriptionGroupIdentifier`** | <code>string</code> | Group identifier for the product. |
| **`subscriptionPeriod`** | <code><a href="#subscriptionperiod">SubscriptionPeriod</a></code> | The <a href="#product">Product</a> subcription group identifier. |
| **`introductoryPrice`** | <code><a href="#skproductdiscount">SKProductDiscount</a></code> | The <a href="#product">Product</a> introductory Price. |
| **`discounts`** | <code><a href="#skproductdiscount">SKProductDiscount</a></code> | The <a href="#product">Product</a> discounts list. |


#### SubscriptionPeriod
Expand Down
8 changes: 4 additions & 4 deletions ios/Plugin/CapacitorPurchasesPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 9 additions & 1 deletion src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
*/
Expand Down

0 comments on commit 46848c5

Please sign in to comment.