diff --git a/partners_api/ads_engine.cpp b/partners_api/ads_engine.cpp index ccc273c824..f148044b3f 100644 --- a/partners_api/ads_engine.cpp +++ b/partners_api/ads_engine.cpp @@ -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()); m_banners.emplace_back(Banner::Type::Mopub, my::make_unique()); + + m_searchBanners.emplace_back(Banner::Type::Facebook, my::make_unique()); } bool Engine::HasBanner(feature::TypesHolder const & types, diff --git a/partners_api/facebook_ads.cpp b/partners_api/facebook_ads.cpp index 07b19d60f9..cbfb11ba7b 100644 --- a/partners_api/facebook_ads.cpp +++ b/partners_api/facebook_ads.cpp @@ -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 diff --git a/partners_api/facebook_ads.hpp b/partners_api/facebook_ads.hpp index aa62be4046..4d0c1b7232 100644 --- a/partners_api/facebook_ads.hpp +++ b/partners_api/facebook_ads.hpp @@ -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 diff --git a/partners_api/partners_api_tests/facebook_tests.cpp b/partners_api/partners_api_tests/facebook_tests.cpp index f3a7f9983f..e05adc0f59 100644 --- a/partners_api/partners_api_tests/facebook_tests.cpp +++ b/partners_api/partners_api_tests/facebook_tests.cpp @@ -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();