Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'android/jni/com/mapswithme/platform/Platform.cpp')
-rw-r--r--android/jni/com/mapswithme/platform/Platform.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/android/jni/com/mapswithme/platform/Platform.cpp b/android/jni/com/mapswithme/platform/Platform.cpp
index 16793dcccc..291b925e47 100644
--- a/android/jni/com/mapswithme/platform/Platform.cpp
+++ b/android/jni/com/mapswithme/platform/Platform.cpp
@@ -1,6 +1,7 @@
#include "Platform.hpp"
#include "../core/jni_helper.hpp"
+#include "../core/ScopedEnv.hpp"
#include "platform/settings.hpp"
@@ -86,7 +87,22 @@ void Platform::SendPushWooshTag(string const & tag, vector<string> const & value
void Platform::SendMarketingEvent(string const & tag, map<string, string> const & params)
{
- // TODO: Add implementation.
+ ScopedEnv env(jni::GetJVM());
+ if (!env)
+ return;
+
+ string eventData = tag;
+
+ for (auto const & item : params)
+ {
+ eventData.append("_" + item.first + ": " + item.second);
+ }
+
+ static jmethodID const myTrackerTrackEvent =
+ env->GetStaticMethodID(g_myTrackerClazz, "trackEvent", "(Ljava/lang/String;)V");
+
+ env->CallStaticVoidMethod(g_myTrackerClazz, myTrackerTrackEvent,
+ jni::ToJavaString(env.get(), eventData));
}
Platform::EConnectionType Platform::ConnectionStatus()