Skip to content
This repository was archived by the owner on Oct 20, 2020. It is now read-only.

Commit aea964e

Browse files
rdycbrevik
authored andcommitted
add support for isOneTimePurchaseSupported
1 parent 6a074bd commit aea964e

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,16 @@ InAppBilling.updateSubscription(['subscription.p1m', 'subscription.p3m'], 'subsc
322322
InAppBilling.isPurchased('your.inapp.productid').then(...);
323323
```
324324

325+
### isOneTimePurchaseSupported()
326+
327+
##### Returns:
328+
329+
* **oneTimePurchaseSupported:** Boolean
330+
331+
```javascript
332+
InAppBilling.isOneTimePurchaseSupported().then(...);
333+
```
334+
325335
### listOwnedProducts()
326336

327337
##### Returns:

android/src/main/java/com/idehub/Billing/InAppBillingBridge.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,16 @@ public void isPurchased(final String productId, final Promise promise){
218218
}
219219
}
220220

221+
@ReactMethod
222+
public void isOneTimePurchaseSupported(final Promise promise){
223+
if (bp != null) {
224+
boolean oneTimePurchaseSupported = bp.isOneTimePurchaseSupported();
225+
promise.resolve(oneTimePurchaseSupported);
226+
} else {
227+
promise.reject("EUNSPECIFIED", "Channel is not opened. Call open() on InAppBilling.");
228+
}
229+
}
230+
221231
@ReactMethod
222232
public void listOwnedProducts(final Promise promise){
223233
if (bp != null) {

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class InAppBilling {
4040
return InAppBillingBridge.isPurchased(productId);
4141
}
4242

43+
static isOneTimePurchaseSupported() {
44+
return InAppBillingBridge.isOneTimePurchaseSupported();
45+
}
46+
4347
static listOwnedProducts() {
4448
return InAppBillingBridge.listOwnedProducts();
4549
}

0 commit comments

Comments
 (0)