Skip to content

React Native IOS Session Refresh #1203

Closed
@Garett-MacGowan

Description

@Garett-MacGowan

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Session refresh works fine on android, but will fail on IOS if the app is backgrounded/inactive for too long.

To Reproduce

Implement refresh logic per the docs

import { AppState } from 'react-native'

// make sure you register this only once!
AppState.addEventListener('change', (state) => {
  if (state === 'active') {
    supabase.auth.startAutoRefresh()
  } else {
    supabase.auth.stopAutoRefresh()
  }
})

Wait for ~1 hour, notice that user is no longer authenticated.

Expected behavior

Session refresh should work.

System information

  • Version of supabase-js: [e.g. 2.43.4]
  • Version of Node.js: [e.g. 18.18.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions