published fresh until

Expo: how do I add login, protected screens and push?

Summary Load the session before showing routes, guard authenticated screens with Stack.Protected, then register notifications and send through the Expo Push API. Use a development build and read push tickets and receipts when delivery fails.

Not for paid subscriptions or an in-app notification history.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: place session state above the navigator and wait for it to load before showing routes (authentication guide).

Short answer

Guard private screens with Stack.Protected and register push separately (authentication, notifications). Send the resulting Expo push token to the Push API, then inspect tickets and receipts (sending guide). Use a development build and configure release credentials (FAQ).

Choose / don't choose

  • Protected routes: use for client navigation gating; the guide's authentication provider is a mock, so replace it with actual sign-in logic (authentication).
  • Expo Push Service: use its token and API for delivery; direct provider integration is a separate route (sending guide).

Settings that matter

Setting or flagValue / defaultApplies toSource
Stack.Protected guard!!session for private screens; !session for sign-inExpo RouterAuthentication
Splash visibilityKeep visible until session loading completesInitial app navigationAuthentication
Notifications installnpx expo install expo-notificationsExpo appSDK reference
Android notification priorityhigh for greatest display likelihood; omitted means defaultPush payloadFAQ

Order of operations

1. Implement the session provider and real sign-in. The guide illustrates native persistence with expo-secure-store (authentication). 2. Add the protected route guards after session loading (authentication). 3. Install and configure notifications. On Android create a notification channel before requesting permission; then call getExpoPushTokenAsync with the project’s projectId (SDK reference). 4. Send the token to the Expo Push API. Use the returned ticket ID to retrieve its receipt; a receipt describes provider handoff, not device delivery (sending guide, FAQ). 5. If push fails, isolate client behavior with a local notification, then inspect ticket and receipt errors and release credentials (FAQ).

Known failures and fixes

SymptomCauseFixSource
Sign-in flashes at launchSession loading is asynchronousKeep the splash visible until loading completesAuthentication
Push fails only in the release appMissing or misconfigured app credentialsConfigure Android credentials and the iOS push keyFAQ
DeviceNotRegisteredToken no longer identifies a registered installationStop sending to that tokenFAQ

Missing

  • How should the backend authorize protected data? The navigation example does not implement the app's server authorization policy.
  • How are push tokens associated with accounts and removed on logout? These sources do not give a complete account-lifecycle recipe.
  • Which sign-in provider and refresh policy should this app use? The sample provider is a mock (authentication).

Checked

2026-11-23; sources read:

Started from a post by @WhatWorks editors, packaged by the editor.

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Expo: how do I add login, protected screens and push?
Summary: Load the session before showing routes, guard authenticated screens with Stack.Protected, then register notifications and send through the Expo Push API. Use a development build and read push tickets and receipts when delivery fails.
Copy for agent
get the whatworks thread case-expo-auth-protected-routes-push-notifications and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread case-expo-auth-protected-routes-push-notifications
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks