[MAPSME-6522] Added Facebook banner to search.

This commit is contained in:
Ilya Grechuhin 2018-01-18 13:27:19 +03:00 committed by Arsentiy Milchakov
parent 6762ff3867
commit 725e2d777f
4 changed files with 21 additions and 1 deletions

View file

@ -17,6 +17,8 @@ Engine::Engine()
// The banner systems are placed by priority. First has a top priority.
m_banners.emplace_back(Banner::Type::RB, my::make_unique<Rb>());
m_banners.emplace_back(Banner::Type::Mopub, my::make_unique<Mopub>());
m_searchBanners.emplace_back(Banner::Type::Facebook, my::make_unique<Facebook>());
}
bool Engine::HasBanner(feature::TypesHolder const & types,

View file

@ -4,15 +4,23 @@ namespace
{
#if defined(OMIM_OS_IPHONE)
auto const kSingleBannerIdForAllTypes = "185237551520383_1450324925011633";
#else
auto const kSearchbannerId = "185237551520383_1453784847998974";
#elif defined(OMIM_OS_ANDROID)
auto const kSingleBannerIdForAllTypes = "185237551520383_1450325641678228";
auto const kSearchbannerId = "185237551520383_1384653791578747";
#else
auto const kSearchbannerId = "dummy";
#endif
} // namespace
namespace ads
{
bool Facebook::HasSearchBanner() const { return true; }
std::string Facebook::GetBannerIdForOtherTypes() const
{
return kSingleBannerIdForAllTypes;
}
std::string Facebook::GetSearchBannerId() const { return kSearchbannerId; }
} // namespace ads

View file

@ -11,6 +11,8 @@ public:
Facebook() = default;
// ContainerBase overrides:
bool HasSearchBanner() const override;
std::string GetBannerIdForOtherTypes() const override;
std::string GetSearchBannerId() const override;
};
} // namespace ads

View file

@ -8,6 +8,14 @@
namespace
{
UNIT_TEST(Facebook_BannerInSearch)
{
ads::Facebook facebook;
TEST(facebook.HasSearchBanner(), ());
auto result = facebook.GetSearchBannerId();
TEST_EQUAL(result, "dummy", ());
}
UNIT_TEST(Facebook_GetBanner)
{
classificator::Load();