Skip to content
This repository was archived by the owner on Oct 20, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ Testing with static responses is limited, because you are only able to test the

**Important**: You can only test on a physical Android device, not from an emulator.

## Handle Canceled Subscriptions

Call `InAppBilling.getSubscriptionTransactionDetails(productId)` and check the `details.autoRenewing` flag. It will be set to `false` once subscription gets cancelled. Also notice, that you will need to call periodically `InAppBilling.loadOwnedPurchasesFromGoogle()` method in order to update purchase/subscription information from the Google-servers.

## Javascript API

All methods returns a `Promise`.
Expand Down Expand Up @@ -224,6 +228,7 @@ InAppBilling.open()
- **purchaseState:** String ("PurchasedSuccessfully", "Canceled", "Refunded", "SubscriptionExpired")
- **receiptSignature:** String
- **receiptData:** String
- **autoRenewing** Boolean
- **developerPayload:** String

```javascript
Expand Down Expand Up @@ -263,6 +268,7 @@ InAppBilling.consumePurchase('your.inapp.productid').then(...);
- **purchaseState:** String ("PurchasedSuccessfully", "Canceled", "Refunded", "SubscriptionExpired")
- **receiptSignature:** String
- **receiptData:** String
- **autoRenewing** Boolean
- **developerPayload:** String

```javascript
Expand Down Expand Up @@ -303,6 +309,7 @@ InAppBilling.isSubscribed('your.inapp.productid').then(...);
- **purchaseState:** String ("PurchasedSuccessfully", "Canceled", "Refunded", "SubscriptionExpired")
- **receiptSignature:** String
- **receiptData:** String
- **autoRenewing** Boolean
- **developerPayload:** String

```javascript
Expand Down Expand Up @@ -467,6 +474,7 @@ InAppBilling.getSubscriptionDetailsArray(['your.inapp.productid', 'your.inapp.pr
- **purchaseState:** String ("PurchasedSuccessfully", "Canceled", "Refunded", "SubscriptionExpired")
- **receiptSignature:** String
- **receiptData:** String
- **autoRenewing** Boolean
- **developerPayload:** String

```javascript
Expand All @@ -493,6 +501,7 @@ InAppBilling.getPurchaseTransactionDetails("your.inapp.productid").then(
- **purchaseState:** String ("PurchasedSuccessfully", "Canceled", "Refunded", "SubscriptionExpired")
- **receiptSignature:** String
- **receiptData:** String
- **autoRenewing** Boolean
- **developerPayload:** String

```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ private WritableMap mapTransactionDetails(TransactionDetails details) {
? "" : purchaseData.purchaseTime.toString());
map.putString("purchaseState", purchaseData.purchaseState == null
? "" : purchaseData.purchaseState.toString());

map.putBoolean("autoRenewing", purchaseData.autoRenewing);

if (purchaseData.developerPayload != null)
map.putString("developerPayload", purchaseData.developerPayload);
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface ITransactionDetails {
purchaseState: PurchaseState;
receiptSignature: string;
receiptData: string;
autoRenewing: boolean;
developerPayload: string;
}

Expand Down