From 1ee6f36724570fbd6cb0f77955d254c66c277481 Mon Sep 17 00:00:00 2001 From: crimean Date: Fri, 2 Nov 2018 13:31:23 +0300 Subject: [PATCH] Update purchase state after purchase --- OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java b/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java index 87cf8701d4..5692e80648 100644 --- a/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java +++ b/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java @@ -632,6 +632,7 @@ public class InAppPurchaseHelper { // bought live updates logDebug("Live updates subscription purchased."); final String sku = liveUpdatesPurchase.getSku(); + liveUpdatesPurchase.setPurchaseState(purchase.getPurchaseState() == 0 ? PurchaseState.PURCHASED : PurchaseState.NOT_PURCHASED); sendTokens(Collections.singletonList(purchase), new OnRequestResultListener() { @Override public void onResult(String result) { @@ -651,6 +652,7 @@ public class InAppPurchaseHelper { } else if (purchase.getSku().equals(getFullVersion().getSku())) { // bought full version + getFullVersion().setPurchaseState(purchase.getPurchaseState() == 0 ? PurchaseState.PURCHASED : PurchaseState.NOT_PURCHASED); logDebug("Full version purchased."); showToast(ctx.getString(R.string.full_version_thanks)); ctx.getSettings().FULL_VERSION_PURCHASED.set(true); @@ -661,6 +663,7 @@ public class InAppPurchaseHelper { } else if (purchase.getSku().equals(getDepthContours().getSku())) { // bought sea depth contours + getDepthContours().setPurchaseState(purchase.getPurchaseState() == 0 ? PurchaseState.PURCHASED : PurchaseState.NOT_PURCHASED); logDebug("Sea depth contours purchased."); showToast(ctx.getString(R.string.sea_depth_thanks)); ctx.getSettings().DEPTH_CONTOURS_PURCHASED.set(true);