You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can be reproduced using the example app in the React Native tracker. The example app tracks background events when the app goes to background but does not track any foreground events when the app comes back to foreground.
This seems to be an issue in the iOS tracker because when debugging what happens, it seems that the Session.updateInBackground() and Session.updateInForeground() functions are called correctly, however the state in the Session object is not correct – when the app comes back to foreground, the isBackground variable is false even though the updateInBackground() call was executed previously.
I think this is because iOS makes a memory snapshot of the app before the isBackground flag is changed. When the app comes back to foreground, the snapshot does not know that it was in background before. This is just a hypothesis but in case it is true, we should store the background state in user preferences instead of in memory (that would also make it more resilient to crashes in the background).
The text was updated successfully, but these errors were encountered:
This can be reproduced using the example app in the React Native tracker. The example app tracks background events when the app goes to background but does not track any foreground events when the app comes back to foreground.
This seems to be an issue in the iOS tracker because when debugging what happens, it seems that the
Session.updateInBackground()
andSession.updateInForeground()
functions are called correctly, however the state in theSession
object is not correct – when the app comes back to foreground, theisBackground
variable isfalse
even though theupdateInBackground()
call was executed previously.I think this is because iOS makes a memory snapshot of the app before the
isBackground
flag is changed. When the app comes back to foreground, the snapshot does not know that it was in background before. This is just a hypothesis but in case it is true, we should store the background state in user preferences instead of in memory (that would also make it more resilient to crashes in the background).The text was updated successfully, but these errors were encountered: