[APP-1805] Analytics tweaks and tracking callbacks (#9861)

This commit is contained in:
Eric Bailey
2026-02-19 15:31:35 -06:00
committed by GitHub
parent 1565e071c1
commit 4e3c3e9905
8 changed files with 89 additions and 22 deletions
+10
View File
@@ -18,6 +18,16 @@ export function getInitialSessionId() {
return sessionId
}
/**
* Gets the current session ID. Freshness depends on `useSessionId` being
* mounted, which handles refreshing this value between foreground/background
* transitions. Since that's mounted in `analytics/index.tsx`, this value can
* generally be trusted to be up to date.
*/
export function getSessionId() {
return device.get(['nativeSessionId'])
}
export function useSessionId() {
const [id, setId] = useState(() => sessionId)