[ios] helpers for megafon category banner are removed

This commit is contained in:
Arsentiy Milchakov 2020-10-26 14:06:03 +03:00 committed by Alexander Boriskov
parent 0d690bfe05
commit 611ad89881
2 changed files with 2 additions and 29 deletions

View file

@ -7,8 +7,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface MWMSearchFrameworkHelper : NSObject
- (NSArray<NSString *> *)searchCategories;
- (BOOL)hasMegafonCategoryBanner;
- (NSURL *)megafonBannerUrl;
- (nullable id<MWMBanner>)searchCategoryBanner;
- (BOOL)isSearchHistoryEmpty;

View file

@ -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<MWMBanner>)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()];
}