forked from organicmaps/organicmaps
[android] Added facrory method to create bookmark subscription controller
This commit is contained in:
parent
dce2ce87f2
commit
f600486c05
1 changed files with 16 additions and 0 deletions
|
@ -33,6 +33,22 @@ public class PurchaseFactory
|
|||
SubscriptionType.ADS_REMOVAL, productIds);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static PurchaseController<PurchaseCallback> createBookmarksSubscriptionPurchaseController(
|
||||
@NonNull Context context)
|
||||
{
|
||||
BillingManager<PlayStoreBillingCallback> billingManager
|
||||
= new PlayStoreBillingManager(BillingClient.SkuType.SUBS);
|
||||
PurchaseOperationObservable observable = PurchaseOperationObservable.from(context);
|
||||
PurchaseValidator<ValidationCallback> validator = new DefaultPurchaseValidator(observable);
|
||||
String yearlyProduct = PrivateVariables.bookmarksSubscriptionYearlyProductId();
|
||||
String monthlyProduct = PrivateVariables.bookmarksSubscriptionMonthlyProductId();
|
||||
String[] productIds = Utils.concatArrays(PrivateVariables.bookmarksSubscriptionNotUsedList(),
|
||||
yearlyProduct, monthlyProduct);
|
||||
return new SubscriptionPurchaseController(validator, billingManager,
|
||||
SubscriptionType.BOOKMARKS, productIds);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static PurchaseController<PurchaseCallback> createBookmarkPurchaseController(
|
||||
@NonNull Context context, @Nullable String productId, @Nullable String serverId)
|
||||
|
|
Loading…
Add table
Reference in a new issue