Added new tags to PushWoosh

This commit is contained in:
r.kuznetsov 2017-01-16 14:54:23 +03:00
parent 07dbaa9e81
commit d87c8f5c5b
3 changed files with 17 additions and 0 deletions

View file

@ -7,6 +7,8 @@ namespace marketing
char const * const kMapVersion = "map_version";
char const * const kMapListing = "map_listing";
char const * const kMapDownloadDiscovered = "map_download_discovered";
char const * const kMapLastDownloaded = "last_map_downloaded";
char const * const kMapLastDownloadedTimestamp = "last_map_downloaded_time";
char const * const kRoutingP2PVehicleDiscovered = "routing_p2p_vehicle_discovered";
char const * const kRoutingP2PPedestrianDiscovered = "routing_p2p_pedestrian_discovered";
char const * const kRoutingP2PBicycleDiscovered = "routing_p2p_bicycle_discovered";

View file

@ -12,6 +12,8 @@ namespace marketing
extern char const * const kMapVersion;
extern char const * const kMapListing;
extern char const * const kMapDownloadDiscovered;
extern char const * const kMapLastDownloaded;
extern char const * const kMapLastDownloadedTimestamp;
extern char const * const kRoutingP2PVehicleDiscovered;
extern char const * const kRoutingP2PPedestrianDiscovered;
extern char const * const kRoutingP2PBicycleDiscovered;

View file

@ -15,6 +15,7 @@
#include "coding/reader.hpp"
#include "coding/url_encode.hpp"
#include "base/gmtime.hpp"
#include "base/logging.hpp"
#include "base/scope_guard.hpp"
#include "base/stl_helpers.hpp"
@ -1559,6 +1560,18 @@ bool Storage::GetUpdateInfo(TCountryId const & countryId, UpdateInfo & updateInf
void Storage::CorrectJustDownloadedAndQueue(TQueue::iterator justDownloadedItem)
{
// Send stastics to Push Woosh.
{
GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapLastDownloaded,
justDownloadedItem->GetCountryId());
char nowStr[18]{};
auto const tp = std::chrono::system_clock::from_time_t(time(nullptr));
tm now = my::GmTime(std::chrono::system_clock::to_time_t(tp));
strftime(nowStr, sizeof(nowStr), "%Y-%m-%d %H:%M", &now);
GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapLastDownloadedTimestamp,
std::string(nowStr));
}
m_justDownloaded.insert(justDownloadedItem->GetCountryId());
m_queue.erase(justDownloadedItem);
if (m_queue.empty())