diff --git a/.prettierignore b/.prettierignore index 6e403b711..8875ae0f1 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,3 +5,4 @@ lib ios android docs/.docusaurus +docs/docs/api diff --git a/docs/docs/api/.nojekyll b/docs/docs/api/.nojekyll new file mode 100644 index 000000000..e2ac6616a --- /dev/null +++ b/docs/docs/api/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/docs/api/classes/PurchaseError.md b/docs/docs/api/classes/PurchaseError.md new file mode 100644 index 000000000..fd256df0f --- /dev/null +++ b/docs/docs/api/classes/PurchaseError.md @@ -0,0 +1,111 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / PurchaseError + +# Class: PurchaseError + +## Implements + +- `Error` + +## Table of contents + +### Constructors + +- [constructor](PurchaseError.md#constructor) + +### Properties + +- [code](PurchaseError.md#code) +- [debugMessage](PurchaseError.md#debugmessage) +- [message](PurchaseError.md#message) +- [name](PurchaseError.md#name) +- [productId](PurchaseError.md#productid) +- [responseCode](PurchaseError.md#responsecode) + +## Constructors + +### constructor + +• **new PurchaseError**(`name`, `message`, `responseCode?`, `debugMessage?`, `code?`, `productId?`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `name` | `string` | +| `message` | `string` | +| `responseCode?` | `number` | +| `debugMessage?` | `string` | +| `code?` | [`ErrorCode`](../enums/ErrorCode.md) | +| `productId?` | `string` | + +#### Defined in + +[purchaseError.ts:21](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L21) + +## Properties + +### code + +• `Optional` **code**: [`ErrorCode`](../enums/ErrorCode.md) + +#### Defined in + +[purchaseError.ts:26](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L26) + +___ + +### debugMessage + +• `Optional` **debugMessage**: `string` + +#### Defined in + +[purchaseError.ts:25](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L25) + +___ + +### message + +• **message**: `string` + +#### Implementation of + +Error.message + +#### Defined in + +[purchaseError.ts:23](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L23) + +___ + +### name + +• **name**: `string` + +#### Implementation of + +Error.name + +#### Defined in + +[purchaseError.ts:22](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L22) + +___ + +### productId + +• `Optional` **productId**: `string` + +#### Defined in + +[purchaseError.ts:27](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L27) + +___ + +### responseCode + +• `Optional` **responseCode**: `number` + +#### Defined in + +[purchaseError.ts:24](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L24) diff --git a/docs/docs/api/enums/ErrorCode.md b/docs/docs/api/enums/ErrorCode.md new file mode 100644 index 000000000..c1eb2bdb4 --- /dev/null +++ b/docs/docs/api/enums/ErrorCode.md @@ -0,0 +1,184 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / ErrorCode + +# Enumeration: ErrorCode + +## Table of contents + +### Enumeration Members + +- [E\_ALREADY\_OWNED](ErrorCode.md#e_already_owned) +- [E\_BILLING\_RESPONSE\_JSON\_PARSE\_ERROR](ErrorCode.md#e_billing_response_json_parse_error) +- [E\_DEFERRED\_PAYMENT](ErrorCode.md#e_deferred_payment) +- [E\_DEVELOPER\_ERROR](ErrorCode.md#e_developer_error) +- [E\_INTERRUPTED](ErrorCode.md#e_interrupted) +- [E\_ITEM\_UNAVAILABLE](ErrorCode.md#e_item_unavailable) +- [E\_NETWORK\_ERROR](ErrorCode.md#e_network_error) +- [E\_NOT\_ENDED](ErrorCode.md#e_not_ended) +- [E\_NOT\_PREPARED](ErrorCode.md#e_not_prepared) +- [E\_RECEIPT\_FAILED](ErrorCode.md#e_receipt_failed) +- [E\_RECEIPT\_FINISHED\_FAILED](ErrorCode.md#e_receipt_finished_failed) +- [E\_REMOTE\_ERROR](ErrorCode.md#e_remote_error) +- [E\_SERVICE\_ERROR](ErrorCode.md#e_service_error) +- [E\_UNKNOWN](ErrorCode.md#e_unknown) +- [E\_USER\_CANCELLED](ErrorCode.md#e_user_cancelled) +- [E\_USER\_ERROR](ErrorCode.md#e_user_error) + +## Enumeration Members + +### E\_ALREADY\_OWNED + +• **E\_ALREADY\_OWNED** = ``"E_ALREADY_OWNED"`` + +#### Defined in + +[purchaseError.ts:13](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L13) + +___ + +### E\_BILLING\_RESPONSE\_JSON\_PARSE\_ERROR + +• **E\_BILLING\_RESPONSE\_JSON\_PARSE\_ERROR** = ``"E_BILLING_RESPONSE_JSON_PARSE_ERROR"`` + +#### Defined in + +[purchaseError.ts:15](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L15) + +___ + +### E\_DEFERRED\_PAYMENT + +• **E\_DEFERRED\_PAYMENT** = ``"E_DEFERRED_PAYMENT"`` + +#### Defined in + +[purchaseError.ts:16](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L16) + +___ + +### E\_DEVELOPER\_ERROR + +• **E\_DEVELOPER\_ERROR** = ``"E_DEVELOPER_ERROR"`` + +#### Defined in + +[purchaseError.ts:14](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L14) + +___ + +### E\_INTERRUPTED + +• **E\_INTERRUPTED** = ``"E_INTERRUPTED"`` + +#### Defined in + +[purchaseError.ts:17](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L17) + +___ + +### E\_ITEM\_UNAVAILABLE + +• **E\_ITEM\_UNAVAILABLE** = ``"E_ITEM_UNAVAILABLE"`` + +#### Defined in + +[purchaseError.ts:5](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L5) + +___ + +### E\_NETWORK\_ERROR + +• **E\_NETWORK\_ERROR** = ``"E_NETWORK_ERROR"`` + +#### Defined in + +[purchaseError.ts:7](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L7) + +___ + +### E\_NOT\_ENDED + +• **E\_NOT\_ENDED** = ``"E_NOT_ENDED"`` + +#### Defined in + +[purchaseError.ts:12](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L12) + +___ + +### E\_NOT\_PREPARED + +• **E\_NOT\_PREPARED** = ``"E_NOT_PREPARED"`` + +#### Defined in + +[purchaseError.ts:11](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L11) + +___ + +### E\_RECEIPT\_FAILED + +• **E\_RECEIPT\_FAILED** = ``"E_RECEIPT_FAILED"`` + +#### Defined in + +[purchaseError.ts:9](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L9) + +___ + +### E\_RECEIPT\_FINISHED\_FAILED + +• **E\_RECEIPT\_FINISHED\_FAILED** = ``"E_RECEIPT_FINISHED_FAILED"`` + +#### Defined in + +[purchaseError.ts:10](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L10) + +___ + +### E\_REMOTE\_ERROR + +• **E\_REMOTE\_ERROR** = ``"E_REMOTE_ERROR"`` + +#### Defined in + +[purchaseError.ts:6](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L6) + +___ + +### E\_SERVICE\_ERROR + +• **E\_SERVICE\_ERROR** = ``"E_SERVICE_ERROR"`` + +#### Defined in + +[purchaseError.ts:8](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L8) + +___ + +### E\_UNKNOWN + +• **E\_UNKNOWN** = ``"E_UNKNOWN"`` + +#### Defined in + +[purchaseError.ts:2](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L2) + +___ + +### E\_USER\_CANCELLED + +• **E\_USER\_CANCELLED** = ``"E_USER_CANCELLED"`` + +#### Defined in + +[purchaseError.ts:3](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L3) + +___ + +### E\_USER\_ERROR + +• **E\_USER\_ERROR** = ``"E_USER_ERROR"`` + +#### Defined in + +[purchaseError.ts:4](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/purchaseError.ts#L4) diff --git a/docs/docs/api/enums/InstallSourceAndroid.md b/docs/docs/api/enums/InstallSourceAndroid.md new file mode 100644 index 000000000..a2a0dfac5 --- /dev/null +++ b/docs/docs/api/enums/InstallSourceAndroid.md @@ -0,0 +1,41 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / InstallSourceAndroid + +# Enumeration: InstallSourceAndroid + +## Table of contents + +### Enumeration Members + +- [AMAZON](InstallSourceAndroid.md#amazon) +- [GOOGLE\_PLAY](InstallSourceAndroid.md#google_play) +- [NOT\_SET](InstallSourceAndroid.md#not_set) + +## Enumeration Members + +### AMAZON + +• **AMAZON** = ``2`` + +#### Defined in + +[types/index.ts:29](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L29) + +___ + +### GOOGLE\_PLAY + +• **GOOGLE\_PLAY** = ``1`` + +#### Defined in + +[types/index.ts:28](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L28) + +___ + +### NOT\_SET + +• **NOT\_SET** = ``0`` + +#### Defined in + +[types/index.ts:27](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L27) diff --git a/docs/docs/api/enums/ProductType.md b/docs/docs/api/enums/ProductType.md new file mode 100644 index 000000000..902bf877e --- /dev/null +++ b/docs/docs/api/enums/ProductType.md @@ -0,0 +1,60 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / ProductType + +# Enumeration: ProductType + +## Table of contents + +### Enumeration Members + +- [iap](ProductType.md#iap) +- [inapp](ProductType.md#inapp) +- [sub](ProductType.md#sub) +- [subs](ProductType.md#subs) + +## Enumeration Members + +### iap + +• **iap** = ``"iap"`` + +Consumable + +#### Defined in + +[types/index.ts:43](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L43) + +___ + +### inapp + +• **inapp** = ``"inapp"`` + +Consumable + +#### Defined in + +[types/index.ts:40](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L40) + +___ + +### sub + +• **sub** = ``"sub"`` + +Subscription + +#### Defined in + +[types/index.ts:37](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L37) + +___ + +### subs + +• **subs** = ``"subs"`` + +Subscription + +#### Defined in + +[types/index.ts:34](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L34) diff --git a/docs/docs/api/enums/ProrationModesAndroid.md b/docs/docs/api/enums/ProrationModesAndroid.md new file mode 100644 index 000000000..abdbf67f2 --- /dev/null +++ b/docs/docs/api/enums/ProrationModesAndroid.md @@ -0,0 +1,74 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / ProrationModesAndroid + +# Enumeration: ProrationModesAndroid + +## Table of contents + +### Enumeration Members + +- [DEFERRED](ProrationModesAndroid.md#deferred) +- [IMMEDIATE\_AND\_CHARGE\_FULL\_PRICE](ProrationModesAndroid.md#immediate_and_charge_full_price) +- [IMMEDIATE\_AND\_CHARGE\_PRORATED\_PRICE](ProrationModesAndroid.md#immediate_and_charge_prorated_price) +- [IMMEDIATE\_WITHOUT\_PRORATION](ProrationModesAndroid.md#immediate_without_proration) +- [IMMEDIATE\_WITH\_TIME\_PRORATION](ProrationModesAndroid.md#immediate_with_time_proration) +- [UNKNOWN\_SUBSCRIPTION\_UPGRADE\_DOWNGRADE\_POLICY](ProrationModesAndroid.md#unknown_subscription_upgrade_downgrade_policy) + +## Enumeration Members + +### DEFERRED + +• **DEFERRED** = ``4`` + +#### Defined in + +[types/index.ts:13](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L13) + +___ + +### IMMEDIATE\_AND\_CHARGE\_FULL\_PRICE + +• **IMMEDIATE\_AND\_CHARGE\_FULL\_PRICE** = ``5`` + +#### Defined in + +[types/index.ts:14](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L14) + +___ + +### IMMEDIATE\_AND\_CHARGE\_PRORATED\_PRICE + +• **IMMEDIATE\_AND\_CHARGE\_PRORATED\_PRICE** = ``2`` + +#### Defined in + +[types/index.ts:11](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L11) + +___ + +### IMMEDIATE\_WITHOUT\_PRORATION + +• **IMMEDIATE\_WITHOUT\_PRORATION** = ``3`` + +#### Defined in + +[types/index.ts:12](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L12) + +___ + +### IMMEDIATE\_WITH\_TIME\_PRORATION + +• **IMMEDIATE\_WITH\_TIME\_PRORATION** = ``1`` + +#### Defined in + +[types/index.ts:10](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L10) + +___ + +### UNKNOWN\_SUBSCRIPTION\_UPGRADE\_DOWNGRADE\_POLICY + +• **UNKNOWN\_SUBSCRIPTION\_UPGRADE\_DOWNGRADE\_POLICY** = ``0`` + +#### Defined in + +[types/index.ts:15](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L15) diff --git a/docs/docs/api/enums/PurchaseStateAndroid.md b/docs/docs/api/enums/PurchaseStateAndroid.md new file mode 100644 index 000000000..6db4d701e --- /dev/null +++ b/docs/docs/api/enums/PurchaseStateAndroid.md @@ -0,0 +1,41 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / PurchaseStateAndroid + +# Enumeration: PurchaseStateAndroid + +## Table of contents + +### Enumeration Members + +- [PENDING](PurchaseStateAndroid.md#pending) +- [PURCHASED](PurchaseStateAndroid.md#purchased) +- [UNSPECIFIED\_STATE](PurchaseStateAndroid.md#unspecified_state) + +## Enumeration Members + +### PENDING + +• **PENDING** = ``2`` + +#### Defined in + +[types/index.ts:21](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L21) + +___ + +### PURCHASED + +• **PURCHASED** = ``1`` + +#### Defined in + +[types/index.ts:20](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L20) + +___ + +### UNSPECIFIED\_STATE + +• **UNSPECIFIED\_STATE** = ``0`` + +#### Defined in + +[types/index.ts:19](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L19) diff --git a/docs/docs/api/interfaces/Discount.md b/docs/docs/api/interfaces/Discount.md new file mode 100644 index 000000000..f15fb8ce7 --- /dev/null +++ b/docs/docs/api/interfaces/Discount.md @@ -0,0 +1,85 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / Discount + +# Interface: Discount + +## Table of contents + +### Properties + +- [identifier](Discount.md#identifier) +- [localizedPrice](Discount.md#localizedprice) +- [numberOfPeriods](Discount.md#numberofperiods) +- [paymentMode](Discount.md#paymentmode) +- [price](Discount.md#price) +- [subscriptionPeriod](Discount.md#subscriptionperiod) +- [type](Discount.md#type) + +## Properties + +### identifier + +• **identifier**: `string` + +#### Defined in + +[types/index.ts:103](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L103) + +___ + +### localizedPrice + +• **localizedPrice**: `string` + +#### Defined in + +[types/index.ts:107](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L107) + +___ + +### numberOfPeriods + +• **numberOfPeriods**: `string` + +#### Defined in + +[types/index.ts:105](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L105) + +___ + +### paymentMode + +• **paymentMode**: ``""`` \| ``"FREETRIAL"`` \| ``"PAYASYOUGO"`` \| ``"PAYUPFRONT"`` + +#### Defined in + +[types/index.ts:108](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L108) + +___ + +### price + +• **price**: `string` + +#### Defined in + +[types/index.ts:106](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L106) + +___ + +### subscriptionPeriod + +• **subscriptionPeriod**: `string` + +#### Defined in + +[types/index.ts:109](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L109) + +___ + +### type + +• **type**: `string` + +#### Defined in + +[types/index.ts:104](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L104) diff --git a/docs/docs/api/interfaces/Product.md b/docs/docs/api/interfaces/Product.md new file mode 100644 index 000000000..b1c649337 --- /dev/null +++ b/docs/docs/api/interfaces/Product.md @@ -0,0 +1,168 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / Product + +# Interface: Product + +## Hierarchy + +- [`ProductCommon`](ProductCommon.md) + + ↳ **`Product`** + +## Table of contents + +### Properties + +- [countryCode](Product.md#countrycode) +- [currency](Product.md#currency) +- [description](Product.md#description) +- [localizedPrice](Product.md#localizedprice) +- [oneTimePurchaseOfferDetails](Product.md#onetimepurchaseofferdetails) +- [price](Product.md#price) +- [productId](Product.md#productid) +- [productIds](Product.md#productids) +- [title](Product.md#title) +- [type](Product.md#type) + +## Properties + +### countryCode + +• `Optional` **countryCode**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[countryCode](ProductCommon.md#countrycode) + +#### Defined in + +[types/index.ts:55](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L55) + +___ + +### currency + +• **currency**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[currency](ProductCommon.md#currency) + +#### Defined in + +[types/index.ts:53](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L53) + +___ + +### description + +• **description**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[description](ProductCommon.md#description) + +#### Defined in + +[types/index.ts:51](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L51) + +___ + +### localizedPrice + +• **localizedPrice**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[localizedPrice](ProductCommon.md#localizedprice) + +#### Defined in + +[types/index.ts:54](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L54) + +___ + +### oneTimePurchaseOfferDetails + +• `Optional` **oneTimePurchaseOfferDetails**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `formattedPrice` | `string` | +| `priceAmountMicros` | `string` | +| `priceCurrencyCode` | `string` | + +#### Defined in + +[types/index.ts:115](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L115) + +___ + +### price + +• **price**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[price](ProductCommon.md#price) + +#### Defined in + +[types/index.ts:52](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L52) + +___ + +### productId + +• **productId**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[productId](ProductCommon.md#productid) + +#### Defined in + +[types/index.ts:48](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L48) + +___ + +### productIds + +• `Optional` **productIds**: `string`[] + +#### Inherited from + +[ProductCommon](ProductCommon.md).[productIds](ProductCommon.md#productids) + +#### Defined in + +[types/index.ts:49](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L49) + +___ + +### title + +• **title**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[title](ProductCommon.md#title) + +#### Defined in + +[types/index.ts:50](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L50) + +___ + +### type + +• **type**: ``"inapp"`` \| ``"iap"`` + +#### Overrides + +[ProductCommon](ProductCommon.md).[type](ProductCommon.md#type) + +#### Defined in + +[types/index.ts:113](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L113) diff --git a/docs/docs/api/interfaces/ProductCommon.md b/docs/docs/api/interfaces/ProductCommon.md new file mode 100644 index 000000000..c42b5443e --- /dev/null +++ b/docs/docs/api/interfaces/ProductCommon.md @@ -0,0 +1,117 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / ProductCommon + +# Interface: ProductCommon + +## Hierarchy + +- **`ProductCommon`** + + ↳ [`Product`](Product.md) + + ↳ [`SubscriptionAndroid`](SubscriptionAndroid.md) + + ↳ [`SubscriptionIOS`](SubscriptionIOS.md) + +## Table of contents + +### Properties + +- [countryCode](ProductCommon.md#countrycode) +- [currency](ProductCommon.md#currency) +- [description](ProductCommon.md#description) +- [localizedPrice](ProductCommon.md#localizedprice) +- [price](ProductCommon.md#price) +- [productId](ProductCommon.md#productid) +- [productIds](ProductCommon.md#productids) +- [title](ProductCommon.md#title) +- [type](ProductCommon.md#type) + +## Properties + +### countryCode + +• `Optional` **countryCode**: `string` + +#### Defined in + +[types/index.ts:55](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L55) + +___ + +### currency + +• **currency**: `string` + +#### Defined in + +[types/index.ts:53](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L53) + +___ + +### description + +• **description**: `string` + +#### Defined in + +[types/index.ts:51](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L51) + +___ + +### localizedPrice + +• **localizedPrice**: `string` + +#### Defined in + +[types/index.ts:54](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L54) + +___ + +### price + +• **price**: `string` + +#### Defined in + +[types/index.ts:52](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L52) + +___ + +### productId + +• **productId**: `string` + +#### Defined in + +[types/index.ts:48](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L48) + +___ + +### productIds + +• `Optional` **productIds**: `string`[] + +#### Defined in + +[types/index.ts:49](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L49) + +___ + +### title + +• **title**: `string` + +#### Defined in + +[types/index.ts:50](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L50) + +___ + +### type + +• **type**: ``"subs"`` \| ``"sub"`` \| ``"inapp"`` \| ``"iap"`` + +#### Defined in + +[types/index.ts:47](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L47) diff --git a/docs/docs/api/interfaces/ProductPurchase.md b/docs/docs/api/interfaces/ProductPurchase.md new file mode 100644 index 000000000..9d2bfa9ac --- /dev/null +++ b/docs/docs/api/interfaces/ProductPurchase.md @@ -0,0 +1,256 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / ProductPurchase + +# Interface: ProductPurchase + +## Hierarchy + +- **`ProductPurchase`** + + ↳ [`SubscriptionPurchase`](SubscriptionPurchase.md) + +## Table of contents + +### Properties + +- [autoRenewingAndroid](ProductPurchase.md#autorenewingandroid) +- [dataAndroid](ProductPurchase.md#dataandroid) +- [developerPayloadAndroid](ProductPurchase.md#developerpayloadandroid) +- [isAcknowledgedAndroid](ProductPurchase.md#isacknowledgedandroid) +- [isCanceledAmazon](ProductPurchase.md#iscanceledamazon) +- [obfuscatedAccountIdAndroid](ProductPurchase.md#obfuscatedaccountidandroid) +- [obfuscatedProfileIdAndroid](ProductPurchase.md#obfuscatedprofileidandroid) +- [originalTransactionDateIOS](ProductPurchase.md#originaltransactiondateios) +- [originalTransactionIdentifierIOS](ProductPurchase.md#originaltransactionidentifierios) +- [packageNameAndroid](ProductPurchase.md#packagenameandroid) +- [productId](ProductPurchase.md#productid) +- [productIds](ProductPurchase.md#productids) +- [purchaseStateAndroid](ProductPurchase.md#purchasestateandroid) +- [purchaseToken](ProductPurchase.md#purchasetoken) +- [quantityIOS](ProductPurchase.md#quantityios) +- [signatureAndroid](ProductPurchase.md#signatureandroid) +- [transactionDate](ProductPurchase.md#transactiondate) +- [transactionId](ProductPurchase.md#transactionid) +- [transactionReceipt](ProductPurchase.md#transactionreceipt) +- [userIdAmazon](ProductPurchase.md#useridamazon) +- [userJsonAmazon](ProductPurchase.md#userjsonamazon) +- [userMarketplaceAmazon](ProductPurchase.md#usermarketplaceamazon) + +## Properties + +### autoRenewingAndroid + +• `Optional` **autoRenewingAndroid**: `boolean` + +#### Defined in + +[types/index.ts:72](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L72) + +___ + +### dataAndroid + +• `Optional` **dataAndroid**: `string` + +#### Defined in + +[types/index.ts:70](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L70) + +___ + +### developerPayloadAndroid + +• `Optional` **developerPayloadAndroid**: `string` + +#### Defined in + +[types/index.ts:76](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L76) + +___ + +### isAcknowledgedAndroid + +• `Optional` **isAcknowledgedAndroid**: `boolean` + +#### Defined in + +[types/index.ts:74](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L74) + +___ + +### isCanceledAmazon + +• `Optional` **isCanceledAmazon**: `boolean` + +#### Defined in + +[types/index.ts:83](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L83) + +___ + +### obfuscatedAccountIdAndroid + +• `Optional` **obfuscatedAccountIdAndroid**: `string` + +#### Defined in + +[types/index.ts:77](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L77) + +___ + +### obfuscatedProfileIdAndroid + +• `Optional` **obfuscatedProfileIdAndroid**: `string` + +#### Defined in + +[types/index.ts:78](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L78) + +___ + +### originalTransactionDateIOS + +• `Optional` **originalTransactionDateIOS**: `string` + +#### Defined in + +[types/index.ts:66](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L66) + +___ + +### originalTransactionIdentifierIOS + +• `Optional` **originalTransactionIdentifierIOS**: `string` + +#### Defined in + +[types/index.ts:67](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L67) + +___ + +### packageNameAndroid + +• `Optional` **packageNameAndroid**: `string` + +#### Defined in + +[types/index.ts:75](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L75) + +___ + +### productId + +• **productId**: `string` + +#### Defined in + +[types/index.ts:59](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L59) + +___ + +### productIds + +• `Optional` **productIds**: `string`[] + +#### Defined in + +[types/index.ts:69](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L69) + +___ + +### purchaseStateAndroid + +• `Optional` **purchaseStateAndroid**: [`PurchaseStateAndroid`](../enums/PurchaseStateAndroid.md) + +#### Defined in + +[types/index.ts:73](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L73) + +___ + +### purchaseToken + +• `Optional` **purchaseToken**: `string` + +#### Defined in + +[types/index.ts:63](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L63) + +___ + +### quantityIOS + +• `Optional` **quantityIOS**: `number` + +#### Defined in + +[types/index.ts:65](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L65) + +___ + +### signatureAndroid + +• `Optional` **signatureAndroid**: `string` + +#### Defined in + +[types/index.ts:71](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L71) + +___ + +### transactionDate + +• **transactionDate**: `number` + +#### Defined in + +[types/index.ts:61](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L61) + +___ + +### transactionId + +• `Optional` **transactionId**: `string` + +#### Defined in + +[types/index.ts:60](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L60) + +___ + +### transactionReceipt + +• **transactionReceipt**: `string` + +#### Defined in + +[types/index.ts:62](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L62) + +___ + +### userIdAmazon + +• `Optional` **userIdAmazon**: `string` + +#### Defined in + +[types/index.ts:80](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L80) + +___ + +### userJsonAmazon + +• `Optional` **userJsonAmazon**: `string` + +#### Defined in + +[types/index.ts:82](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L82) + +___ + +### userMarketplaceAmazon + +• `Optional` **userMarketplaceAmazon**: `string` + +#### Defined in + +[types/index.ts:81](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L81) diff --git a/docs/docs/api/interfaces/PurchaseResult.md b/docs/docs/api/interfaces/PurchaseResult.md new file mode 100644 index 000000000..35e5a889d --- /dev/null +++ b/docs/docs/api/interfaces/PurchaseResult.md @@ -0,0 +1,63 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / PurchaseResult + +# Interface: PurchaseResult + +## Table of contents + +### Properties + +- [code](PurchaseResult.md#code) +- [debugMessage](PurchaseResult.md#debugmessage) +- [message](PurchaseResult.md#message) +- [purchaseToken](PurchaseResult.md#purchasetoken) +- [responseCode](PurchaseResult.md#responsecode) + +## Properties + +### code + +• `Optional` **code**: `string` + +#### Defined in + +[types/index.ts:89](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L89) + +___ + +### debugMessage + +• `Optional` **debugMessage**: `string` + +#### Defined in + +[types/index.ts:88](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L88) + +___ + +### message + +• `Optional` **message**: `string` + +#### Defined in + +[types/index.ts:90](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L90) + +___ + +### purchaseToken + +• `Optional` **purchaseToken**: `string` + +#### Defined in + +[types/index.ts:91](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L91) + +___ + +### responseCode + +• `Optional` **responseCode**: `number` + +#### Defined in + +[types/index.ts:87](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L87) diff --git a/docs/docs/api/interfaces/SubscriptionAndroid.md b/docs/docs/api/interfaces/SubscriptionAndroid.md new file mode 100644 index 000000000..86f21893a --- /dev/null +++ b/docs/docs/api/interfaces/SubscriptionAndroid.md @@ -0,0 +1,182 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / SubscriptionAndroid + +# Interface: SubscriptionAndroid + +## Hierarchy + +- [`ProductCommon`](ProductCommon.md) + + ↳ **`SubscriptionAndroid`** + +## Table of contents + +### Properties + +- [countryCode](SubscriptionAndroid.md#countrycode) +- [currency](SubscriptionAndroid.md#currency) +- [description](SubscriptionAndroid.md#description) +- [localizedPrice](SubscriptionAndroid.md#localizedprice) +- [name](SubscriptionAndroid.md#name) +- [price](SubscriptionAndroid.md#price) +- [productId](SubscriptionAndroid.md#productid) +- [productIds](SubscriptionAndroid.md#productids) +- [productType](SubscriptionAndroid.md#producttype) +- [subscriptionOfferDetails](SubscriptionAndroid.md#subscriptionofferdetails) +- [title](SubscriptionAndroid.md#title) +- [type](SubscriptionAndroid.md#type) + +## Properties + +### countryCode + +• `Optional` **countryCode**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[countryCode](ProductCommon.md#countrycode) + +#### Defined in + +[types/index.ts:55](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L55) + +___ + +### currency + +• **currency**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[currency](ProductCommon.md#currency) + +#### Defined in + +[types/index.ts:53](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L53) + +___ + +### description + +• **description**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[description](ProductCommon.md#description) + +#### Defined in + +[types/index.ts:51](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L51) + +___ + +### localizedPrice + +• **localizedPrice**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[localizedPrice](ProductCommon.md#localizedprice) + +#### Defined in + +[types/index.ts:54](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L54) + +___ + +### name + +• `Optional` **name**: `string` + +#### Defined in + +[types/index.ts:127](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L127) + +___ + +### price + +• **price**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[price](ProductCommon.md#price) + +#### Defined in + +[types/index.ts:52](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L52) + +___ + +### productId + +• **productId**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[productId](ProductCommon.md#productid) + +#### Defined in + +[types/index.ts:48](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L48) + +___ + +### productIds + +• `Optional` **productIds**: `string`[] + +#### Inherited from + +[ProductCommon](ProductCommon.md).[productIds](ProductCommon.md#productids) + +#### Defined in + +[types/index.ts:49](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L49) + +___ + +### productType + +• `Optional` **productType**: `string` + +#### Defined in + +[types/index.ts:126](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L126) + +___ + +### subscriptionOfferDetails + +• `Optional` **subscriptionOfferDetails**: { `offerToken`: `string` ; `pricingPhases`: { `pricingPhaseList`: { `billingCycleCount`: `number` ; `billingPeriod`: `string` ; `formattedPrice`: `string` ; `priceAmountMicros`: `string` ; `priceCurrencyCode`: `string` ; `recurrenceMode`: `number` }[] } }[] + +#### Defined in + +[types/index.ts:128](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L128) + +___ + +### title + +• **title**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[title](ProductCommon.md#title) + +#### Defined in + +[types/index.ts:50](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L50) + +___ + +### type + +• **type**: ``"subs"`` + +#### Overrides + +[ProductCommon](ProductCommon.md).[type](ProductCommon.md#type) + +#### Defined in + +[types/index.ts:124](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L124) diff --git a/docs/docs/api/interfaces/SubscriptionIOS.md b/docs/docs/api/interfaces/SubscriptionIOS.md new file mode 100644 index 000000000..0224549fd --- /dev/null +++ b/docs/docs/api/interfaces/SubscriptionIOS.md @@ -0,0 +1,237 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / SubscriptionIOS + +# Interface: SubscriptionIOS + +## Hierarchy + +- [`ProductCommon`](ProductCommon.md) + + ↳ **`SubscriptionIOS`** + +## Table of contents + +### Properties + +- [countryCode](SubscriptionIOS.md#countrycode) +- [currency](SubscriptionIOS.md#currency) +- [description](SubscriptionIOS.md#description) +- [discounts](SubscriptionIOS.md#discounts) +- [introductoryPrice](SubscriptionIOS.md#introductoryprice) +- [introductoryPriceAsAmountIOS](SubscriptionIOS.md#introductorypriceasamountios) +- [introductoryPriceNumberOfPeriodsIOS](SubscriptionIOS.md#introductorypricenumberofperiodsios) +- [introductoryPricePaymentModeIOS](SubscriptionIOS.md#introductorypricepaymentmodeios) +- [introductoryPriceSubscriptionPeriodIOS](SubscriptionIOS.md#introductorypricesubscriptionperiodios) +- [localizedPrice](SubscriptionIOS.md#localizedprice) +- [price](SubscriptionIOS.md#price) +- [productId](SubscriptionIOS.md#productid) +- [productIds](SubscriptionIOS.md#productids) +- [subscriptionPeriodNumberIOS](SubscriptionIOS.md#subscriptionperiodnumberios) +- [subscriptionPeriodUnitIOS](SubscriptionIOS.md#subscriptionperiodunitios) +- [title](SubscriptionIOS.md#title) +- [type](SubscriptionIOS.md#type) + +## Properties + +### countryCode + +• `Optional` **countryCode**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[countryCode](ProductCommon.md#countrycode) + +#### Defined in + +[types/index.ts:55](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L55) + +___ + +### currency + +• **currency**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[currency](ProductCommon.md#currency) + +#### Defined in + +[types/index.ts:53](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L53) + +___ + +### description + +• **description**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[description](ProductCommon.md#description) + +#### Defined in + +[types/index.ts:51](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L51) + +___ + +### discounts + +• `Optional` **discounts**: [`Discount`](Discount.md)[] + +#### Defined in + +[types/index.ts:149](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L149) + +___ + +### introductoryPrice + +• `Optional` **introductoryPrice**: `string` + +#### Defined in + +[types/index.ts:150](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L150) + +___ + +### introductoryPriceAsAmountIOS + +• `Optional` **introductoryPriceAsAmountIOS**: `string` + +#### Defined in + +[types/index.ts:151](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L151) + +___ + +### introductoryPriceNumberOfPeriodsIOS + +• `Optional` **introductoryPriceNumberOfPeriodsIOS**: `string` + +#### Defined in + +[types/index.ts:157](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L157) + +___ + +### introductoryPricePaymentModeIOS + +• `Optional` **introductoryPricePaymentModeIOS**: ``""`` \| ``"FREETRIAL"`` \| ``"PAYASYOUGO"`` \| ``"PAYUPFRONT"`` + +#### Defined in + +[types/index.ts:152](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L152) + +___ + +### introductoryPriceSubscriptionPeriodIOS + +• `Optional` **introductoryPriceSubscriptionPeriodIOS**: ``""`` \| ``"DAY"`` \| ``"WEEK"`` \| ``"MONTH"`` \| ``"YEAR"`` + +#### Defined in + +[types/index.ts:158](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L158) + +___ + +### localizedPrice + +• **localizedPrice**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[localizedPrice](ProductCommon.md#localizedprice) + +#### Defined in + +[types/index.ts:54](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L54) + +___ + +### price + +• **price**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[price](ProductCommon.md#price) + +#### Defined in + +[types/index.ts:52](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L52) + +___ + +### productId + +• **productId**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[productId](ProductCommon.md#productid) + +#### Defined in + +[types/index.ts:48](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L48) + +___ + +### productIds + +• `Optional` **productIds**: `string`[] + +#### Inherited from + +[ProductCommon](ProductCommon.md).[productIds](ProductCommon.md#productids) + +#### Defined in + +[types/index.ts:49](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L49) + +___ + +### subscriptionPeriodNumberIOS + +• `Optional` **subscriptionPeriodNumberIOS**: `string` + +#### Defined in + +[types/index.ts:165](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L165) + +___ + +### subscriptionPeriodUnitIOS + +• `Optional` **subscriptionPeriodUnitIOS**: ``""`` \| ``"DAY"`` \| ``"WEEK"`` \| ``"MONTH"`` \| ``"YEAR"`` + +#### Defined in + +[types/index.ts:166](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L166) + +___ + +### title + +• **title**: `string` + +#### Inherited from + +[ProductCommon](ProductCommon.md).[title](ProductCommon.md#title) + +#### Defined in + +[types/index.ts:50](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L50) + +___ + +### type + +• **type**: ``"subs"`` + +#### Overrides + +[ProductCommon](ProductCommon.md).[type](ProductCommon.md#type) + +#### Defined in + +[types/index.ts:147](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L147) diff --git a/docs/docs/api/interfaces/SubscriptionOffer.md b/docs/docs/api/interfaces/SubscriptionOffer.md new file mode 100644 index 000000000..15fd51adf --- /dev/null +++ b/docs/docs/api/interfaces/SubscriptionOffer.md @@ -0,0 +1,36 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / SubscriptionOffer + +# Interface: SubscriptionOffer + +In order to purchase a new subscription, every sku must have a selected offerToken + +**`See`** + +SubscriptionAndroid.subscriptionOfferDetails.offerToken + +## Table of contents + +### Properties + +- [offerToken](SubscriptionOffer.md#offertoken) +- [sku](SubscriptionOffer.md#sku) + +## Properties + +### offerToken + +• **offerToken**: `string` + +#### Defined in + +[types/index.ts:177](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L177) + +___ + +### sku + +• **sku**: `string` + +#### Defined in + +[types/index.ts:176](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L176) diff --git a/docs/docs/api/interfaces/SubscriptionPurchase.md b/docs/docs/api/interfaces/SubscriptionPurchase.md new file mode 100644 index 000000000..580aa5454 --- /dev/null +++ b/docs/docs/api/interfaces/SubscriptionPurchase.md @@ -0,0 +1,344 @@ +[react-native-iap](../README.md) / [Exports](../modules.md) / SubscriptionPurchase + +# Interface: SubscriptionPurchase + +## Hierarchy + +- [`ProductPurchase`](ProductPurchase.md) + + ↳ **`SubscriptionPurchase`** + +## Table of contents + +### Properties + +- [autoRenewingAndroid](SubscriptionPurchase.md#autorenewingandroid) +- [dataAndroid](SubscriptionPurchase.md#dataandroid) +- [developerPayloadAndroid](SubscriptionPurchase.md#developerpayloadandroid) +- [isAcknowledgedAndroid](SubscriptionPurchase.md#isacknowledgedandroid) +- [isCanceledAmazon](SubscriptionPurchase.md#iscanceledamazon) +- [obfuscatedAccountIdAndroid](SubscriptionPurchase.md#obfuscatedaccountidandroid) +- [obfuscatedProfileIdAndroid](SubscriptionPurchase.md#obfuscatedprofileidandroid) +- [originalTransactionDateIOS](SubscriptionPurchase.md#originaltransactiondateios) +- [originalTransactionIdentifierIOS](SubscriptionPurchase.md#originaltransactionidentifierios) +- [packageNameAndroid](SubscriptionPurchase.md#packagenameandroid) +- [productId](SubscriptionPurchase.md#productid) +- [productIds](SubscriptionPurchase.md#productids) +- [purchaseStateAndroid](SubscriptionPurchase.md#purchasestateandroid) +- [purchaseToken](SubscriptionPurchase.md#purchasetoken) +- [quantityIOS](SubscriptionPurchase.md#quantityios) +- [signatureAndroid](SubscriptionPurchase.md#signatureandroid) +- [transactionDate](SubscriptionPurchase.md#transactiondate) +- [transactionId](SubscriptionPurchase.md#transactionid) +- [transactionReceipt](SubscriptionPurchase.md#transactionreceipt) +- [userIdAmazon](SubscriptionPurchase.md#useridamazon) +- [userJsonAmazon](SubscriptionPurchase.md#userjsonamazon) +- [userMarketplaceAmazon](SubscriptionPurchase.md#usermarketplaceamazon) + +## Properties + +### autoRenewingAndroid + +• `Optional` **autoRenewingAndroid**: `boolean` + +#### Overrides + +[ProductPurchase](ProductPurchase.md).[autoRenewingAndroid](ProductPurchase.md#autorenewingandroid) + +#### Defined in + +[types/index.ts:95](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L95) + +___ + +### dataAndroid + +• `Optional` **dataAndroid**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[dataAndroid](ProductPurchase.md#dataandroid) + +#### Defined in + +[types/index.ts:70](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L70) + +___ + +### developerPayloadAndroid + +• `Optional` **developerPayloadAndroid**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[developerPayloadAndroid](ProductPurchase.md#developerpayloadandroid) + +#### Defined in + +[types/index.ts:76](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L76) + +___ + +### isAcknowledgedAndroid + +• `Optional` **isAcknowledgedAndroid**: `boolean` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[isAcknowledgedAndroid](ProductPurchase.md#isacknowledgedandroid) + +#### Defined in + +[types/index.ts:74](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L74) + +___ + +### isCanceledAmazon + +• `Optional` **isCanceledAmazon**: `boolean` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[isCanceledAmazon](ProductPurchase.md#iscanceledamazon) + +#### Defined in + +[types/index.ts:83](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L83) + +___ + +### obfuscatedAccountIdAndroid + +• `Optional` **obfuscatedAccountIdAndroid**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[obfuscatedAccountIdAndroid](ProductPurchase.md#obfuscatedaccountidandroid) + +#### Defined in + +[types/index.ts:77](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L77) + +___ + +### obfuscatedProfileIdAndroid + +• `Optional` **obfuscatedProfileIdAndroid**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[obfuscatedProfileIdAndroid](ProductPurchase.md#obfuscatedprofileidandroid) + +#### Defined in + +[types/index.ts:78](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L78) + +___ + +### originalTransactionDateIOS + +• `Optional` **originalTransactionDateIOS**: `string` + +#### Overrides + +[ProductPurchase](ProductPurchase.md).[originalTransactionDateIOS](ProductPurchase.md#originaltransactiondateios) + +#### Defined in + +[types/index.ts:96](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L96) + +___ + +### originalTransactionIdentifierIOS + +• `Optional` **originalTransactionIdentifierIOS**: `string` + +#### Overrides + +[ProductPurchase](ProductPurchase.md).[originalTransactionIdentifierIOS](ProductPurchase.md#originaltransactionidentifierios) + +#### Defined in + +[types/index.ts:97](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L97) + +___ + +### packageNameAndroid + +• `Optional` **packageNameAndroid**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[packageNameAndroid](ProductPurchase.md#packagenameandroid) + +#### Defined in + +[types/index.ts:75](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L75) + +___ + +### productId + +• **productId**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[productId](ProductPurchase.md#productid) + +#### Defined in + +[types/index.ts:59](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L59) + +___ + +### productIds + +• `Optional` **productIds**: `string`[] + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[productIds](ProductPurchase.md#productids) + +#### Defined in + +[types/index.ts:69](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L69) + +___ + +### purchaseStateAndroid + +• `Optional` **purchaseStateAndroid**: [`PurchaseStateAndroid`](../enums/PurchaseStateAndroid.md) + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[purchaseStateAndroid](ProductPurchase.md#purchasestateandroid) + +#### Defined in + +[types/index.ts:73](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L73) + +___ + +### purchaseToken + +• `Optional` **purchaseToken**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[purchaseToken](ProductPurchase.md#purchasetoken) + +#### Defined in + +[types/index.ts:63](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L63) + +___ + +### quantityIOS + +• `Optional` **quantityIOS**: `number` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[quantityIOS](ProductPurchase.md#quantityios) + +#### Defined in + +[types/index.ts:65](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L65) + +___ + +### signatureAndroid + +• `Optional` **signatureAndroid**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[signatureAndroid](ProductPurchase.md#signatureandroid) + +#### Defined in + +[types/index.ts:71](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L71) + +___ + +### transactionDate + +• **transactionDate**: `number` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[transactionDate](ProductPurchase.md#transactiondate) + +#### Defined in + +[types/index.ts:61](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L61) + +___ + +### transactionId + +• `Optional` **transactionId**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[transactionId](ProductPurchase.md#transactionid) + +#### Defined in + +[types/index.ts:60](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L60) + +___ + +### transactionReceipt + +• **transactionReceipt**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[transactionReceipt](ProductPurchase.md#transactionreceipt) + +#### Defined in + +[types/index.ts:62](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L62) + +___ + +### userIdAmazon + +• `Optional` **userIdAmazon**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[userIdAmazon](ProductPurchase.md#useridamazon) + +#### Defined in + +[types/index.ts:80](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L80) + +___ + +### userJsonAmazon + +• `Optional` **userJsonAmazon**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[userJsonAmazon](ProductPurchase.md#userjsonamazon) + +#### Defined in + +[types/index.ts:82](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L82) + +___ + +### userMarketplaceAmazon + +• `Optional` **userMarketplaceAmazon**: `string` + +#### Inherited from + +[ProductPurchase](ProductPurchase.md).[userMarketplaceAmazon](ProductPurchase.md#usermarketplaceamazon) + +#### Defined in + +[types/index.ts:81](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L81) diff --git a/docs/docs/api/modules.md b/docs/docs/api/modules.md new file mode 100644 index 000000000..c812e4867 --- /dev/null +++ b/docs/docs/api/modules.md @@ -0,0 +1,854 @@ +[react-native-iap](README.md) / Exports + +# react-native-iap + +## Table of contents + +### Enumerations + +- [ErrorCode](enums/ErrorCode.md) +- [InstallSourceAndroid](enums/InstallSourceAndroid.md) +- [ProductType](enums/ProductType.md) +- [ProrationModesAndroid](enums/ProrationModesAndroid.md) +- [PurchaseStateAndroid](enums/PurchaseStateAndroid.md) + +### Classes + +- [PurchaseError](classes/PurchaseError.md) + +### Interfaces + +- [Discount](interfaces/Discount.md) +- [Product](interfaces/Product.md) +- [ProductCommon](interfaces/ProductCommon.md) +- [ProductPurchase](interfaces/ProductPurchase.md) +- [PurchaseResult](interfaces/PurchaseResult.md) +- [SubscriptionAndroid](interfaces/SubscriptionAndroid.md) +- [SubscriptionIOS](interfaces/SubscriptionIOS.md) +- [SubscriptionOffer](interfaces/SubscriptionOffer.md) +- [SubscriptionPurchase](interfaces/SubscriptionPurchase.md) + +### Type Aliases + +- [Purchase](modules.md#purchase) +- [Sku](modules.md#sku) +- [Subscription](modules.md#subscription) + +### Variables + +- [PROMOTED\_PRODUCT](modules.md#promoted_product) + +### Functions + +- [acknowledgePurchaseAndroid](modules.md#acknowledgepurchaseandroid) +- [buyPromotedProductIOS](modules.md#buypromotedproductios) +- [clearProductsIOS](modules.md#clearproductsios) +- [clearTransactionIOS](modules.md#cleartransactionios) +- [deepLinkToSubscriptionsAndroid](modules.md#deeplinktosubscriptionsandroid) +- [endConnection](modules.md#endconnection) +- [finishTransaction](modules.md#finishtransaction) +- [flushFailedPurchasesCachedAsPendingAndroid](modules.md#flushfailedpurchasescachedaspendingandroid) +- [getAndroidModule](modules.md#getandroidmodule) +- [getAvailablePurchases](modules.md#getavailablepurchases) +- [getInstallSourceAndroid](modules.md#getinstallsourceandroid) +- [getIosModule](modules.md#getiosmodule) +- [getNativeModule](modules.md#getnativemodule) +- [getPendingPurchasesIOS](modules.md#getpendingpurchasesios) +- [getProducts](modules.md#getproducts) +- [getPromotedProductIOS](modules.md#getpromotedproductios) +- [getPurchaseHistory](modules.md#getpurchasehistory) +- [getReceiptIOS](modules.md#getreceiptios) +- [getSubscriptions](modules.md#getsubscriptions) +- [initConnection](modules.md#initconnection) +- [presentCodeRedemptionSheetIOS](modules.md#presentcoderedemptionsheetios) +- [promotedProductListener](modules.md#promotedproductlistener) +- [purchaseErrorListener](modules.md#purchaseerrorlistener) +- [purchaseUpdatedListener](modules.md#purchaseupdatedlistener) +- [requestPurchase](modules.md#requestpurchase) +- [requestPurchaseWithOfferIOS](modules.md#requestpurchasewithofferios) +- [requestPurchaseWithQuantityIOS](modules.md#requestpurchasewithquantityios) +- [requestSubscription](modules.md#requestsubscription) +- [setAndroidNativeModule](modules.md#setandroidnativemodule) +- [useIAP](modules.md#useiap) +- [useIAPContext](modules.md#useiapcontext) +- [validateReceiptAmazon](modules.md#validatereceiptamazon) +- [validateReceiptAndroid](modules.md#validatereceiptandroid) +- [validateReceiptIos](modules.md#validatereceiptios) +- [withIAPContext](modules.md#withiapcontext) + +## Type Aliases + +### Purchase + +Ƭ **Purchase**: [`ProductPurchase`](interfaces/ProductPurchase.md) \| [`SubscriptionPurchase`](interfaces/SubscriptionPurchase.md) + +#### Defined in + +[types/index.ts:100](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L100) + +___ + +### Sku + +Ƭ **Sku**: `string` + +#### Defined in + +[types/index.ts:7](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L7) + +___ + +### Subscription + +Ƭ **Subscription**: [`SubscriptionAndroid`](interfaces/SubscriptionAndroid.md) & [`SubscriptionIOS`](interfaces/SubscriptionIOS.md) + +#### Defined in + +[types/index.ts:169](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L169) + +## Variables + +### PROMOTED\_PRODUCT + +• `Const` **PROMOTED\_PRODUCT**: ``"iap-promoted-product"`` + +#### Defined in + +[types/index.ts:24](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/types/index.ts#L24) + +## Functions + +### acknowledgePurchaseAndroid + +▸ **acknowledgePurchaseAndroid**(`token`): `Promise`<`boolean` \| `void` \| [`PurchaseResult`](interfaces/PurchaseResult.md)\> + +Acknowledge a product (on Android.) No-op on iOS. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `Object` | The product's token (on Android) | +| `token.developerPayload?` | `string` | - | +| `token.token` | `string` | - | + +#### Returns + +`Promise`<`boolean` \| `void` \| [`PurchaseResult`](interfaces/PurchaseResult.md)\> + +#### Defined in + +[iap.ts:487](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L487) + +___ + +### buyPromotedProductIOS + +▸ **buyPromotedProductIOS**(): `Promise`<`void`\> + +Buy the currently selected promoted product (iOS only) + Initiates the payment process for a promoted product. Should only be called in response to the `iap-promoted-product` event. + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[iap.ts:527](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L527) + +___ + +### clearProductsIOS + +▸ **clearProductsIOS**(): `Promise`<`void`\> + +Clear valid Products (iOS only) + Remove all products which are validated by Apple server. + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[iap.ts:479](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L479) + +___ + +### clearTransactionIOS + +▸ **clearTransactionIOS**(): `Promise`<`void`\> + +Clear Transaction (iOS only) + Finish remaining transactions. Related to issue #257 and #801 + link : https://github.com/dooboolab/react-native-iap/issues/257 + https://github.com/dooboolab/react-native-iap/issues/801 + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[iap.ts:471](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L471) + +___ + +### deepLinkToSubscriptionsAndroid + +▸ **deepLinkToSubscriptionsAndroid**(`sku`): `Promise`<`void`\> + +Deep link to subscriptions screen on Android. No-op on iOS. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `sku` | `Object` | The product's SKU (on Android) | +| `sku.sku` | `string` | - | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[iap.ts:502](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L502) + +___ + +### endConnection + +▸ **endConnection**(): `Promise`<`boolean`\> + +End module for purchase flow. + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[iap.ts:93](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L93) + +___ + +### finishTransaction + +▸ **finishTransaction**(`__namedParameters`): `Promise`<`boolean` \| [`PurchaseResult`](interfaces/PurchaseResult.md)\> + +Finish Transaction (both platforms) + Abstracts Finish Transaction + iOS: Tells StoreKit that you have delivered the purchase to the user and StoreKit can now let go of the transaction. + Call this after you have persisted the purchased state to your server or local data in your app. + `react-native-iap` will continue to deliver the purchase updated events with the successful purchase until you finish the transaction. **Even after the app has relaunched.** + Android: it will consume purchase for consumables and acknowledge purchase for non-consumables. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.developerPayloadAndroid?` | `string` | +| `__namedParameters.isConsumable?` | `boolean` | +| `__namedParameters.purchase` | [`ProductPurchase`](interfaces/ProductPurchase.md) | + +#### Returns + +`Promise`<`boolean` \| [`PurchaseResult`](interfaces/PurchaseResult.md)\> + +#### Defined in + +[iap.ts:413](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L413) + +___ + +### flushFailedPurchasesCachedAsPendingAndroid + +▸ **flushFailedPurchasesCachedAsPendingAndroid**(): `Promise`<`boolean`\> + +Consume all 'ghost' purchases (that is, pending payment that already failed but is still marked as pending in Play Store cache). Android only. + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[iap.ts:101](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L101) + +___ + +### getAndroidModule + +▸ **getAndroidModule**(): `AmazonModuleProps` \| `AndroidModuleProps` + +#### Returns + +`AmazonModuleProps` \| `AndroidModuleProps` + +#### Defined in + +[iap.ts:51](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L51) + +___ + +### getAvailablePurchases + +▸ **getAvailablePurchases**(): `Promise`<([`ProductPurchase`](interfaces/ProductPurchase.md) \| [`SubscriptionPurchase`](interfaces/SubscriptionPurchase.md))[]\> + +Get all purchases made by the user (either non-consumable, or haven't been consumed yet) + +#### Returns + +`Promise`<([`ProductPurchase`](interfaces/ProductPurchase.md) \| [`SubscriptionPurchase`](interfaces/SubscriptionPurchase.md))[]\> + +#### Defined in + +[iap.ts:200](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L200) + +___ + +### getInstallSourceAndroid + +▸ **getInstallSourceAndroid**(): [`InstallSourceAndroid`](enums/InstallSourceAndroid.md) + +#### Returns + +[`InstallSourceAndroid`](enums/InstallSourceAndroid.md) + +#### Defined in + +[iap.ts:31](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L31) + +___ + +### getIosModule + +▸ **getIosModule**(): `IosModuleProps` + +#### Returns + +`IosModuleProps` + +#### Defined in + +[iap.ts:69](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L69) + +___ + +### getNativeModule + +▸ **getNativeModule**(): `AmazonModuleProps` \| `AndroidModuleProps` \| `IosModuleProps` + +#### Returns + +`AmazonModuleProps` \| `AndroidModuleProps` \| `IosModuleProps` + +#### Defined in + +[iap.ts:75](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L75) + +___ + +### getPendingPurchasesIOS + +▸ **getPendingPurchasesIOS**(): `Promise`<[`ProductPurchase`](interfaces/ProductPurchase.md)[]\> + +Get the current receipt base64 encoded in IOS. + +#### Returns + +`Promise`<[`ProductPurchase`](interfaces/ProductPurchase.md)[]\> + +#### Defined in + +[iap.ts:675](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L675) + +___ + +### getProducts + +▸ **getProducts**(`skus`): `Promise`<[`Product`](interfaces/Product.md)[]\> + +Get a list of products (consumable and non-consumable items, but not subscriptions) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `skus` | `Object` | The item skus | +| `skus.skus` | `string`[] | - | + +#### Returns + +`Promise`<[`Product`](interfaces/Product.md)[]\> + +#### Defined in + +[iap.ts:109](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L109) + +___ + +### getPromotedProductIOS + +▸ **getPromotedProductIOS**(): `Promise`<``null`` \| [`Product`](interfaces/Product.md)\> + +Should Add Store Payment (iOS only) + Indicates the the App Store purchase should continue from the app instead of the App Store. + +#### Returns + +`Promise`<``null`` \| [`Product`](interfaces/Product.md)\> + +promoted product + +#### Defined in + +[iap.ts:519](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L519) + +___ + +### getPurchaseHistory + +▸ **getPurchaseHistory**(): `Promise`<([`ProductPurchase`](interfaces/ProductPurchase.md) \| [`SubscriptionPurchase`](interfaces/SubscriptionPurchase.md))[]\> + +Gets an inventory of purchases made by the user regardless of consumption status + +#### Returns + +`Promise`<([`ProductPurchase`](interfaces/ProductPurchase.md) \| [`SubscriptionPurchase`](interfaces/SubscriptionPurchase.md))[]\> + +#### Defined in + +[iap.ts:170](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L170) + +___ + +### getReceiptIOS + +▸ **getReceiptIOS**(`__namedParameters`): `Promise`<`string`\> + +Get the current receipt base64 encoded in IOS. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.forceRefresh?` | `boolean` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[iap.ts:683](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L683) + +___ + +### getSubscriptions + +▸ **getSubscriptions**(`skus`): `Promise`<[`Subscription`](modules.md#subscription)[]\> + +Get a list of subscriptions + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `skus` | `Object` | The item skus | +| `skus.skus` | `string`[] | - | + +#### Returns + +`Promise`<[`Subscription`](modules.md#subscription)[]\> + +#### Defined in + +[iap.ts:140](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L140) + +___ + +### initConnection + +▸ **initConnection**(): `Promise`<`boolean`\> + +Init module for purchase flow. Required on Android. In ios it will check whether user canMakePayment. + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[iap.ts:86](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L86) + +___ + +### presentCodeRedemptionSheetIOS + +▸ **presentCodeRedemptionSheetIOS**(): `Promise`<``null``\> + +Launches a modal to register the redeem offer code in IOS. + +#### Returns + +`Promise`<``null``\> + +#### Defined in + +[iap.ts:693](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L693) + +___ + +### promotedProductListener + +▸ **promotedProductListener**(`listener`): ``null`` \| `EmitterSubscription` + +Add IAP promoted subscription event + +**`Platform`** + +iOS + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `listener` | () => `void` | + +#### Returns + +``null`` \| `EmitterSubscription` + +#### Defined in + +[eventEmitter.ts:42](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/eventEmitter.ts#L42) + +___ + +### purchaseErrorListener + +▸ **purchaseErrorListener**(`listener`): `EmitterSubscription` + +Add IAP purchase error event + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `listener` | (`error`: [`PurchaseError`](classes/PurchaseError.md)) => `void` | + +#### Returns + +`EmitterSubscription` + +#### Defined in + +[eventEmitter.ts:30](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/eventEmitter.ts#L30) + +___ + +### purchaseUpdatedListener + +▸ **purchaseUpdatedListener**(`listener`): `EmitterSubscription` + +Add IAP purchase event + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `listener` | (`event`: [`Purchase`](modules.md#purchase)) => `void` | + +#### Returns + +`EmitterSubscription` + +#### Defined in + +[eventEmitter.ts:11](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/eventEmitter.ts#L11) + +___ + +### requestPurchase + +▸ **requestPurchase**(`__namedParameters`): `Promise`<`void` \| [`ProductPurchase`](interfaces/ProductPurchase.md)\> + +Request a purchase for product. This will be received in `PurchaseUpdatedListener`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `__namedParameters` | `Object` | - | +| `__namedParameters.andDangerouslyFinishTransactionAutomaticallyIOS?` | `boolean` | - | +| `__namedParameters.applicationUsername?` | `string` | - | +| `__namedParameters.isOfferPersonalized?` | `boolean` | - | +| `__namedParameters.obfuscatedAccountIdAndroid?` | `string` | - | +| `__namedParameters.obfuscatedProfileIdAndroid?` | `string` | - | +| `__namedParameters.sku?` | `string` | - | +| `__namedParameters.skus?` | `string`[] | For Google Play Billing Library 5 https://developer.android.com/google/play/billing/integrate#personalized-price | + +#### Returns + +`Promise`<`void` \| [`ProductPurchase`](interfaces/ProductPurchase.md)\> + +#### Defined in + +[iap.ts:238](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L238) + +___ + +### requestPurchaseWithOfferIOS + +▸ **requestPurchaseWithOfferIOS**(`__namedParameters`): `Promise`<[`Purchase`](modules.md#purchase)\> + +Buy products or subscriptions with offers (iOS only) + +Runs the payment process with some info you must fetch +from your server. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.forUser` | `string` | +| `__namedParameters.sku` | `string` | +| `__namedParameters.withOffer` | `PaymentDiscount` | + +#### Returns + +`Promise`<[`Purchase`](modules.md#purchase)\> + +#### Defined in + +[iap.ts:574](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L574) + +___ + +### requestPurchaseWithQuantityIOS + +▸ **requestPurchaseWithQuantityIOS**(`sku`): `Promise`<[`ProductPurchase`](interfaces/ProductPurchase.md)\> + +Request a purchase for product. This will be received in `PurchaseUpdatedListener`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `sku` | `Object` | The product's sku/ID | +| `sku.quantity` | `number` | - | +| `sku.sku` | `string` | - | + +#### Returns + +`Promise`<[`ProductPurchase`](interfaces/ProductPurchase.md)\> + +#### Defined in + +[iap.ts:392](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L392) + +___ + +### requestSubscription + +▸ **requestSubscription**(`__namedParameters?`): `Promise`<``null`` \| `void` \| [`SubscriptionPurchase`](interfaces/SubscriptionPurchase.md)\> + +Request a purchase for product. This will be received in `PurchaseUpdatedListener`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `__namedParameters?` | `Object` | - | +| `__namedParameters.andDangerouslyFinishTransactionAutomaticallyIOS?` | `boolean` | - | +| `__namedParameters.applicationUsername?` | `string` | - | +| `__namedParameters.isOfferPersonalized?` | `boolean` | For Google Play Billing Library 5 https://developer.android.com/google/play/billing/integrate#personalized-price | +| `__namedParameters.obfuscatedAccountIdAndroid?` | `string` | - | +| `__namedParameters.obfuscatedProfileIdAndroid?` | `string` | - | +| `__namedParameters.prorationModeAndroid?` | [`ProrationModesAndroid`](enums/ProrationModesAndroid.md) | - | +| `__namedParameters.purchaseTokenAndroid?` | `string` | - | +| `__namedParameters.sku?` | `string` | - | +| `__namedParameters.subscriptionOffers?` | [`SubscriptionOffer`](interfaces/SubscriptionOffer.md)[] | For Google Play Billing Library 5 | + +#### Returns + +`Promise`<``null`` \| `void` \| [`SubscriptionPurchase`](interfaces/SubscriptionPurchase.md)\> + +Promise resolves to null when using proratioModesAndroid=DEFERRED, and to a SubscriptionPurchase otherwise + +#### Defined in + +[iap.ts:315](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L315) + +___ + +### setAndroidNativeModule + +▸ **setAndroidNativeModule**(`nativeModule`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `nativeModule` | `AndroidModuleProps` | + +#### Returns + +`void` + +#### Defined in + +[iap.ts:39](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L39) + +___ + +### useIAP + +▸ **useIAP**(): `IAP_STATUS` + +#### Returns + +`IAP_STATUS` + +#### Defined in + +[hooks/useIAP.ts:44](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/hooks/useIAP.ts#L44) + +___ + +### useIAPContext + +▸ **useIAPContext**(): `IAPContextType` + +#### Returns + +`IAPContextType` + +#### Defined in + +[hooks/withIAPContext.tsx:41](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/hooks/withIAPContext.tsx#L41) + +___ + +### validateReceiptAmazon + +▸ **validateReceiptAmazon**(`__namedParameters`): `Promise`<`ReceiptType`\> + +Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including +your developer secret in the binary you ship to users is potentially dangerous. +Use server side validation instead for your production builds + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.developerSecret` | `string` | +| `__namedParameters.receiptId` | `string` | +| `__namedParameters.useSandbox` | `boolean` | +| `__namedParameters.userId` | `string` | + +#### Returns + +`Promise`<`ReceiptType`\> + +#### Defined in + +[iap.ts:653](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L653) + +___ + +### validateReceiptAndroid + +▸ **validateReceiptAndroid**(`__namedParameters`): `Promise`<`ReceiptType`\> + +Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including +your access token in the binary you ship to users is potentially dangerous. +Use server side validation instead for your production builds + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.accessToken` | `string` | +| `__namedParameters.isSub?` | `boolean` | +| `__namedParameters.packageName` | `string` | +| `__namedParameters.productId` | `string` | +| `__namedParameters.productToken` | `string` | + +#### Returns + +`Promise`<`ReceiptType`\> + +#### Defined in + +[iap.ts:620](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L620) + +___ + +### validateReceiptIos + +▸ **validateReceiptIos**(`__namedParameters`): `Promise`<``false`` \| `ResponseBody`\> + +Validate receipt for iOS. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.isTest?` | `boolean` | +| `__namedParameters.receiptBody` | `Record`<`string`, `unknown`\> | + +#### Returns + +`Promise`<``false`` \| `ResponseBody`\> + +#### Defined in + +[iap.ts:591](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/iap.ts#L591) + +___ + +### withIAPContext + +▸ **withIAPContext**<`T`\>(`Component`): (`props`: `T`) => `Element` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `Component` | `ComponentType`<`T`\> | + +#### Returns + +`fn` + +▸ (`props`): `Element` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `props` | `T` | + +##### Returns + +`Element` + +#### Defined in + +[hooks/withIAPContext.tsx:51](https://github.com/dooboolab/react-native-iap/blob/d06ab43/src/hooks/withIAPContext.tsx#L51) diff --git a/package.json b/package.json index 3be63a245..cd9421e68 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,8 @@ "react-native-builder-bob": "0.18.3", "release-it": "15.2.0", "ts-jest": "28.0.7", + "typedoc": "^0.23.14", + "typedoc-plugin-markdown": "^3.13.6", "typescript": "4.7.4" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index e08ca533e..49314d7ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8572,6 +8572,13 @@ __metadata: languageName: node linkType: hard +"jsonc-parser@npm:^3.0.0": + version: 3.2.0 + resolution: "jsonc-parser@npm:3.2.0" + checksum: 946dd9a5f326b745aa326d48a7257e3f4a4b62c5e98ec8e49fa2bdd8d96cef7e6febf1399f5c7016114fd1f68a1c62c6138826d5d90bc650448e3cf0951c53c7 + languageName: node + linkType: hard + "jsonfile@npm:^2.1.0": version: 2.4.0 resolution: "jsonfile@npm:2.4.0" @@ -8919,6 +8926,13 @@ __metadata: languageName: node linkType: hard +"lunr@npm:^2.3.9": + version: 2.3.9 + resolution: "lunr@npm:2.3.9" + checksum: 176719e24fcce7d3cf1baccce9dd5633cd8bdc1f41ebe6a180112e5ee99d80373fe2454f5d4624d437e5a8319698ca6837b9950566e15d2cae5f2a543a3db4b8 + languageName: node + linkType: hard + "macos-release@npm:^3.0.1": version: 3.1.0 resolution: "macos-release@npm:3.1.0" @@ -9015,6 +9029,15 @@ __metadata: languageName: node linkType: hard +"marked@npm:^4.0.19": + version: 4.1.0 + resolution: "marked@npm:4.1.0" + bin: + marked: bin/marked.js + checksum: f0b3732a9d6208c933541342e60eb78029bd046c143a6ade0e76ed80b6174f92b186205a9dfe805e435070806ec475b0e87e62d04348eafd2f761c24281b192a + languageName: node + linkType: hard + "meow@npm:^8.0.0": version: 8.1.2 resolution: "meow@npm:8.1.2" @@ -9459,7 +9482,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^5.0.1": +"minimatch@npm:^5.0.1, minimatch@npm:^5.1.0": version: 5.1.0 resolution: "minimatch@npm:5.1.0" dependencies: @@ -10908,6 +10931,8 @@ __metadata: react-native-builder-bob: 0.18.3 release-it: 15.2.0 ts-jest: 28.0.7 + typedoc: ^0.23.14 + typedoc-plugin-markdown: ^3.13.6 typescript: 4.7.4 peerDependencies: react: ">=16.13.1" @@ -11758,6 +11783,17 @@ __metadata: languageName: node linkType: hard +"shiki@npm:^0.11.1": + version: 0.11.1 + resolution: "shiki@npm:0.11.1" + dependencies: + jsonc-parser: ^3.0.0 + vscode-oniguruma: ^1.6.1 + vscode-textmate: ^6.0.0 + checksum: 2a4ebc3b466816263fc244ae4f67a4ff96aa74d863b9c5e7e4affc50f37fd6d1a781405de0dbf763b777bc33e49a0d441de7ff3fededb8b01e3b8dbb37e2927d + languageName: node + linkType: hard + "side-channel@npm:^1.0.4": version: 1.0.4 resolution: "side-channel@npm:1.0.4" @@ -12704,6 +12740,33 @@ __metadata: languageName: node linkType: hard +"typedoc-plugin-markdown@npm:^3.13.6": + version: 3.13.6 + resolution: "typedoc-plugin-markdown@npm:3.13.6" + dependencies: + handlebars: ^4.7.7 + peerDependencies: + typedoc: ">=0.23.0" + checksum: eae59997759f485b2a6f2c306dc6de47dc0b008acc4651d66a24b8ba31fc7fd7729b69ba0b1235aaab268931701510ef5af88588f9b3ea124166a2ca7b63f954 + languageName: node + linkType: hard + +"typedoc@npm:^0.23.14": + version: 0.23.14 + resolution: "typedoc@npm:0.23.14" + dependencies: + lunr: ^2.3.9 + marked: ^4.0.19 + minimatch: ^5.1.0 + shiki: ^0.11.1 + peerDependencies: + typescript: 4.6.x || 4.7.x || 4.8.x + bin: + typedoc: bin/typedoc + checksum: 4037dc0db4aa8b205ac505bdc191de404ea2da3eb8dabbf8172851c239b85a96fbfd81503dc2d4789066d6901d76c552abc73ee04a239763b69b90587d44527b + languageName: node + linkType: hard + "typescript@npm:4.7.4, typescript@npm:^4.3.5": version: 4.7.4 resolution: "typescript@npm:4.7.4" @@ -13035,6 +13098,20 @@ __metadata: languageName: node linkType: hard +"vscode-oniguruma@npm:^1.6.1": + version: 1.6.2 + resolution: "vscode-oniguruma@npm:1.6.2" + checksum: 6b754acdafd5b68242ea5938bb00a32effc16c77f471d4f0f337d879d0e8e592622998e2441f42d9a7ff799c1593f31c11f26ca8d9bf9917e3ca881d3c1f3e19 + languageName: node + linkType: hard + +"vscode-textmate@npm:^6.0.0": + version: 6.0.0 + resolution: "vscode-textmate@npm:6.0.0" + checksum: ff6f17a406c2906586afc14ef01cb122e33acd35312e815abb5c924347a777c6783ce3fe7db8b83f1760ebf843c669843b9390f905b69c433b3395af28e4b483 + languageName: node + linkType: hard + "walker@npm:^1.0.7, walker@npm:^1.0.8": version: 1.0.8 resolution: "walker@npm:1.0.8"