diff --git a/android/jni/com/mapswithme/maps/PrivateVariables.cpp b/android/jni/com/mapswithme/maps/PrivateVariables.cpp index d78f27134c..72e00ee3b9 100644 --- a/android/jni/com/mapswithme/maps/PrivateVariables.cpp +++ b/android/jni/com/mapswithme/maps/PrivateVariables.cpp @@ -69,4 +69,22 @@ extern "C" { return env->NewStringUTF(ADS_REMOVAL_VENDOR); } + + JNIEXPORT jstring JNICALL + Java_com_mapswithme_maps_PrivateVariables_adsRemovalYearlyProductId(JNIEnv *env, jclass clazz) + { + return env->NewStringUTF(ADS_REMOVAL_YEARLY_PRODUCT_ID); + } + + JNIEXPORT jstring JNICALL + Java_com_mapswithme_maps_PrivateVariables_adsRemovalMonthlyProductId(JNIEnv *env, jclass clazz) + { + return env->NewStringUTF(ADS_REMOVAL_MONTHLY_PRODUCT_ID); + } + + JNIEXPORT jstring JNICALL + Java_com_mapswithme_maps_PrivateVariables_adsRemovalWeeklyProductId(JNIEnv *env, jclass clazz) + { + return env->NewStringUTF(ADS_REMOVAL_WEEKLY_PRODUCT_ID); + } } diff --git a/android/src/com/mapswithme/maps/PrivateVariables.java b/android/src/com/mapswithme/maps/PrivateVariables.java index 36b8533f97..634ef2088b 100644 --- a/android/src/com/mapswithme/maps/PrivateVariables.java +++ b/android/src/com/mapswithme/maps/PrivateVariables.java @@ -25,6 +25,12 @@ public class PrivateVariables public static native String adsRemovalServerId(); @NonNull public static native String adsRemovalVendor(); + @NonNull + public static native String adsRemovalYearlyProductId(); + @NonNull + public static native String adsRemovalMonthlyProductId(); + @NonNull + public static native String adsRemovalWeeklyProductId(); /** * @return interval in seconds */ diff --git a/android/src/com/mapswithme/maps/purchase/PurchaseFactory.java b/android/src/com/mapswithme/maps/purchase/PurchaseFactory.java index d4bd4a5bb6..713cbdfe7a 100644 --- a/android/src/com/mapswithme/maps/purchase/PurchaseFactory.java +++ b/android/src/com/mapswithme/maps/purchase/PurchaseFactory.java @@ -3,6 +3,7 @@ package com.mapswithme.maps.purchase; import android.support.annotation.NonNull; import com.android.billingclient.api.BillingClient; +import com.mapswithme.maps.PrivateVariables; public class PurchaseFactory { @@ -17,7 +18,10 @@ public class PurchaseFactory BillingManager billingManager = new PlayStoreBillingManager(BillingClient.SkuType.SUBS); PurchaseValidator validator = new AdsRemovalPurchaseValidator(); - return new AdsRemovalPurchaseController(validator, billingManager, "ads.removal.yearly.test", - "ads.removal.monthly.test", "ads.removal.weekly.test"); + String yearlyProduct = PrivateVariables.adsRemovalYearlyProductId(); + String monthlyProduct = PrivateVariables.adsRemovalMonthlyProductId(); + String weeklyProduct = PrivateVariables.adsRemovalWeeklyProductId(); + return new AdsRemovalPurchaseController(validator, billingManager, yearlyProduct, + monthlyProduct, weeklyProduct); } }