Fix discount banner (osmlive porchase)

This commit is contained in:
Alexey Kulish 2018-05-22 17:04:04 +03:00
parent 01a3675231
commit 38f79588d2

View file

@ -220,10 +220,17 @@ public class DiscountHelper {
purchaseHelper.purchaseFullVersion(mapActivity);
}
} else if (url.contains(InAppPurchaseHelper.SKU_LIVE_UPDATES)){
Intent intent = new Intent(mapActivity, OsmLiveActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
intent.putExtra(OsmLiveActivity.OPEN_SUBSCRIPTION_INTENT_PARAM, true);
mapActivity.startActivity(intent);
OsmandApplication app = mapActivity.getMyApplication();
app.logEvent(mapActivity, "osm_live_purchase_redirect");
OsmandSettings settings = app.getSettings();
InAppPurchaseHelper purchaseHelper = app.getInAppPurchaseHelper();
if (purchaseHelper != null) {
purchaseHelper.purchaseLiveUpdates(mapActivity,
settings.BILLING_USER_EMAIL.get(),
settings.BILLING_USER_NAME.get(),
settings.BILLING_USER_COUNTRY_DOWNLOAD_NAME.get(),
settings.BILLING_HIDE_USER_NAME.get());
}
}
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);