department-of-veterans-affairs / va-mobile-app

"If VA were a company, it would have a flagship mobile app."
https://department-of-veterans-affairs.github.io/va-mobile-app/
16 stars 2 forks source link

Add new event for app is closed or moved to the background #6225

Open g-opzt opened 1 year ago

g-opzt commented 1 year ago

ACs

See thread here for discussion on why we are not currently going to track closures.

narin commented 1 year ago

This should be possible using React Native's built-in AppState API. I don't think a spike is required and we can make this a normal ticket instead.

g-opzt commented 1 year ago

Thanks, Narin. I revised this to reflect that.

theodur commented 1 year ago

We also have the useOnResumeForeground hook that does the inverse of this (called when the app is moved from the background to the foreground). It also uses the AppState API that Narin mentioned, so that hook might be a helpful reference

Sparowhawk commented 11 months ago

@g-opzt @narin

Looking through this I was able to determine that we can only log when a user backgrounds the app. There is no current way in react native to log when the user or OS kills the app as the native code is killed first before it gets to the react native portion. That being said potential solutions would be to hook up native firebase for Android and iOS respectively which may be fairly difficult or we can be fine with only getting when the user backgrounds the app.

g-opzt commented 11 months ago

Yes, we can go ahead with just tracking moving to the background. I will update the description here so the event better reflects what we're tracking.

timwright12 commented 2 months ago

@OVezeamama Can you review and decide if this is still data we want to track? I'm unclear what we're looking for with this information

OVezeamama commented 2 months ago

@timwright12 Yes we will be going ahead with this. Goal is to see analytics for app closure and exits.

OVezeamama commented 2 months ago

@theodur Is this something you can assist with?

theodur commented 2 months ago

@OVezeamama Yeah, I or any of the other global FE engineers can do this. It'll probably need to be prioritized by @ajsarkar28 for an upcoming sprint, or one of us would potentially get to this if we finish all the sprint work early

OVezeamama commented 2 months ago

Will touch base with @ajsarkar28 to discuss priorities. Thanks