Skip to content

Commit 3dc749a

Browse files
authored
Fix possible issue with multiple open events (#511)
1 parent 03f4ceb commit 3dc749a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,12 @@ private static boolean isActivityWithIntentStarted(Context context, Bundle notif
700700
resolveIntentActivity(context, deepLinkIntent);
701701
String messageId = LeanplumPushService.getMessageId(notification);
702702
if (messageId != null) {
703-
ActionContext actionContext = new ActionContext(
704-
ActionManager.PUSH_NOTIFICATION_ACTION_NAME, null, messageId);
705-
actionContext.track(OPEN_ACTION, 0.0, null);
706703
try {
707704
context.startActivity(deepLinkIntent);
705+
// track event only after successful activity start
706+
ActionContext actionContext = new ActionContext(
707+
ActionManager.PUSH_NOTIFICATION_ACTION_NAME, null, messageId);
708+
actionContext.track(OPEN_ACTION, 0.0, null);
708709
} catch (ActivityNotFoundException e) {
709710
return false;
710711
}

0 commit comments

Comments
 (0)