Skip to content

Commit

Permalink
Fixes #530 enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Jun 19, 2019
1 parent 9746985 commit 42e8653
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions IapExample/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class Page extends Component {

getItems = async() => {
try {
const products: Product[] = await RNIap.getProducts(itemSkus);
// const products = await RNIap.getSubscriptions(itemSkus);
// const products: Product[] = await RNIap.getProducts(itemSkus);
const products = await RNIap.getSubscriptions(itemSkus);
console.log('Products', products);
this.setState({ productList: products });
} catch (err) {
Expand Down Expand Up @@ -219,8 +219,8 @@ class Page extends Component {
paddingHorizontal: 20,
}} >{JSON.stringify(product)}</Text>
<NativeButton
onPress={() => this.requestPurchase(product.productId)}
// onPress={() => this.requestSubscription(product.productId)}
// onPress={() => this.requestPurchase(product.productId)}
onPress={() => this.requestSubscription(product.productId)}
// onPress={() => this.buyItem(product.productId)}
// onPress={() => this.buySubscribeItem(product.productId)}
activeOpacity={0.5}
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/dooboolab/RNIap/RNIapModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public void run() {
}
}

if (prorationMode != 0) {
if (prorationMode != 0 && prorationMode != -1) {
builder.setReplaceSkusProrationMode(prorationMode);
}

Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,11 @@ export const buyPromotedProductIOS = () => Platform.select({
* @returns {Promise}
*/
export const buyProductWithOfferIOS = (sku, forUser, withOffer) => Platform.select({
ios: () => {
ios: async() => {
checkNativeiOSAvailable();
return RNIapIos.buyProductWithOffer(sku, forUser, withOffer);
},
android: () => Promise.resolve(),
android: async() => Promise.resolve(),
})();

/**
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": "react-native-iap",
"version": "3.0.0-rc.14",
"version": "3.0.0-rc.16",
"description": "React Native In App Purchase Module.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 42e8653

Please sign in to comment.