File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
firebase-sessions/src/main/kotlin/com/google/firebase/sessions Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ constructor(
6464 override var isInForeground = false
6565 private set
6666
67+ private var pendingForegroundCheck = false
68+
6769 /* *
6870 * Either notify the subscribers with general multi-process supported session or fallback local
6971 * session
@@ -93,6 +95,10 @@ constructor(
9395 }
9496 .collect { sessionData ->
9597 localSessionData = sessionData
98+ if (pendingForegroundCheck) {
99+ pendingForegroundCheck = false
100+ appForeground()
101+ }
96102 val sessionId = sessionData.sessionDetails.sessionId
97103 notifySubscribers(sessionId, NotificationType .GENERAL )
98104 }
@@ -122,6 +128,7 @@ constructor(
122128 override fun appForeground () {
123129 isInForeground = true
124130 if (! ::localSessionData.isInitialized) {
131+ pendingForegroundCheck = true
125132 Log .d(TAG , " App foregrounded, but local SessionData not initialized" )
126133 return
127134 }
You can’t perform that action at this time.
0 commit comments