Skip to content

Commit 290200a

Browse files
authored
Merge pull request #399 from Iterable/jay/MOB-3709-isTracking
[MOB-3709] adds function to inbox session manager
2 parents 4099e59 + 2b7c14b commit 290200a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/InboxSessionManager.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ public class InboxSessionManager {
1717
IterableInboxSession session = new IterableInboxSession();
1818
Map<String, ImpressionData> impressions = new HashMap<>();
1919

20+
public boolean isTracking() {
21+
return session.sessionStartTime != null;
22+
}
23+
2024
public void startSession() {
21-
if (session.sessionStartTime != null) {
25+
if (isTracking()) {
2226
IterableLogger.e(TAG, "Inbox session started twice");
2327
return;
2428
}
@@ -42,7 +46,7 @@ public void startSession(List<IterableInboxSession.Impression> visibleRows) {
4246
}
4347

4448
public void endSession() {
45-
if (session.sessionStartTime == null) {
49+
if (!isTracking()) {
4650
IterableLogger.e(TAG, "Inbox Session ended without start");
4751
return;
4852
}

0 commit comments

Comments
 (0)