diff --git a/iphone/CoreApi/CoreApi/Search/MWMSearchFrameworkHelper.h b/iphone/CoreApi/CoreApi/Search/MWMSearchFrameworkHelper.h index 323e6ec809..f6c2de5e6c 100644 --- a/iphone/CoreApi/CoreApi/Search/MWMSearchFrameworkHelper.h +++ b/iphone/CoreApi/CoreApi/Search/MWMSearchFrameworkHelper.h @@ -7,8 +7,6 @@ NS_ASSUME_NONNULL_BEGIN @interface MWMSearchFrameworkHelper : NSObject - (NSArray *)searchCategories; -- (BOOL)hasMegafonCategoryBanner; -- (NSURL *)megafonBannerUrl; - (nullable id)searchCategoryBanner; - (BOOL)isSearchHistoryEmpty; diff --git a/iphone/CoreApi/CoreApi/Search/MWMSearchFrameworkHelper.mm b/iphone/CoreApi/CoreApi/Search/MWMSearchFrameworkHelper.mm index 3bde71ecbb..d0a6f67ded 100644 --- a/iphone/CoreApi/CoreApi/Search/MWMSearchFrameworkHelper.mm +++ b/iphone/CoreApi/CoreApi/Search/MWMSearchFrameworkHelper.mm @@ -21,43 +21,18 @@ return [result copy]; } -- (BOOL)hasMegafonCategoryBanner -{ - auto & f = GetFramework(); - auto const & purchase = f.GetPurchase(); - if (purchase && purchase->IsSubscriptionActive(SubscriptionType::RemoveAds)) - return NO; - - auto const position = f.GetCurrentPosition(); - if (!position) - return NO; - - if (GetPlatform().ConnectionStatus() == Platform::EConnectionType::CONNECTION_NONE) - return NO; - - auto const latLon = mercator::ToLatLon(*position); - return ads::HasMegafonCategoryBanner(f.GetStorage(), f.GetTopmostCountries(latLon), - languages::GetCurrentNorm()); -} - -- (NSURL *)megafonBannerUrl -{ - auto urlStr = ads::GetMegafonCategoryBannerUrl(); - return [NSURL URLWithString:@(urlStr.c_str())]; -} - - (id)searchCategoryBanner { if (GetPlatform().ConnectionStatus() == Platform::EConnectionType::CONNECTION_NONE) return nil; - + auto const & f = GetFramework(); auto const pos = f.GetCurrentPosition(); auto const banners = f.GetAdsEngine().GetSearchCategoryBanners(pos); if (banners.empty()) return nil; - + return [[CoreBanner alloc] initWithAdBanner:banners.front()]; }