forked from organicmaps/organicmaps
[android] Added usage ads removal ids from private
This commit is contained in:
parent
39f350013b
commit
d1a1484ea2
3 changed files with 30 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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<PlayStoreBillingCallback> billingManager
|
||||
= new PlayStoreBillingManager(BillingClient.SkuType.SUBS);
|
||||
PurchaseValidator<AdsRemovalValidationCallback> 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue