Skip to content

Flutter integration: Authentication token refresh fails after 1 hour #17029

@TakuroNagasawa

Description

@TakuroNagasawa

Description

When using Firebase iOS SDK with Flutter, all Firebase services become unavailable after approximately 1 hour of usage. This appears to be a token refresh issue, as it occurs around the default token expiration time.

Related Issues

Environment

  • Flutter version: 3.27.3
  • firebase_core: ^3.10.1
  • firebase_auth: ^5.4.1
  • Other Firebase packages listed in Flutter issue

Issue Details

The token refresh mechanism appears to fail after the initial token expires (~1 hour), causing all Firebase services to become unavailable. This includes:

  • Authentication
  • Firestore
  • Cloud Functions

Error Messages

Multiple error types are encountered depending on the service being accessed:

PlatformException(unavailable, The service is currently unavailable...)
PlatformException(unknown, Unknown error or an error from a different error domain...)
PlatformException(internal-error, An internal error has occurred...)

Questions

  1. Is there a known issue with token refresh when integrated with Flutter?
  2. Are there specific iOS background task settings required for token refresh?
  3. Is there a way to debug the token refresh process?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions