Skip to content

Commit 02c1b06

Browse files
authored
Push metrics (#391)
* add track events for push metrics * update names
1 parent b2568f5 commit 02c1b06

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

AndroidSDKPush/src/main/java/com/leanplum/LeanplumPushService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ private static String getMessageId(Bundle message) {
241241
}
242242

243243
static void handleNotification(final Context context, final Bundle message) {
244+
Map<String,String> properties = new HashMap<String, String>();
245+
properties.put("messageID",getMessageId(message));
246+
Leanplum.track("Push Delivered", properties);
244247
if (LeanplumActivityHelper.getCurrentActivity() != null
245248
&& !LeanplumActivityHelper.isActivityPaused
246249
&& (message.containsKey(Keys.PUSH_MESSAGE_ID_MUTE_WITH_ACTION)
@@ -402,6 +405,9 @@ public void variablesChanged() {
402405

403406
static void openNotification(Context context, Intent intent) {
404407
Log.d("Opening push notification action.");
408+
Map<String,String> properties = new HashMap<String, String>();
409+
properties.put("messageID",getMessageId(intent.getExtras()));
410+
Leanplum.track("Push Opened", properties);
405411
// Pre handles push notification.
406412
Bundle notification = preHandlePushNotification(context, intent);
407413
if (notification == null) {

0 commit comments

Comments
 (0)