diff --git a/configure.sh b/configure.sh index f5143ab633..c3250bea1c 100755 --- a/configure.sh +++ b/configure.sh @@ -82,7 +82,7 @@ else #define VIATOR_ACCOUNT_ID_JA "" #define YANDEX_CLIENT_ID "" #define YANDEX_API_KEY "" -#define YANDEX_BASE_URL "" +#define YANDEX_TRACKING_ID "" ' > "$PRIVATE_HEADER" echo 'ext { spropStoreFile = "../tools/android/debug.keystore" diff --git a/partners_api/partners_api_tests/yandex_tests.cpp b/partners_api/partners_api_tests/yandex_tests.cpp index e188997189..188c551e5f 100644 --- a/partners_api/partners_api_tests/yandex_tests.cpp +++ b/partners_api/partners_api_tests/yandex_tests.cpp @@ -39,15 +39,4 @@ UNIT_TEST(Yandex_GetAvailableProducts) TEST(!resultProducts.empty(), ()); } - -UNIT_TEST(Yandex_GetRideRequestLinks) -{ - taxi::yandex::Api api; - ms::LatLon const from(55.796918, 37.537859); - ms::LatLon const to(55.758213, 37.616093); - - auto const links = api.GetRideRequestLinks("", from, to); - - TEST(!links.m_deepLink.empty(), ()); -} } // namespace diff --git a/partners_api/yandex_api.cpp b/partners_api/yandex_api.cpp index c7cbdd26af..616ab4f522 100644 --- a/partners_api/yandex_api.cpp +++ b/partners_api/yandex_api.cpp @@ -7,14 +7,16 @@ #include "base/logging.hpp" #include "base/thread.hpp" -#include "3party/jansson/myjansson.hpp" - -#include "private.h" +#include "std/target_os.hpp" #include #include #include +#include "3party/jansson/myjansson.hpp" + +#include "private.h" + namespace { bool RunSimpleHttpRequest(std::string const & url, std::string & result) @@ -105,9 +107,15 @@ RideRequestLinks Api::GetRideRequestLinks(std::string const & productId, ms::Lat ms::LatLon const & to) const { std::ostringstream deepLink; - deepLink << YANDEX_BASE_URL << "%3A%2F%2Froute%3Fstart-lat%3D" << from.lat << "%26start-lon%3D" - << from.lon << "%26end-lat%3D" << to.lat << "%26end-lon%3D" << to.lon - << "%26utm_source%3Dmapsme"; + +#if defined(OMIM_OS_IPHONE) + deepLink << "https://3.redirect.appmetrica.yandex.com/route?start-lat=" << from.lat + << "&start-lon=" << from.lon << "&end-lat=" << to.lat << "&end-lon=" << to.lon + << "&utm_source=mapsme&appmetrica_tracking_id=" << YANDEX_TRACKING_ID; +#elif defined(OMIM_OS_ANDROID) + deepLink << "https://redirect.appmetrica.yandex.com/serve/" << YANDEX_TRACKING_ID << "?startlat=" + << from.lat << "&startlon=" << from.lon << "&endlat=" << to.lat << "&endlon=" << to.lon; +#endif return {deepLink.str(), ""}; }