diff --git a/android/src/com/mapswithme/maps/purchase/PurchaseFactory.java b/android/src/com/mapswithme/maps/purchase/PurchaseFactory.java index 007f033601..8a9276ce7c 100644 --- a/android/src/com/mapswithme/maps/purchase/PurchaseFactory.java +++ b/android/src/com/mapswithme/maps/purchase/PurchaseFactory.java @@ -33,6 +33,22 @@ public class PurchaseFactory SubscriptionType.ADS_REMOVAL, productIds); } + @NonNull + public static PurchaseController createBookmarksSubscriptionPurchaseController( + @NonNull Context context) + { + BillingManager billingManager + = new PlayStoreBillingManager(BillingClient.SkuType.SUBS); + PurchaseOperationObservable observable = PurchaseOperationObservable.from(context); + PurchaseValidator 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 createBookmarkPurchaseController( @NonNull Context context, @Nullable String productId, @Nullable String serverId)