Product Benefits Pricing Guides Docs About Contact us Try it out
Engagement

Firebase Auth 13.1: Token Refresh Sign-Out Check

Firebase Apple SDK 13.1 refreshes tokens instead of signing users out. Use auth token refresh tracking to measure the retention impact.

· 3 min read

If your iOS app signs people out unexpectedly, you lose them at the worst moment: mid-session, mid-purchase, mid-task. Firebase Apple SDK 13.1.0 (21 October 2026) changes how Firebase Auth handles INVALID_ID_TOKEN and TOKEN_EXPIRED errors. Previously these could sign the user out. Now the SDK refreshes the token first. It also fixes a crash loop caused by very large token lifetimes and a first-listener call that could report “no user” while the stored user was still loading.

These are good fixes, but without tracking you cannot tell whether they helped your app. Unexpected sign-outs rarely show up as crashes. They show up as vague drops in retention, support tickets saying “it logged me out again”, and funnels that quietly leak at the login step.

Data Points to Track

Log these as events or properties so you can compare before and after the upgrade:

  • auth_state_change with from_state, to_state and reason (user_initiated, token_expired, token_invalid, unknown)
  • auth_token_refresh with result (success, failed), latency_ms and trigger (foreground, api_call, listener)
  • auth_listener_first_callback with user_present (boolean) and ms_since_launch
  • session_interrupted_by_signout with screen_name and seconds_into_session
  • reauth_prompt_shown and reauth_prompt_completed
  • firebase_apple_sdk_version as a user or event property
  • token_lifetime_bucket if you use custom tokens (under 1 hour, 1-24 hours, over 24 hours)

Setup Steps

  1. Add firebase_apple_sdk_version as a user property before you upgrade, so you have a clean baseline.
  2. Register an auth state listener and send auth_state_change whenever the user goes from signed in to signed out without a tap on your sign-out button. Mark those with a non-user-initiated reason.
  3. Wrap your token fetch (getIDTokenForcingRefresh) with timing code and send auth_token_refresh with the result and latency.
  4. Record the first listener callback after launch. If user_present is false but the person is later signed in, you have found the loading race the release notes describe.
  5. Ship the upgrade to a staged rollout (for example 10 per cent) and keep the old version on the rest.
  6. Build a dashboard comparing involuntary sign-out rate per 1,000 sessions by SDK version.
  7. If you issue custom tokens, check the lifetime you set. Values outside a 24-hour window now fall back to one hour, which may shorten sessions you expected to be longer.

Actionable Insights

Involuntary sign-out rate is your headline number. If it drops after the upgrade, the fix is working. If it stays flat, your sign-outs have another cause, such as revoked sessions or password changes on the server.

Refresh failure rate tells you whether the new behaviour is silently failing. A high failed share means users will still hit a login screen, just later.

Launch-time user_present false values point to UI flashes of the logged-out state. Delay your first screen decision until the listener has fired, then watch bounce at launch.

Token lifetime shifts matter if you use custom tokens. A sudden shortening of average session length for those users after the upgrade is the signal to review your configured lifetime.

Pair the data with support volume. A fall in “logged out” complaints alongside the metrics above is the strongest proof the upgrade paid off.